PDAModuleService.cs 573 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:PDAModuleService.cs
  5. * 2.功能描述:PDA模块WCF服务
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 陈晓野 2014/09/16 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.IO;
  14. using System.ServiceModel;
  15. using System.ServiceModel.Activation;
  16. using Dongke.IBOSS.PRD.Basics.BaseResources;
  17. using Dongke.IBOSS.PRD.Basics.Library;
  18. using Dongke.IBOSS.PRD.Service.BarcodePrintService;
  19. using Dongke.IBOSS.PRD.Service.CommonModuleLogic;
  20. using Dongke.IBOSS.PRD.Service.DataModels;
  21. using Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic;
  22. using Dongke.IBOSS.PRD.Service.PCModuleLogic;
  23. using Dongke.IBOSS.PRD.Service.PDAModuleLogic;
  24. using Dongke.IBOSS.PRD.Service.PMModuleLogic;
  25. using Dongke.IBOSS.PRD.Service.PublicModuleService;
  26. using Dongke.IBOSS.PRD.Service.ReportModuleLogic;
  27. using Dongke.IBOSS.PRD.Service.SmartDeviceService;
  28. using Dongke.IBOSS.PRD.Service.SystemModuleLogic;
  29. using Dongke.IBOSS.PRD.WCF.Contracts;
  30. using Dongke.IBOSS.PRD.WCF.DataModels;
  31. using Dongke.IBOSS.PRD.WCF.DataModels.ConfigModule;
  32. using Dongke.IBOSS.PRD.WCF.DataModels.HRModule;
  33. using Dongke.IBOSS.PRD.WCF.DataModels.PCModule;
  34. using Dongke.IBOSS.PRD.WCF.DataModels.PMModule;
  35. namespace Dongke.IBOSS.PRD.WCF.Services
  36. {
  37. // 服务实现类,继承服务声明接口
  38. // 该标签声明该服务可以在ASP.NET下运行
  39. [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
  40. [ServiceBehavior(ConfigurationName = "PDAModuleService",
  41. InstanceContextMode = InstanceContextMode.PerCall,
  42. ConcurrencyMode = ConcurrencyMode.Multiple,
  43. UseSynchronizationContext = false)]
  44. public partial class PDAModuleService : IPDAModule
  45. {
  46. #region 属性
  47. /// <summary>
  48. /// 用户登陆的信息
  49. /// </summary>
  50. SUserInfo sUserInfo
  51. {
  52. get;
  53. set;
  54. }
  55. #endregion
  56. #region 构造函数
  57. /// <summary>
  58. /// 构造函数
  59. /// </summary>
  60. public PDAModuleService()
  61. : base()
  62. {
  63. }
  64. #endregion
  65. #region 验证
  66. /// <summary>
  67. /// 验证访问头
  68. /// </summary>
  69. /// <param name="accountCode">帐套编码</param>
  70. /// <param name="userCode">用户编码</param>
  71. /// <param name="userPassword">用户密码</param>
  72. /// <param name="sessionKey">访问密钥</param>
  73. /// <returns></returns>
  74. private ActionResult DoPDACheck(string accountCode, string userCode, string userPassword, string sessionKey)
  75. {
  76. try
  77. {
  78. ActionResult actionResult = new ActionResult();
  79. LoginRequestEntity requestEntity = new LoginRequestEntity();
  80. requestEntity.AccountCode = accountCode;
  81. requestEntity.UserCode = userCode;
  82. requestEntity.Password = userPassword;
  83. requestEntity.SessionKey = sessionKey;
  84. SUserInfo userInfo = null;
  85. string loginStatus = DKIBOSSPRDLogic.AuthenticateRepeatLogin(requestEntity, out userInfo);
  86. // 用户登录信息错误
  87. if (Constant.INT_IS_ONE.ToString().Equals(loginStatus))
  88. {
  89. actionResult.Status = (int)Constant.PDAResult.LoginInfoError;
  90. actionResult.Message = Constant.PDA_RESULT_LOGININFOERROR;
  91. }
  92. // 用户在其它终端登陆
  93. else if (Constant.INT_IS_TWO.ToString().Equals(loginStatus))
  94. {
  95. actionResult.Status = (int)Constant.PDAResult.RepeatLogin;
  96. actionResult.Message = Constant.PDA_RESULT_REPEATLOGIN;
  97. }
  98. // Lic错误
  99. else if ("3".Equals(loginStatus))
  100. {
  101. actionResult.Status = (int)Constant.PDAResult.LicInfoError;
  102. actionResult.Message = "授权信息错误,请联系管理员。";
  103. }
  104. else
  105. {
  106. actionResult.Status = (int)Constant.PDAResult.Success;
  107. }
  108. sUserInfo = userInfo;
  109. return actionResult;
  110. }
  111. catch (Exception ex)
  112. {
  113. throw ex;
  114. }
  115. }
  116. #endregion
  117. #region WCF服务
  118. /// <summary>
  119. /// 测试PDA连接WCF服务
  120. /// </summary>
  121. /// <param name="value">测试文本</param>
  122. /// <returns>返回文本</returns>
  123. public string TestConnectionEx(string value)
  124. {
  125. return "连接成功!" + value;
  126. }
  127. public string TestConnection()
  128. {
  129. return "连接成功!";
  130. }
  131. #endregion
  132. #region 系统登录
  133. /// <summary>
  134. /// 系统登录
  135. /// </summary>
  136. /// <param name="accountCode"></param>
  137. /// <param name="userCode"></param>
  138. /// <param name="userPassword"></param>
  139. /// <param name="macAddress"></param>
  140. /// <param name="ipAddress"></param>
  141. /// <param name="phoneCode"></param>
  142. /// <param name="phoneType"></param>
  143. /// <param name="appVersion"></param>
  144. /// <param name="systemType"></param>
  145. /// <param name="systemVersion"></param>
  146. /// <returns></returns>
  147. public PDALoginResult DoPDALogin(string accountCode, string userCode, string userPassword,
  148. string macAddress, string ipAddress, string phoneCode, string phoneType,
  149. string appVersion, string systemType, string systemVersion)
  150. {
  151. try
  152. {
  153. LoginRequestEntity requestEntity = new LoginRequestEntity();
  154. requestEntity.AccountCode = accountCode;
  155. requestEntity.UserCode = userCode;
  156. requestEntity.Password = userPassword;
  157. requestEntity.ComputerName = phoneCode;
  158. requestEntity.IPAddress = ipAddress;
  159. requestEntity.MACAddress = macAddress;
  160. PDALoginResult result = ServiceInvoker.Invoke<PDALoginResult>(this,
  161. () => PDAModuleLogic.DoPDALogin(requestEntity));
  162. return result;
  163. }
  164. catch (Exception ex)
  165. {
  166. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  167. OutputLog.TraceLog(LogPriority.Error,
  168. this.ToString(),
  169. System.Reflection.MethodBase.GetCurrentMethod().Name,
  170. ex.ToString(),
  171. LocalPath.LogExePath);
  172. PDALoginResult result = new PDALoginResult();
  173. result.Status = (int)Constant.PDAResult.Exception;
  174. result.Message = Constant.PDA_RESULT_EXCEPTION;
  175. return result;
  176. }
  177. }
  178. /// <summary>
  179. /// 退出
  180. /// </summary>
  181. /// <param name="accountCode">帐套code</param>
  182. /// <param name="userCode">用户code</param>
  183. /// <param name="userPassword">用户密码</param>
  184. /// <param name="sessionKey">本次登陆密钥</param>
  185. /// <returns></returns>
  186. public ActionResult DoPDAOut(string accountCode, string userCode, string userPassword, string sessionKey)
  187. {
  188. ActionResult actionResult = new ActionResult();
  189. try
  190. {
  191. // 验证请求头信息
  192. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  193. // 验证失败
  194. if (actionResult.Status != (int)Constant.PDAResult.Success)
  195. {
  196. return actionResult;
  197. }
  198. bool result = DKIBOSSPRDLogic.Logout(sUserInfo.UserID, "3", sUserInfo);
  199. actionResult.Result = JsonHelper.ToJson(result);
  200. actionResult.Status = (int)Constant.PDAResult.Success;
  201. }
  202. catch (Exception ex)
  203. {
  204. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  205. OutputLog.TraceLog(LogPriority.Error,
  206. this.ToString(),
  207. System.Reflection.MethodBase.GetCurrentMethod().Name,
  208. ex.ToString(),
  209. LocalPath.LogExePath);
  210. actionResult.Status = (int)Constant.PDAResult.Exception;
  211. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  212. }
  213. return actionResult;
  214. }
  215. /// <summary>
  216. /// 修改密码
  217. /// </summary>
  218. /// <param name="accountCode"></param>
  219. /// <param name="userCode"></param>
  220. /// <param name="userPassword"></param>
  221. /// <param name="sessionKey"></param>
  222. /// <returns></returns>
  223. public ActionResult ChangeUserPassword(string accountCode, string userCode, string userPassword, string sessionKey,
  224. string newPassWord)
  225. {
  226. ActionResult actionResult = new ActionResult();
  227. try
  228. {
  229. // 验证请求头信息
  230. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  231. // 验证失败
  232. if (actionResult.Status != (int)Constant.PDAResult.Success)
  233. {
  234. return actionResult;
  235. }
  236. string result = ServiceInvoker.Invoke<string>(this,
  237. () => SystemModuleDAL.SaveUserPassWord(newPassWord, userCode, null, sUserInfo));
  238. actionResult.Status = (int)Constant.PDAResult.Success;
  239. }
  240. catch (Exception ex)
  241. {
  242. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  243. OutputLog.TraceLog(LogPriority.Error,
  244. this.ToString(),
  245. System.Reflection.MethodBase.GetCurrentMethod().Name,
  246. ex.ToString(),
  247. LocalPath.LogExePath);
  248. actionResult.Status = (int)Constant.PDAResult.Exception;
  249. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  250. }
  251. return actionResult;
  252. }
  253. /// <summary>
  254. /// 获取Apk信息
  255. /// </summary>
  256. /// <returns></returns>
  257. public string GetApkInfo()
  258. {
  259. try
  260. {
  261. ServiceResultEntity sre = PDAModuleLogic.GetApkInfo();
  262. return JsonHelper.ToJson(sre);
  263. }
  264. catch (Exception ex)
  265. {
  266. OutputLog.TraceLog(LogPriority.Error,
  267. this.ToString(),
  268. System.Reflection.MethodBase.GetCurrentMethod().Name,
  269. ex.ToString(),
  270. LocalPath.LogExePath);
  271. return null;
  272. }
  273. }
  274. #endregion
  275. #region 取得展示数据
  276. /// <summary>
  277. /// 获得生产线菜单
  278. /// </summary>
  279. /// <param name="accountCode">帐套code</param>
  280. /// <param name="userCode">用户code</param>
  281. /// <param name="userPassword">用户密码</param>
  282. /// <param name="sessionKey">本次登陆密钥</param>
  283. /// <returns></returns>
  284. /// <remarks>
  285. /// 陈冰 2014.09.18 新建
  286. /// </remarks>
  287. public ActionResult GetProductionLineMenu(string accountCode, string userCode, string userPassword, string sessionKey)
  288. {
  289. ActionResult actionResult = new ActionResult();
  290. try
  291. {
  292. // 验证请求头信息
  293. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  294. // 验证失败
  295. if (actionResult.Status != (int)Constant.PDAResult.Success)
  296. {
  297. return actionResult;
  298. }
  299. // 查询菜单
  300. DataTable dtPLM = ServiceInvoker.Invoke<DataTable>(this,
  301. () => PDAModuleLogic.GetProductionLineMenu(sUserInfo));
  302. PDAFunctionResult pdaFunction = new PDAFunctionResult();
  303. pdaFunction.MenuCode = "Root";
  304. DataRow[] navigationRows = dtPLM.Select("LEN(MenuCode) = " + Constant.INT_IS_TWO.ToString(), "MenuCode ASC"); // 编号2为一级菜单
  305. foreach (DataRow newRow in navigationRows)
  306. {
  307. #region 插入子节点数据
  308. int? intProcedureID = null;
  309. int? intModelType = null;
  310. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  311. {
  312. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  313. }
  314. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  315. {
  316. intModelType = Convert.ToInt32(newRow["ModelType"]);
  317. }
  318. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  319. //xuwei add 2020-01-02
  320. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  321. //pdaFunctionChild.IsGlazeChange = 0;
  322. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  323. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  324. pdaFunctionChild.ProcedureID = intProcedureID;
  325. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  326. pdaFunctionChild.ModelType = intModelType;
  327. pdaFunction.PDAFunctions.Add(pdaFunctionChild);
  328. #endregion
  329. InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild);
  330. }
  331. //actionResult.Result = JsonHelper.ToJson(dtPLM);
  332. actionResult.Result = JsonHelper.ToJson(pdaFunction);
  333. actionResult.Status = (int)Constant.PDAResult.Success;
  334. }
  335. catch (Exception ex)
  336. {
  337. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  338. OutputLog.TraceLog(LogPriority.Error,
  339. this.ToString(),
  340. System.Reflection.MethodBase.GetCurrentMethod().Name,
  341. ex.ToString(),
  342. LocalPath.LogExePath);
  343. actionResult.Status = (int)Constant.PDAResult.Exception;
  344. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  345. }
  346. return actionResult;
  347. }
  348. /// <summary>
  349. /// 初始化树形控件
  350. /// </summary>
  351. /// <param name="treeTable">菜单数据表</param>
  352. /// <param name="rows">待处理的菜单集合</param>
  353. /// <param name="node">当前树节点</param>
  354. private void InitTreeView(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions)
  355. {
  356. string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = "
  357. + (pFuncCode.Length + Constant.INT_IS_TWO);
  358. DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC");
  359. //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC");
  360. foreach (DataRow newRow in subRows)
  361. {
  362. #region 插入子节点数据
  363. int? intProcedureID = null;
  364. int? intModelType = null;
  365. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  366. {
  367. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  368. }
  369. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  370. {
  371. intModelType = Convert.ToInt32(newRow["ModelType"]);
  372. }
  373. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  374. //xuwei add 2020-01-02
  375. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  376. //pdaFunctionChild.IsGlazeChange = 0;
  377. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  378. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  379. pdaFunctionChild.ProcedureID = intProcedureID;
  380. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  381. pdaFunctionChild.ModelType = intModelType;
  382. pFunctions.PDAFunctions.Add(pdaFunctionChild);
  383. #endregion
  384. // 递归方法
  385. InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild);
  386. }
  387. }
  388. #endregion
  389. #region 获得工序信息
  390. /// <summary>
  391. /// 获得工序信息
  392. /// </summary>
  393. /// <param name="accountCode">帐套code</param>
  394. /// <param name="userCode">用户code</param>
  395. /// <param name="userPassword">用户密码</param>
  396. /// <param name="sessionKey">本次登陆密钥</param>
  397. /// <param name="procedureID">工序ID</param>
  398. /// <returns></returns>
  399. /// <remarks>
  400. /// 陈冰 2014.09.18 新建
  401. /// </remarks>
  402. public ActionResult GetProcedureByID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  403. {
  404. ActionResult actionResult = new ActionResult();
  405. try
  406. {
  407. // 验证请求头信息
  408. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  409. // 验证失败
  410. if (actionResult.Status != (int)Constant.PDAResult.Success)
  411. {
  412. return actionResult;
  413. }
  414. ProcedureEntity procedureEntity = ServiceInvoker.Invoke<ProcedureEntity>(this,
  415. () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo));
  416. actionResult.Result = JsonHelper.ToJson(procedureEntity);
  417. actionResult.Status = (int)Constant.PDAResult.Success;
  418. }
  419. catch (Exception ex)
  420. {
  421. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  422. OutputLog.TraceLog(LogPriority.Error,
  423. this.ToString(),
  424. System.Reflection.MethodBase.GetCurrentMethod().Name,
  425. ex.ToString(),
  426. LocalPath.LogExePath);
  427. actionResult.Status = (int)Constant.PDAResult.Exception;
  428. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  429. }
  430. return actionResult;
  431. }
  432. #endregion
  433. #region 校验
  434. /// <summary>
  435. /// 校验产品条码是否可以走到该工序
  436. /// </summary>
  437. /// <param name="accountCode">帐套code</param>
  438. /// <param name="userCode">用户code</param>
  439. /// <param name="userPassword">用户密码</param>
  440. /// <param name="sessionKey">本次登陆密钥</param>
  441. /// <param name="procedureID">工序ID</param>
  442. /// <param name="barcode">条码</param>
  443. /// <returns></returns>
  444. /// <remarks>
  445. /// 陈冰 2014.09.18 新建
  446. /// </remarks>
  447. public ActionResult CheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode, bool isNewCheck)
  448. {
  449. ActionResult actionResult = new ActionResult();
  450. try
  451. {
  452. // 验证请求头信息
  453. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  454. // 验证失败
  455. if (actionResult.Status != (int)Constant.PDAResult.Success)
  456. {
  457. return actionResult;
  458. }
  459. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  460. () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo));
  461. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  462. {
  463. if (isNewCheck)
  464. {
  465. actionResult.Result = JsonHelper.ToJson(barcodeDataSet);
  466. }
  467. else
  468. {
  469. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  470. }
  471. actionResult.Status = (int)Constant.PDAResult.Success;
  472. }
  473. else
  474. {
  475. actionResult.Status = (int)Constant.PDAResult.Fail;
  476. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  477. }
  478. }
  479. catch (Exception ex)
  480. {
  481. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  482. OutputLog.TraceLog(LogPriority.Error,
  483. this.ToString(),
  484. System.Reflection.MethodBase.GetCurrentMethod().Name,
  485. ex.ToString(),
  486. LocalPath.LogExePath);
  487. actionResult.Status = (int)Constant.PDAResult.Exception;
  488. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  489. }
  490. return actionResult;
  491. }
  492. /// <summary>
  493. /// 校验产品条码是否可以进行干补
  494. /// </summary>
  495. /// <param name="accountCode">帐套code</param>
  496. /// <param name="userCode">用户code</param>
  497. /// <param name="userPassword">用户密码</param>
  498. /// <param name="sessionKey">本次登陆密钥</param>
  499. /// <param name="procedureID">工序ID</param>
  500. /// <param name="barcode">条码</param>
  501. /// <returns></returns>
  502. /// <remarks>
  503. /// 袁新成 2015.4.1 新建
  504. /// </remarks>
  505. public ActionResult CheckDryRepairBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  506. {
  507. ActionResult actionResult = new ActionResult();
  508. try
  509. {
  510. // 验证请求头信息
  511. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  512. // 验证失败
  513. if (actionResult.Status != (int)Constant.PDAResult.Success)
  514. {
  515. return actionResult;
  516. }
  517. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  518. () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
  519. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  520. {
  521. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  522. actionResult.Status = (int)Constant.PDAResult.Success;
  523. }
  524. else
  525. {
  526. actionResult.Status = (int)Constant.PDAResult.Fail;
  527. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  528. }
  529. }
  530. catch (Exception ex)
  531. {
  532. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  533. OutputLog.TraceLog(LogPriority.Error,
  534. this.ToString(),
  535. System.Reflection.MethodBase.GetCurrentMethod().Name,
  536. ex.ToString(),
  537. LocalPath.LogExePath);
  538. actionResult.Status = (int)Constant.PDAResult.Exception;
  539. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  540. }
  541. return actionResult;
  542. }
  543. /// <summary>
  544. /// 检验生产工号
  545. /// </summary>
  546. /// <param name="accountCode">帐套code</param>
  547. /// <param name="userCode">用户code</param>
  548. /// <param name="userPassword">用户密码</param>
  549. /// <param name="sessionKey">本次登陆密钥</param>
  550. /// <param name="procedureID">工序ID</param>
  551. /// <param name="procedureUserCode">生产工号</param>
  552. /// <remarks>
  553. /// 陈冰 2014.09.18 新建
  554. /// </remarks>
  555. public ActionResult CheckProcedureUser(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
  556. {
  557. ActionResult actionResult = new ActionResult();
  558. try
  559. {
  560. // 验证请求头信息
  561. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  562. // 验证失败
  563. if (actionResult.Status != (int)Constant.PDAResult.Success)
  564. {
  565. return actionResult;
  566. }
  567. CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
  568. () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
  569. actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
  570. actionResult.Status = (int)Constant.PDAResult.Success;
  571. }
  572. catch (Exception ex)
  573. {
  574. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  575. OutputLog.TraceLog(LogPriority.Error,
  576. this.ToString(),
  577. System.Reflection.MethodBase.GetCurrentMethod().Name,
  578. ex.ToString(),
  579. LocalPath.LogExePath);
  580. actionResult.Status = (int)Constant.PDAResult.Exception;
  581. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  582. }
  583. return actionResult;
  584. }
  585. /// <summary>
  586. /// 校验窑车是否可装车并返回窑车信息
  587. /// </summary>
  588. /// <param name="accountCode">帐套code</param>
  589. /// <param name="userCode">用户code</param>
  590. /// <param name="userPassword">用户密码</param>
  591. /// <param name="sessionKey">本次登陆密钥</param>
  592. /// <param name="kilnCarCode">窑车号</param>
  593. /// <param name="modelType">工序类别</param>
  594. /// <returns></returns>
  595. /// <remarks>
  596. /// 陈冰 2014.10.04 新建
  597. /// </remarks>
  598. public ActionResult CheckKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
  599. {
  600. ActionResult actionResult = new ActionResult();
  601. try
  602. {
  603. // 验证请求头信息
  604. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  605. // 验证失败
  606. if (actionResult.Status != (int)Constant.PDAResult.Success)
  607. {
  608. return actionResult;
  609. }
  610. CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
  611. () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
  612. actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
  613. actionResult.Status = (int)Constant.PDAResult.Success;
  614. }
  615. catch (Exception ex)
  616. {
  617. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  618. OutputLog.TraceLog(LogPriority.Error,
  619. this.ToString(),
  620. System.Reflection.MethodBase.GetCurrentMethod().Name,
  621. ex.ToString(),
  622. LocalPath.LogExePath);
  623. actionResult.Status = (int)Constant.PDAResult.Exception;
  624. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  625. }
  626. return actionResult;
  627. }
  628. #endregion
  629. #region 保存条码信息
  630. /// <summary>
  631. /// 保存条码信息
  632. /// </summary>
  633. /// <param name="accountCode">帐套code</param>
  634. /// <param name="userCode">用户code</param>
  635. /// <param name="userPassword">用户密码</param>
  636. /// <param name="sessionKey">本次登陆密钥</param>
  637. /// <param name="procedureID">工序ID</param>
  638. /// <param name="productionDataEntitys">条码信息</param>
  639. public ActionResult AddWorkPiece(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID,
  640. ProductionDataEntity[] productionDataEntitys)
  641. {
  642. ActionResult actionResult = new ActionResult();
  643. try
  644. {
  645. // 验证请求头信息
  646. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  647. // 验证失败
  648. if (actionResult.Status != (int)Constant.PDAResult.Success)
  649. {
  650. return actionResult;
  651. }
  652. DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
  653. if (!dtProductionData.Columns.Contains("IsPDA"))
  654. {
  655. dtProductionData.Columns.Add("IsPDA");
  656. }
  657. ProcedureEntity procedureInfo = null;
  658. DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
  659. () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
  660. actionResult.Result = JsonHelper.ToJson(resultDT);
  661. actionResult.Status = (int)Constant.PDAResult.Success;
  662. if (resultDT != null)
  663. {
  664. DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
  665. if (drs != null && drs.Length > 0)
  666. {
  667. return actionResult;
  668. }
  669. }
  670. #region PDA条码打印
  671. if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
  672. procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
  673. {
  674. try
  675. {
  676. if (procedureInfo.CollectType == 1)
  677. {
  678. //foreach (DataRow item in dtProductionData.Rows)
  679. //{
  680. // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
  681. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  682. // if (sre.Status != Constant.ServiceResultStatus.Success)
  683. // {
  684. // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  685. // actionResult.Message = sre.Message;
  686. // return actionResult;
  687. // }
  688. //}
  689. }
  690. else
  691. {
  692. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
  693. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  694. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(dtProductionData.Rows[0]["barcode"].ToString(),
  695. procedureInfo.BarCodePrintCopies, null, sUserInfo, 0);
  696. if (sre.Status != Constant.ServiceResultStatus.Success)
  697. {
  698. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  699. actionResult.Message = sre.Message;
  700. return actionResult;
  701. }
  702. }
  703. }
  704. catch (Exception ex)
  705. {
  706. OutputLog.TraceLog(LogPriority.Error,
  707. this.ToString(),
  708. System.Reflection.MethodBase.GetCurrentMethod().Name,
  709. ex.ToString(),
  710. LocalPath.LogExePath);
  711. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  712. actionResult.Message = "条码打印异常";
  713. return actionResult;
  714. }
  715. }
  716. #endregion PDA条码打印
  717. }
  718. catch (Exception ex)
  719. {
  720. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  721. OutputLog.TraceLog(LogPriority.Error,
  722. this.ToString(),
  723. System.Reflection.MethodBase.GetCurrentMethod().Name,
  724. ex.ToString(),
  725. LocalPath.LogExePath);
  726. try
  727. {
  728. string ss = JsonHelper.ToJson(productionDataEntitys);
  729. OutputLog.TraceLog(LogPriority.Error,
  730. this.ToString(),
  731. System.Reflection.MethodBase.GetCurrentMethod().Name,
  732. $" userCode:{userCode} procedureID:{procedureID} " + ss,
  733. LocalPath.LogExePath);
  734. }
  735. catch
  736. {
  737. }
  738. actionResult.Status = (int)Constant.PDAResult.Exception;
  739. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  740. }
  741. return actionResult;
  742. }
  743. #endregion
  744. #region 获得系统/基数数据
  745. /// <summary>
  746. /// 获得数据字典
  747. /// </summary>
  748. /// <param name="accountCode">帐套code</param>
  749. /// <param name="userCode">用户code</param>
  750. /// <param name="userPassword">用户密码</param>
  751. /// <param name="sessionKey">本次登陆密钥</param>
  752. /// <param name="dicType">字典类型</param>
  753. /// <returns></returns>
  754. public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  755. {
  756. ActionResult actionResult = new ActionResult();
  757. try
  758. {
  759. // 验证请求头信息
  760. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  761. // 验证失败
  762. if (actionResult.Status != (int)Constant.PDAResult.Success)
  763. {
  764. return actionResult;
  765. }
  766. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  767. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  768. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  769. actionResult.Status = (int)Constant.PDAResult.Success;
  770. }
  771. catch (Exception ex)
  772. {
  773. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  774. OutputLog.TraceLog(LogPriority.Error,
  775. this.ToString(),
  776. System.Reflection.MethodBase.GetCurrentMethod().Name,
  777. ex.ToString(),
  778. LocalPath.LogExePath);
  779. actionResult.Status = (int)Constant.PDAResult.Exception;
  780. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  781. }
  782. return actionResult;
  783. }
  784. #endregion
  785. #region 检验工序接口
  786. /// <summary>
  787. /// 获得检验标识
  788. /// </summary>
  789. /// <param name="accountCode">帐套code</param>
  790. /// <param name="userCode">用户code</param>
  791. /// <param name="userPassword">用户密码</param>
  792. /// <param name="sessionKey">本次登陆密钥</param>
  793. /// <returns></returns>
  794. /// <remarks>
  795. /// 陈冰 2014.10.04 新建
  796. /// </remarks>
  797. public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey)
  798. {
  799. ActionResult actionResult = new ActionResult();
  800. try
  801. {
  802. // 验证请求头信息
  803. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  804. // 验证失败
  805. if (actionResult.Status != (int)Constant.PDAResult.Success)
  806. {
  807. return actionResult;
  808. }
  809. #region 构造缺陷标识的数据源
  810. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  811. #endregion
  812. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  813. actionResult.Status = (int)Constant.PDAResult.Success;
  814. }
  815. catch (Exception ex)
  816. {
  817. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  818. OutputLog.TraceLog(LogPriority.Error,
  819. this.ToString(),
  820. System.Reflection.MethodBase.GetCurrentMethod().Name,
  821. ex.ToString(),
  822. LocalPath.LogExePath);
  823. actionResult.Status = (int)Constant.PDAResult.Exception;
  824. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  825. }
  826. return actionResult;
  827. }
  828. /// <summary>
  829. /// 由条码和当前检验工序获取返工工序
  830. /// </summary>
  831. /// <param name="accountCode">帐套code</param>
  832. /// <param name="userCode">用户code</param>
  833. /// <param name="userPassword">用户密码</param>
  834. /// <param name="sessionKey">本次登陆密钥</param>
  835. /// <param name="procedureID">当前检验工序ID</param>
  836. /// <param name="barcode">条码</param>
  837. /// <returns></returns>
  838. /// <remarks>
  839. /// 陈冰 2014.10.04 新建
  840. /// </remarks>
  841. public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  842. {
  843. ActionResult actionResult = new ActionResult();
  844. try
  845. {
  846. // 验证请求头信息
  847. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  848. // 验证失败
  849. if (actionResult.Status != (int)Constant.PDAResult.Success)
  850. {
  851. return actionResult;
  852. }
  853. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  854. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  855. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  856. {
  857. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  858. actionResult.Status = (int)Constant.PDAResult.Success;
  859. }
  860. else
  861. {
  862. actionResult.Status = (int)Constant.PDAResult.Fail;
  863. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  864. }
  865. }
  866. catch (Exception ex)
  867. {
  868. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  869. OutputLog.TraceLog(LogPriority.Error,
  870. this.ToString(),
  871. System.Reflection.MethodBase.GetCurrentMethod().Name,
  872. ex.ToString(),
  873. LocalPath.LogExePath);
  874. actionResult.Status = (int)Constant.PDAResult.Exception;
  875. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  876. }
  877. return actionResult;
  878. }
  879. /// <summary>
  880. /// 由当前检验工序获取缺陷列表
  881. /// </summary>
  882. /// <param name="accountCode">帐套code</param>
  883. /// <param name="userCode">用户code</param>
  884. /// <param name="userPassword">用户密码</param>
  885. /// <param name="sessionKey">本次登陆密钥</param>
  886. /// <param name="procedureID">当前检验工序ID</param>
  887. /// <param name="defectCode">缺陷编码</param>
  888. /// <returns></returns>
  889. /// <remarks>
  890. /// 陈冰 2014.10.04 新建
  891. /// </remarks>
  892. public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  893. {
  894. ActionResult actionResult = new ActionResult();
  895. try
  896. {
  897. // 验证请求头信息
  898. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  899. // 验证失败
  900. if (actionResult.Status != (int)Constant.PDAResult.Success)
  901. {
  902. return actionResult;
  903. }
  904. object defectDs = ServiceInvoker.Invoke<object>(this,
  905. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  906. if (defectDs != null)
  907. {
  908. actionResult.Result = JsonHelper.ToJson(defectDs);
  909. actionResult.Status = (int)Constant.PDAResult.Success;
  910. }
  911. else
  912. {
  913. actionResult.Status = (int)Constant.PDAResult.Fail;
  914. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  915. }
  916. }
  917. catch (Exception ex)
  918. {
  919. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  920. OutputLog.TraceLog(LogPriority.Error,
  921. this.ToString(),
  922. System.Reflection.MethodBase.GetCurrentMethod().Name,
  923. ex.ToString(),
  924. LocalPath.LogExePath);
  925. actionResult.Status = (int)Constant.PDAResult.Exception;
  926. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  927. }
  928. return actionResult;
  929. }
  930. /// <summary>
  931. /// 根据产品ID查出缺陷位置
  932. /// </summary>
  933. /// <param name="accountCode">帐套code</param>
  934. /// <param name="userCode">用户code</param>
  935. /// <param name="userPassword">用户密码</param>
  936. /// <param name="sessionKey">本次登陆密钥</param>
  937. /// <param name="goodsID">产品ID</param>
  938. /// <param name="positionCode">位置编码</param>
  939. /// <returns></returns>
  940. /// <remarks>
  941. /// 陈冰 2014.10.04 新建
  942. /// </remarks>
  943. public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  944. {
  945. ActionResult actionResult = new ActionResult();
  946. try
  947. {
  948. // 验证请求头信息
  949. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  950. // 验证失败
  951. if (actionResult.Status != (int)Constant.PDAResult.Success)
  952. {
  953. return actionResult;
  954. }
  955. // 缺陷位置已经不用在关联产品
  956. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  957. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  958. if (defectDs != null)
  959. {
  960. actionResult.Result = JsonHelper.ToJson(defectDs);
  961. actionResult.Status = (int)Constant.PDAResult.Success;
  962. }
  963. else
  964. {
  965. actionResult.Status = (int)Constant.PDAResult.Fail;
  966. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  967. }
  968. }
  969. catch (Exception ex)
  970. {
  971. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  972. OutputLog.TraceLog(LogPriority.Error,
  973. this.ToString(),
  974. System.Reflection.MethodBase.GetCurrentMethod().Name,
  975. ex.ToString(),
  976. LocalPath.LogExePath);
  977. actionResult.Status = (int)Constant.PDAResult.Exception;
  978. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  979. }
  980. return actionResult;
  981. }
  982. /// <summary>
  983. /// 通过条码和缺陷查出责任工序
  984. /// </summary>
  985. /// <param name="accountCode">帐套code</param>
  986. /// <param name="userCode">用户code</param>
  987. /// <param name="userPassword">用户密码</param>
  988. /// <param name="sessionKey">本次登陆密钥</param>
  989. /// <param name="barcode">条码</param>
  990. /// <param name="defectid">缺陷ID</param>
  991. /// <returns></returns>
  992. /// <remarks>
  993. /// 陈冰 2014.10.04 新建
  994. /// </remarks>
  995. public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  996. {
  997. ActionResult actionResult = new ActionResult();
  998. try
  999. {
  1000. // 验证请求头信息
  1001. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1002. // 验证失败
  1003. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1004. {
  1005. return actionResult;
  1006. }
  1007. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1008. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  1009. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1010. {
  1011. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  1012. actionResult.Status = (int)Constant.PDAResult.Success;
  1013. }
  1014. else
  1015. {
  1016. actionResult.Status = (int)Constant.PDAResult.Fail;
  1017. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1018. }
  1019. }
  1020. catch (Exception ex)
  1021. {
  1022. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1023. OutputLog.TraceLog(LogPriority.Error,
  1024. this.ToString(),
  1025. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1026. ex.ToString(),
  1027. LocalPath.LogExePath);
  1028. actionResult.Status = (int)Constant.PDAResult.Exception;
  1029. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1030. }
  1031. return actionResult;
  1032. }
  1033. /// <summary>
  1034. /// 通过条码与工序查出责任工号(己废)
  1035. /// </summary>
  1036. /// <param name="accountCode">帐套code</param>
  1037. /// <param name="userCode">用户code</param>
  1038. /// <param name="userPassword">用户密码</param>
  1039. /// <param name="sessionKey">本次登陆密钥</param>
  1040. /// <param name="barcode">条码</param>
  1041. /// <param name="dutyProcedureID">责任工序</param>
  1042. /// <returns></returns>
  1043. /// <remarks>
  1044. /// 陈冰 2014.10.04 新建
  1045. /// </remarks>
  1046. public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  1047. {
  1048. ActionResult actionResult = new ActionResult();
  1049. try
  1050. {
  1051. // 验证请求头信息
  1052. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1053. // 验证失败
  1054. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1055. {
  1056. return actionResult;
  1057. }
  1058. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1059. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  1060. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1061. {
  1062. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1063. actionResult.Status = (int)Constant.PDAResult.Success;
  1064. }
  1065. else
  1066. {
  1067. actionResult.Status = (int)Constant.PDAResult.Fail;
  1068. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1069. }
  1070. }
  1071. catch (Exception ex)
  1072. {
  1073. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1074. OutputLog.TraceLog(LogPriority.Error,
  1075. this.ToString(),
  1076. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1077. ex.ToString(),
  1078. LocalPath.LogExePath);
  1079. actionResult.Status = (int)Constant.PDAResult.Exception;
  1080. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1081. }
  1082. return actionResult;
  1083. }
  1084. /// <summary>
  1085. /// 通过条码与工序查出责任工号
  1086. /// </summary>
  1087. /// <param name="accountCode"></param>
  1088. /// <param name="userCode"></param>
  1089. /// <param name="userPassword"></param>
  1090. /// <param name="sessionKey"></param>
  1091. /// <param name="ProductionDataID">生产数据ID</param>
  1092. /// <returns></returns>
  1093. public ActionResult GetDutyProcedureCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1094. {
  1095. ActionResult actionResult = new ActionResult();
  1096. try
  1097. {
  1098. // 验证请求头信息
  1099. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1100. // 验证失败
  1101. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1102. {
  1103. return actionResult;
  1104. }
  1105. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1106. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1107. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1108. {
  1109. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1110. actionResult.Status = (int)Constant.PDAResult.Success;
  1111. }
  1112. else
  1113. {
  1114. actionResult.Status = (int)Constant.PDAResult.Fail;
  1115. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1116. }
  1117. }
  1118. catch (Exception ex)
  1119. {
  1120. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1121. OutputLog.TraceLog(LogPriority.Error,
  1122. this.ToString(),
  1123. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1124. ex.ToString(),
  1125. LocalPath.LogExePath);
  1126. actionResult.Status = (int)Constant.PDAResult.Exception;
  1127. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1128. }
  1129. return actionResult;
  1130. }
  1131. /// <summary>
  1132. /// 通过生产数据与工号ID查询工种
  1133. /// </summary>
  1134. /// <param name="accountCode">帐套code</param>
  1135. /// <param name="userCode">用户code</param>
  1136. /// <param name="userPassword">用户密码</param>
  1137. /// <param name="sessionKey">本次登陆密钥</param>
  1138. /// <param name="productionDataID">生产数据ID</param>
  1139. /// <param name="userID">工号ID</param>
  1140. /// <returns></returns>
  1141. /// <remarks>
  1142. /// 陈冰 2014.10.08 新建
  1143. /// </remarks>
  1144. public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey,
  1145. //int productionDataID, int userID)
  1146. int classesSettingID, int defectid, int procedureID)
  1147. {
  1148. ActionResult actionResult = new ActionResult();
  1149. try
  1150. {
  1151. // 验证请求头信息
  1152. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1153. // 验证失败
  1154. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1155. {
  1156. return actionResult;
  1157. }
  1158. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1159. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1160. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  1161. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1162. {
  1163. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1164. actionResult.Status = (int)Constant.PDAResult.Success;
  1165. }
  1166. else
  1167. {
  1168. actionResult.Status = (int)Constant.PDAResult.Fail;
  1169. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1170. }
  1171. }
  1172. catch (Exception ex)
  1173. {
  1174. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1175. OutputLog.TraceLog(LogPriority.Error,
  1176. this.ToString(),
  1177. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1178. ex.ToString(),
  1179. LocalPath.LogExePath);
  1180. actionResult.Status = (int)Constant.PDAResult.Exception;
  1181. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1182. }
  1183. return actionResult;
  1184. }
  1185. /// <summary>
  1186. /// 根据生产数据ID,用户ID及工种选出责任员工
  1187. /// </summary>
  1188. /// <param name="accountCode">帐套code</param>
  1189. /// <param name="userCode">用户code</param>
  1190. /// <param name="userPassword">用户密码</param>
  1191. /// <param name="sessionKey">本次登陆密钥</param>
  1192. /// <param name="productionDataID">生产数据ID</param>
  1193. /// <param name="userID">工号ID</param>
  1194. /// <param name="jobsID">工种ID</param>
  1195. /// <returns></returns>
  1196. /// <remarks>
  1197. /// 陈冰 2014.10.08 新建
  1198. /// </remarks>
  1199. public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey,
  1200. //int productionDataID, int userID, int jobsID)
  1201. int classesSettingID, int jobsID)
  1202. {
  1203. ActionResult actionResult = new ActionResult();
  1204. try
  1205. {
  1206. // 验证请求头信息
  1207. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1208. // 验证失败
  1209. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1210. {
  1211. return actionResult;
  1212. }
  1213. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1214. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1215. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1216. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1217. {
  1218. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1219. actionResult.Status = (int)Constant.PDAResult.Success;
  1220. }
  1221. else
  1222. {
  1223. actionResult.Status = (int)Constant.PDAResult.Fail;
  1224. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1225. }
  1226. }
  1227. catch (Exception ex)
  1228. {
  1229. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1230. OutputLog.TraceLog(LogPriority.Error,
  1231. this.ToString(),
  1232. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1233. ex.ToString(),
  1234. LocalPath.LogExePath);
  1235. actionResult.Status = (int)Constant.PDAResult.Exception;
  1236. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1237. }
  1238. return actionResult;
  1239. }
  1240. /// <summary>
  1241. /// 获得产品分级
  1242. /// </summary>
  1243. /// <param name="accountCode">帐套code</param>
  1244. /// <param name="userCode">用户code</param>
  1245. /// <param name="userPassword">用户密码</param>
  1246. /// <param name="sessionKey">本次登陆密钥</param>
  1247. /// <returns></returns>
  1248. /// <remarks>
  1249. /// 陈冰 2014.10.08 新建
  1250. /// xuwei 2019-12-4 添加参数type 默认为2成检 为1时 半检
  1251. /// </remarks>
  1252. public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey, int type = 2)
  1253. {
  1254. ActionResult actionResult = new ActionResult();
  1255. try
  1256. {
  1257. // 验证请求头信息
  1258. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1259. // 验证失败
  1260. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1261. {
  1262. return actionResult;
  1263. }
  1264. #region 构造产品分级的数据源
  1265. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1266. //xuwei modify 2019-12-04 支持半检 没传参数 type=0
  1267. //DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2 , sUserInfo);
  1268. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(type == 0 ? 2 : type, sUserInfo);
  1269. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1270. {
  1271. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1272. actionResult.Status = (int)Constant.PDAResult.Success;
  1273. }
  1274. else
  1275. {
  1276. actionResult.Status = (int)Constant.PDAResult.Fail;
  1277. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1278. }
  1279. #endregion
  1280. }
  1281. catch (Exception ex)
  1282. {
  1283. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1284. OutputLog.TraceLog(LogPriority.Error,
  1285. this.ToString(),
  1286. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1287. ex.ToString(),
  1288. LocalPath.LogExePath);
  1289. OutputLog.TraceLog(LogPriority.Error,
  1290. this.ToString(),
  1291. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1292. ex.ToString(),
  1293. LocalPath.LogExePath);
  1294. actionResult.Status = (int)Constant.PDAResult.Exception;
  1295. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1296. }
  1297. return actionResult;
  1298. }
  1299. #endregion
  1300. #region 保存检验条码
  1301. /// <summary>
  1302. /// 保存检验条码
  1303. /// </summary>
  1304. /// <param name="accountCode">帐套code</param>
  1305. /// <param name="userCode">用户code</param>
  1306. /// <param name="userPassword">用户密码</param>
  1307. /// <param name="sessionKey">本次登陆密钥</param>
  1308. /// <param name="procedureID">工序ID</param>
  1309. /// <param name="productionDataEntitys">条码信息</param>
  1310. /// <returns></returns>
  1311. public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1312. {
  1313. ActionResult actionResult = new ActionResult();
  1314. if (productionDataEntitys == null || productionDataEntitys.Length == 0 ||
  1315. string.IsNullOrWhiteSpace(productionDataEntitys[0].Barcode))
  1316. {
  1317. actionResult.Status = (int)Constant.PDAResult.Fail;
  1318. actionResult.Message = "无效条码";
  1319. return actionResult;
  1320. }
  1321. try
  1322. {
  1323. // 验证请求头信息
  1324. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1325. // 验证失败
  1326. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1327. {
  1328. return actionResult;
  1329. }
  1330. //if(productionDataEntitys.Length>0)
  1331. //{
  1332. // if(productionDataEntitys[0].ProductionDataID>0)
  1333. // {
  1334. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1335. // }
  1336. //}
  1337. string err = ServiceInvoker.Invoke<string>(this,
  1338. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1339. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1340. if (err == null)
  1341. {
  1342. err = "";
  1343. }
  1344. if (err == "DataDouble")
  1345. {
  1346. actionResult.Result = string.Format(Messages.MSG_HR_W006, "成检", "保存");
  1347. actionResult.Status = 2;
  1348. return actionResult;
  1349. }
  1350. else if (!string.IsNullOrEmpty(err))
  1351. {
  1352. actionResult.Result = err;
  1353. actionResult.Message = err;
  1354. actionResult.Status = 666;
  1355. return actionResult;
  1356. }
  1357. //actionResult.Result = JsonHelper.ToJson(err);
  1358. actionResult.Result = err;// JsonHelper.ToJson(err);
  1359. actionResult.Status = (int)Constant.PDAResult.Success;
  1360. }
  1361. catch (Exception ex)
  1362. {
  1363. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1364. OutputLog.TraceLog(LogPriority.Error,
  1365. this.ToString(),
  1366. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1367. ex.ToString(),
  1368. LocalPath.LogExePath);
  1369. actionResult.Status = (int)Constant.PDAResult.Exception;
  1370. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1371. }
  1372. return actionResult;
  1373. }
  1374. /// <summary>
  1375. /// 保存检验条码
  1376. /// </summary>
  1377. /// <param name="accountCode">帐套code</param>
  1378. /// <param name="userCode">用户code</param>
  1379. /// <param name="userPassword">用户密码</param>
  1380. /// <param name="sessionKey">本次登陆密钥</param>
  1381. /// <param name="procedureID">工序ID</param>
  1382. /// <param name="productionDataEntitys">条码信息</param>
  1383. /// <returns></returns>
  1384. public ActionResult AddBarcodeIdnrkScrap(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1385. {
  1386. ActionResult actionResult = new ActionResult();
  1387. if (productionDataEntitys == null || productionDataEntitys.Length == 0 ||
  1388. string.IsNullOrWhiteSpace(productionDataEntitys[0].Barcode))
  1389. {
  1390. actionResult.Status = (int)Constant.PDAResult.Fail;
  1391. actionResult.Message = "无效条码";
  1392. return actionResult;
  1393. }
  1394. try
  1395. {
  1396. // 验证请求头信息
  1397. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1398. // 验证失败
  1399. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1400. {
  1401. return actionResult;
  1402. }
  1403. string err = ServiceInvoker.Invoke<string>(this,
  1404. () => PMModuleLogicDAL.AddBarcodeIdnrkScrapPDA(procedureID, productionDataEntitys, sUserInfo));
  1405. if (err == null)
  1406. {
  1407. err = "";
  1408. }
  1409. actionResult.Result = err;
  1410. actionResult.Status = (int)Constant.PDAResult.Success;
  1411. }
  1412. catch (Exception ex)
  1413. {
  1414. OutputLog.TraceLog(LogPriority.Error,
  1415. this.ToString(),
  1416. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1417. ex.ToString(),
  1418. LocalPath.LogExePath);
  1419. actionResult.Status = (int)Constant.PDAResult.Exception;
  1420. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1421. }
  1422. return actionResult;
  1423. }
  1424. #endregion
  1425. #region 文件上传下载
  1426. /// <summary>
  1427. /// 软件更新
  1428. /// </summary>
  1429. /// <param name="accountCode">帐套code</param>
  1430. /// <param name="userCode">用户code</param>
  1431. /// <param name="userPassword">用户密码</param>
  1432. /// <param name="sessionKey">本次登陆密钥</param>
  1433. /// <returns></returns>
  1434. public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey)
  1435. {
  1436. try
  1437. {
  1438. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1439. }
  1440. catch (Exception ex)
  1441. {
  1442. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1443. OutputLog.TraceLog(LogPriority.Error,
  1444. this.ToString(),
  1445. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1446. ex.ToString(),
  1447. LocalPath.LogExePath);
  1448. return null;
  1449. }
  1450. }
  1451. /// <summary>
  1452. /// 上传临时文件
  1453. /// </summary>
  1454. /// <param name="imgStream"></param>
  1455. /// <returns></returns>
  1456. public ActionResult SaveImg(Stream mageStream)
  1457. {
  1458. ActionResult actionResult = new ActionResult();
  1459. try
  1460. {
  1461. string err = PDAModuleLogic.SaveImg(mageStream);
  1462. if (err == null)
  1463. {
  1464. err = "";
  1465. }
  1466. actionResult.Result = err;
  1467. actionResult.Status = (int)Constant.PDAResult.Success;
  1468. }
  1469. catch (Exception ex)
  1470. {
  1471. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1472. OutputLog.TraceLog(LogPriority.Error,
  1473. this.ToString(),
  1474. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1475. ex.ToString(),
  1476. LocalPath.LogExePath);
  1477. actionResult.Status = (int)Constant.PDAResult.Exception;
  1478. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1479. }
  1480. return actionResult;
  1481. }
  1482. public Stream GetFileTest(string path)
  1483. {
  1484. return PDAModuleLogic.GetImg(path);
  1485. }
  1486. public Stream GetFileStream()
  1487. {
  1488. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1489. long l = fs.Length;
  1490. return fs;
  1491. }
  1492. public byte[] GetFileTestByte(string path)
  1493. {
  1494. FileStream stream = new FileInfo(path).OpenRead();
  1495. Byte[] buffer = new Byte[stream.Length];
  1496. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1497. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1498. return buffer;
  1499. }
  1500. public string GetFile(string path)
  1501. {
  1502. string imgFilePath = path;
  1503. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1504. int i = (int)fs.Length;
  1505. byte[] content = new byte[i];
  1506. fs.Read(content, 0, i);
  1507. string result = Convert.ToBase64String(content);
  1508. fs.Close();
  1509. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1510. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1511. sw.Write(result);
  1512. sw.Close();
  1513. fsTxt.Close();
  1514. return result;
  1515. }
  1516. #endregion
  1517. /// <summary>
  1518. /// 获得产品分级
  1519. /// </summary>
  1520. /// <param name="accountCode">帐套code</param>
  1521. /// <param name="userCode">用户code</param>
  1522. /// <param name="userPassword">用户密码</param>
  1523. /// <param name="sessionKey">本次登陆密钥</param>
  1524. /// <param name="procedureID">当前工序ID</param>
  1525. /// <returns></returns>
  1526. /// <remarks>
  1527. /// 陈冰 2014.10.22 新建
  1528. /// </remarks>
  1529. public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1530. {
  1531. ActionResult actionResult = new ActionResult();
  1532. try
  1533. {
  1534. // 验证请求头信息
  1535. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1536. // 验证失败
  1537. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1538. {
  1539. return actionResult;
  1540. }
  1541. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1542. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1543. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1544. {
  1545. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1546. actionResult.Status = (int)Constant.PDAResult.Success;
  1547. }
  1548. else
  1549. {
  1550. actionResult.Status = (int)Constant.PDAResult.Fail;
  1551. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1552. }
  1553. }
  1554. catch (Exception ex)
  1555. {
  1556. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1557. OutputLog.TraceLog(LogPriority.Error,
  1558. this.ToString(),
  1559. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1560. ex.ToString(),
  1561. LocalPath.LogExePath);
  1562. actionResult.Status = (int)Constant.PDAResult.Exception;
  1563. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1564. }
  1565. return actionResult;
  1566. }
  1567. /// <summary>
  1568. /// 获得产品分级
  1569. /// </summary>
  1570. /// <param name="accountCode">帐套code</param>
  1571. /// <param name="userCode">用户code</param>
  1572. /// <param name="userPassword">用户密码</param>
  1573. /// <param name="sessionKey">本次登陆密钥</param>
  1574. /// <param name="barcode">条码</param>
  1575. /// <returns></returns>
  1576. public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1577. {
  1578. ActionResult actionResult = new ActionResult();
  1579. try
  1580. {
  1581. // 验证请求头信息
  1582. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1583. // 验证失败
  1584. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1585. {
  1586. return actionResult;
  1587. }
  1588. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1589. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1590. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1591. {
  1592. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1593. actionResult.Status = (int)Constant.PDAResult.Success;
  1594. }
  1595. else
  1596. {
  1597. actionResult.Status = (int)Constant.PDAResult.Fail;
  1598. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1599. }
  1600. }
  1601. catch (Exception ex)
  1602. {
  1603. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1604. OutputLog.TraceLog(LogPriority.Error,
  1605. this.ToString(),
  1606. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1607. ex.ToString(),
  1608. LocalPath.LogExePath);
  1609. actionResult.Status = (int)Constant.PDAResult.Exception;
  1610. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1611. }
  1612. return actionResult;
  1613. }
  1614. #region 统计
  1615. /// <summary>
  1616. /// 统计当日计数数量
  1617. /// </summary>
  1618. /// <param name="accountCode">帐套code</param>
  1619. /// <param name="userCode">用户code</param>
  1620. /// <param name="userPassword">用户密码</param>
  1621. /// <param name="sessionKey">本次登陆密钥</param>
  1622. /// <param name="procedureID">工序ID</param>
  1623. /// <returns></returns>
  1624. public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1625. {
  1626. ActionResult actionResult = new ActionResult();
  1627. try
  1628. {
  1629. // 验证请求头信息
  1630. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1631. // 验证失败
  1632. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1633. {
  1634. return actionResult;
  1635. }
  1636. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1637. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1638. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1639. {
  1640. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1641. actionResult.Status = (int)Constant.PDAResult.Success;
  1642. }
  1643. else
  1644. {
  1645. actionResult.Status = (int)Constant.PDAResult.Fail;
  1646. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1647. }
  1648. }
  1649. catch (Exception ex)
  1650. {
  1651. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1652. OutputLog.TraceLog(LogPriority.Error,
  1653. this.ToString(),
  1654. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1655. ex.ToString(),
  1656. LocalPath.LogExePath);
  1657. actionResult.Status = (int)Constant.PDAResult.Exception;
  1658. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1659. }
  1660. return actionResult;
  1661. }
  1662. /// <summary>
  1663. /// 统计当日计数数量
  1664. /// </summary>
  1665. /// <param name="accountCode">帐套code</param>
  1666. /// <param name="userCode">用户code</param>
  1667. /// <param name="userPassword">用户密码</param>
  1668. /// <param name="sessionKey">本次登陆密钥</param>
  1669. /// <param name="procedureID">工序ID</param>
  1670. /// <returns></returns>
  1671. public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1672. {
  1673. ActionResult actionResult = new ActionResult();
  1674. try
  1675. {
  1676. // 验证请求头信息
  1677. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1678. // 验证失败
  1679. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1680. {
  1681. return actionResult;
  1682. }
  1683. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1684. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1685. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1686. {
  1687. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1688. actionResult.Status = (int)Constant.PDAResult.Success;
  1689. }
  1690. else
  1691. {
  1692. actionResult.Status = (int)Constant.PDAResult.Fail;
  1693. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1694. }
  1695. }
  1696. catch (Exception ex)
  1697. {
  1698. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1699. OutputLog.TraceLog(LogPriority.Error,
  1700. this.ToString(),
  1701. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1702. ex.ToString(),
  1703. LocalPath.LogExePath);
  1704. actionResult.Status = (int)Constant.PDAResult.Exception;
  1705. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1706. }
  1707. return actionResult;
  1708. }
  1709. /// <summary>
  1710. /// 统计产品跟踪
  1711. /// </summary>
  1712. /// <param name="accountCode">帐套code</param>
  1713. /// <param name="userCode">用户code</param>
  1714. /// <param name="userPassword">用户密码</param>
  1715. /// <param name="sessionKey">本次登陆密钥</param>
  1716. /// <param name="procedureID">工序ID</param>
  1717. /// <returns></returns>
  1718. public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1719. {
  1720. ActionResult actionResult = new ActionResult();
  1721. try
  1722. {
  1723. // 验证请求头信息
  1724. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1725. // 验证失败
  1726. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1727. {
  1728. return actionResult;
  1729. }
  1730. RPT020101_SE se = new RPT020101_SE();
  1731. se.Barcode = barcode;
  1732. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1733. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1734. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1735. {
  1736. actionResult.Status = (int)Constant.PDAResult.Fail;
  1737. actionResult.Message = Messages.MSG_CMN_I002;
  1738. }
  1739. else
  1740. {
  1741. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1742. actionResult.Status = (int)Constant.PDAResult.Success;
  1743. }
  1744. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1745. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1746. //if (productionDataEntity != null)
  1747. //{
  1748. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1749. // actionResult.Status = (int)Constant.PDAResult.Success;
  1750. //}
  1751. //else
  1752. //{
  1753. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1754. // actionResult.Message = Messages.MSG_CMN_I002;
  1755. //}
  1756. }
  1757. catch (Exception ex)
  1758. {
  1759. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1760. OutputLog.TraceLog(LogPriority.Error,
  1761. this.ToString(),
  1762. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1763. ex.ToString() + ex.HelpLink,
  1764. LocalPath.LogExePath);
  1765. actionResult.Status = (int)Constant.PDAResult.Exception;
  1766. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1767. }
  1768. return actionResult;
  1769. }
  1770. #endregion
  1771. #region 撤销装车及成检
  1772. /// <summary>
  1773. /// 检验条码是否可以撤销装车
  1774. /// </summary>
  1775. /// <param name="accountCode">帐套code</param>
  1776. /// <param name="userCode">用户code</param>
  1777. /// <param name="userPassword">用户密码</param>
  1778. /// <param name="sessionKey">本次登陆密钥</param>
  1779. /// <param name="procedureID">当前工序ID</param>
  1780. /// <param name="barcode">条码</param>
  1781. /// <returns></returns>
  1782. public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1783. {
  1784. ActionResult actionResult = new ActionResult();
  1785. try
  1786. {
  1787. // 验证请求头信息
  1788. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1789. // 验证失败
  1790. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1791. {
  1792. return actionResult;
  1793. }
  1794. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1795. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1796. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1797. actionResult.Status = (int)Constant.PDAResult.Success;
  1798. }
  1799. catch (Exception ex)
  1800. {
  1801. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1802. OutputLog.TraceLog(LogPriority.Error,
  1803. this.ToString(),
  1804. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1805. ex.ToString(),
  1806. LocalPath.LogExePath);
  1807. actionResult.Status = (int)Constant.PDAResult.Exception;
  1808. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1809. }
  1810. return actionResult;
  1811. }
  1812. /// <summary>
  1813. /// 保存撤销装车的条码
  1814. /// </summary>
  1815. /// <param name="accountCode">帐套code</param>
  1816. /// <param name="userCode">用户code</param>
  1817. /// <param name="userPassword">用户密码</param>
  1818. /// <param name="sessionKey">本次登陆密钥</param>
  1819. /// <param name="procedureID">当前工序ID</param>
  1820. /// <param name="barcode">条码</param>
  1821. /// <returns></returns>
  1822. public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1823. {
  1824. ActionResult actionResult = new ActionResult();
  1825. try
  1826. {
  1827. // 验证请求头信息
  1828. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1829. // 验证失败
  1830. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1831. {
  1832. return actionResult;
  1833. }
  1834. string err = ServiceInvoker.Invoke<string>(this,
  1835. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1836. if (err == null)
  1837. {
  1838. err = "";
  1839. }
  1840. actionResult.Result = JsonHelper.ToJson(err);
  1841. actionResult.Status = (int)Constant.PDAResult.Success;
  1842. }
  1843. catch (Exception ex)
  1844. {
  1845. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1846. OutputLog.TraceLog(LogPriority.Error,
  1847. this.ToString(),
  1848. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1849. ex.ToString(),
  1850. LocalPath.LogExePath);
  1851. actionResult.Status = (int)Constant.PDAResult.Exception;
  1852. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1853. }
  1854. return actionResult;
  1855. }
  1856. /// <summary>
  1857. /// 由产品条码获取注浆信息
  1858. /// </summary>
  1859. /// <param name="barcode"></param>
  1860. /// <returns></returns>
  1861. public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1862. {
  1863. ActionResult actionResult = new ActionResult();
  1864. try
  1865. {
  1866. // 验证请求头信息
  1867. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1868. // 验证失败
  1869. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1870. {
  1871. return actionResult;
  1872. }
  1873. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1874. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1875. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1876. {
  1877. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1878. actionResult.Status = (int)Constant.PDAResult.Success;
  1879. }
  1880. else
  1881. {
  1882. actionResult.Status = (int)Constant.PDAResult.Fail;
  1883. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1884. }
  1885. }
  1886. catch (Exception ex)
  1887. {
  1888. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1889. OutputLog.TraceLog(LogPriority.Error,
  1890. this.ToString(),
  1891. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1892. ex.ToString(),
  1893. LocalPath.LogExePath);
  1894. actionResult.Status = (int)Constant.PDAResult.Exception;
  1895. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1896. }
  1897. return actionResult;
  1898. }
  1899. /// <summary>
  1900. /// 获取工号下的所有工种信息
  1901. /// </summary>
  1902. /// <param name="UserID">工号ID</param>
  1903. /// <returns></returns>
  1904. public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1905. {
  1906. ActionResult actionResult = new ActionResult();
  1907. try
  1908. {
  1909. // 验证请求头信息
  1910. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1911. // 验证失败
  1912. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1913. {
  1914. return actionResult;
  1915. }
  1916. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1917. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1918. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1919. {
  1920. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1921. actionResult.Status = (int)Constant.PDAResult.Success;
  1922. }
  1923. else
  1924. {
  1925. actionResult.Status = (int)Constant.PDAResult.Fail;
  1926. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1927. }
  1928. }
  1929. catch (Exception ex)
  1930. {
  1931. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1932. OutputLog.TraceLog(LogPriority.Error,
  1933. this.ToString(),
  1934. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1935. ex.ToString(),
  1936. LocalPath.LogExePath);
  1937. actionResult.Status = (int)Constant.PDAResult.Exception;
  1938. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1939. }
  1940. return actionResult;
  1941. }
  1942. /// <summary>
  1943. /// 根据所选工号对应的工种,查出缺陷责任员工
  1944. /// </summary>
  1945. /// <param name="jobs">工种ID</param>
  1946. /// <returns></returns>
  1947. public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  1948. {
  1949. ActionResult actionResult = new ActionResult();
  1950. try
  1951. {
  1952. // 验证请求头信息
  1953. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1954. // 验证失败
  1955. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1956. {
  1957. return actionResult;
  1958. }
  1959. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1960. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  1961. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1962. {
  1963. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1964. actionResult.Status = (int)Constant.PDAResult.Success;
  1965. }
  1966. else
  1967. {
  1968. actionResult.Status = (int)Constant.PDAResult.Fail;
  1969. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1970. }
  1971. }
  1972. catch (Exception ex)
  1973. {
  1974. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1975. OutputLog.TraceLog(LogPriority.Error,
  1976. this.ToString(),
  1977. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1978. ex.ToString(),
  1979. LocalPath.LogExePath);
  1980. actionResult.Status = (int)Constant.PDAResult.Exception;
  1981. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1982. }
  1983. return actionResult;
  1984. }
  1985. /// <summary>
  1986. /// 根据所选工号,查出漏检责任员工
  1987. /// </summary>
  1988. /// <param name="userid">工号</param>
  1989. /// <returns></returns>
  1990. public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  1991. {
  1992. ActionResult actionResult = new ActionResult();
  1993. try
  1994. {
  1995. // 验证请求头信息
  1996. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1997. // 验证失败
  1998. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1999. {
  2000. return actionResult;
  2001. }
  2002. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2003. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  2004. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2005. {
  2006. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2007. actionResult.Status = (int)Constant.PDAResult.Success;
  2008. }
  2009. else
  2010. {
  2011. actionResult.Status = (int)Constant.PDAResult.Fail;
  2012. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2013. }
  2014. }
  2015. catch (Exception ex)
  2016. {
  2017. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2018. OutputLog.TraceLog(LogPriority.Error,
  2019. this.ToString(),
  2020. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2021. ex.ToString(),
  2022. LocalPath.LogExePath);
  2023. actionResult.Status = (int)Constant.PDAResult.Exception;
  2024. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2025. }
  2026. return actionResult;
  2027. }
  2028. /// <summary>
  2029. /// 获取用户列表
  2030. /// </summary>
  2031. /// <param name="requestEntity">用户实体</param>
  2032. /// <returns></returns>
  2033. public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  2034. {
  2035. ActionResult actionResult = new ActionResult();
  2036. try
  2037. {
  2038. // 验证请求头信息
  2039. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2040. // 验证失败
  2041. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2042. {
  2043. return actionResult;
  2044. }
  2045. SUserEntity requestEntity = new SUserEntity();
  2046. requestEntity.IsWorker = IsWorker;
  2047. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2048. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  2049. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2050. {
  2051. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2052. actionResult.Status = (int)Constant.PDAResult.Success;
  2053. }
  2054. else
  2055. {
  2056. actionResult.Status = (int)Constant.PDAResult.Fail;
  2057. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2058. }
  2059. }
  2060. catch (Exception ex)
  2061. {
  2062. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2063. OutputLog.TraceLog(LogPriority.Error,
  2064. this.ToString(),
  2065. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2066. ex.ToString(),
  2067. LocalPath.LogExePath);
  2068. actionResult.Status = (int)Constant.PDAResult.Exception;
  2069. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2070. }
  2071. return actionResult;
  2072. }
  2073. /// <summary>
  2074. /// 获取数据字典管理的数据
  2075. /// </summary>
  2076. /// <param name="Pvalue">显示停用标识</param>
  2077. /// <param name="dictionaryType">字典类别</param>
  2078. /// <returns></returns>
  2079. /// <remarks>
  2080. /// 2014.12.03 新建
  2081. /// </remarks>
  2082. public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  2083. {
  2084. ActionResult actionResult = new ActionResult();
  2085. try
  2086. {
  2087. // 验证请求头信息
  2088. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2089. // 验证失败
  2090. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2091. {
  2092. return actionResult;
  2093. }
  2094. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2095. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  2096. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2097. {
  2098. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2099. actionResult.Status = (int)Constant.PDAResult.Success;
  2100. }
  2101. else
  2102. {
  2103. actionResult.Status = (int)Constant.PDAResult.Fail;
  2104. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2105. }
  2106. }
  2107. catch (Exception ex)
  2108. {
  2109. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2110. OutputLog.TraceLog(LogPriority.Error,
  2111. this.ToString(),
  2112. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2113. ex.ToString(),
  2114. LocalPath.LogExePath);
  2115. actionResult.Status = (int)Constant.PDAResult.Exception;
  2116. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2117. }
  2118. return actionResult;
  2119. }
  2120. #endregion
  2121. #region 保存半检数据
  2122. /// <summary>
  2123. /// 保存半检数据
  2124. /// </summary>
  2125. /// <param name="accountCode">帐套code</param>
  2126. /// <param name="userCode">用户code</param>
  2127. /// <param name="userPassword">用户密码</param>
  2128. /// <param name="sessionKey">本次登陆密钥</param>
  2129. /// <param name="productionDataEntitys">半检信息</param>
  2130. /// <returns></returns>
  2131. public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  2132. {
  2133. ActionResult actionResult = new ActionResult();
  2134. try
  2135. {
  2136. // 验证请求头信息
  2137. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2138. // 验证失败
  2139. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2140. {
  2141. return actionResult;
  2142. }
  2143. string err = ServiceInvoker.Invoke<string>(this,
  2144. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2145. if (err == null)
  2146. {
  2147. err = "";
  2148. }
  2149. actionResult.Result = JsonHelper.ToJson(err);
  2150. actionResult.Status = (int)Constant.PDAResult.Success;
  2151. }
  2152. catch (Exception ex)
  2153. {
  2154. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2155. OutputLog.TraceLog(LogPriority.Error,
  2156. this.ToString(),
  2157. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2158. ex.ToString(),
  2159. LocalPath.LogExePath);
  2160. actionResult.Status = (int)Constant.PDAResult.Exception;
  2161. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2162. }
  2163. return actionResult;
  2164. }
  2165. #endregion
  2166. /// <summary>
  2167. /// 获取产品列表
  2168. /// </summary>
  2169. /// <returns></returns>
  2170. public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  2171. {
  2172. ActionResult actionResult = new ActionResult();
  2173. try
  2174. {
  2175. // 验证请求头信息
  2176. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2177. // 验证失败
  2178. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2179. {
  2180. return actionResult;
  2181. }
  2182. GoodsEntity goodsEntity = new GoodsEntity();
  2183. goodsEntity.ValueFlag = 1;//有效标记
  2184. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2185. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2186. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2187. {
  2188. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2189. actionResult.Status = (int)Constant.PDAResult.Success;
  2190. }
  2191. else
  2192. {
  2193. actionResult.Status = (int)Constant.PDAResult.Fail;
  2194. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2195. }
  2196. }
  2197. catch (Exception ex)
  2198. {
  2199. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2200. OutputLog.TraceLog(LogPriority.Error,
  2201. this.ToString(),
  2202. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2203. ex.ToString(),
  2204. LocalPath.LogExePath);
  2205. actionResult.Status = (int)Constant.PDAResult.Exception;
  2206. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2207. }
  2208. return actionResult;
  2209. }
  2210. /// <summary>
  2211. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2212. /// </summary>
  2213. /// <param name="searchEntity">生产数据实体类</param>
  2214. /// <returns>DataTable</returns>
  2215. public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2216. {
  2217. ActionResult actionResult = new ActionResult();
  2218. try
  2219. {
  2220. // 验证请求头信息
  2221. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2222. // 验证失败
  2223. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2224. {
  2225. return actionResult;
  2226. }
  2227. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2228. searchEntity.ProcedureID = ProcedureID;
  2229. searchEntity.BarCode = BarCode;
  2230. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2231. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2232. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2233. {
  2234. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2235. actionResult.Status = (int)Constant.PDAResult.Success;
  2236. }
  2237. else
  2238. {
  2239. actionResult.Status = (int)Constant.PDAResult.Fail;
  2240. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2241. }
  2242. }
  2243. catch (Exception ex)
  2244. {
  2245. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2246. OutputLog.TraceLog(LogPriority.Error,
  2247. this.ToString(),
  2248. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2249. ex.ToString(),
  2250. LocalPath.LogExePath);
  2251. actionResult.Status = (int)Constant.PDAResult.Exception;
  2252. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2253. }
  2254. return actionResult;
  2255. }
  2256. /// <summary>
  2257. /// xuwei add 2020-03-23 此方法用于成检后 回收 再次成检 获取正确ID
  2258. /// </summary>
  2259. /// <param name="searchEntity">生产数据实体类</param>
  2260. /// <returns>DataTable</returns>
  2261. public ActionResult GetProductionDataCheckID(string accountCode, string userCode, string userPassword, string sessionKey, string BarCode)
  2262. {
  2263. ActionResult actionResult = new ActionResult();
  2264. try
  2265. {
  2266. // 验证请求头信息
  2267. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2268. // 验证失败
  2269. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2270. {
  2271. return actionResult;
  2272. }
  2273. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2274. searchEntity.BarCode = BarCode;
  2275. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2276. () => PDAModuleLogic.GetProductionDataCheckID(searchEntity, sUserInfo));
  2277. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2278. {
  2279. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2280. actionResult.Status = (int)Constant.PDAResult.Success;
  2281. }
  2282. else
  2283. {
  2284. actionResult.Status = (int)Constant.PDAResult.Fail;
  2285. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2286. }
  2287. }
  2288. catch (Exception ex)
  2289. {
  2290. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2291. OutputLog.TraceLog(LogPriority.Error,
  2292. this.ToString(),
  2293. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2294. ex.ToString(),
  2295. LocalPath.LogExePath);
  2296. actionResult.Status = (int)Constant.PDAResult.Exception;
  2297. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2298. }
  2299. return actionResult;
  2300. }
  2301. /// <summary>
  2302. /// 根据所选生产数据ID,显示成检数据信息
  2303. /// </summary>
  2304. /// <param name="productionDataID">生产数据ID</param>
  2305. /// <returns>DataSet</returns>
  2306. public ActionResult GetProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2307. {
  2308. ActionResult actionResult = new ActionResult();
  2309. try
  2310. {
  2311. // 验证请求头信息
  2312. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2313. // 验证失败
  2314. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2315. {
  2316. return actionResult;
  2317. }
  2318. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2319. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2320. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2321. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2322. {
  2323. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2324. {
  2325. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2326. {
  2327. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2328. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2329. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2330. {
  2331. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2332. }
  2333. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2334. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2335. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2336. {
  2337. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2338. }
  2339. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2340. {
  2341. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2342. }
  2343. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2344. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2345. {
  2346. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2347. }
  2348. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2349. {
  2350. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2351. }
  2352. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2353. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2354. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2355. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2356. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2357. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2358. productionData.GlazeName = reworkDs.Tables[0].Rows[i]["GlazeName"].ToString();
  2359. productionData.LeakFlag1 = reworkDs.Tables[0].Rows[i]["LeakFlag1"].ToString();
  2360. productionData.LeakFlag2 = reworkDs.Tables[0].Rows[i]["LeakFlag2"].ToString();
  2361. productionData.LeakFlag3 = reworkDs.Tables[0].Rows[i]["LeakFlag3"].ToString();
  2362. productionData.SpecialRepairFlagName = reworkDs.Tables[0].Rows[i]["specialRepairFlagName"].ToString();
  2363. productionData.IsReFireName = reworkDs.Tables[0].Rows[i]["isReFireName"].ToString();
  2364. productionData.LeakFlag1Name = reworkDs.Tables[0].Rows[i]["LeakFlag1Name"].ToString();
  2365. productionData.LeakFlag2Name = reworkDs.Tables[0].Rows[i]["LeakFlag2Name"].ToString();
  2366. productionData.LeakFlag3Name = reworkDs.Tables[0].Rows[i]["LeakFlag3Name"].ToString();
  2367. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2368. {
  2369. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2370. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2371. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2372. }
  2373. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2374. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2375. {
  2376. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2377. }
  2378. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2379. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2380. DataTable dtDefect = dvDefect.ToTable();
  2381. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2382. {
  2383. // 产品缺陷
  2384. PDADefectResult defect = new PDADefectResult();
  2385. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2386. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2387. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2388. {
  2389. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2390. }
  2391. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2392. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2393. {
  2394. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2395. }
  2396. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2397. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2398. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2399. {
  2400. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2401. }
  2402. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2403. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2404. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2405. {
  2406. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2407. }
  2408. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2409. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2410. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2411. {
  2412. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2413. }
  2414. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2415. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2416. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2417. {
  2418. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2419. }
  2420. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2421. {
  2422. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2423. }
  2424. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2425. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2426. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2427. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2428. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2429. {
  2430. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2431. }
  2432. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2433. {
  2434. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2435. }
  2436. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2437. {
  2438. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2439. }
  2440. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2441. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2442. //--------责任员工-------------------
  2443. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2444. if (drRow.Length > Constant.INT_IS_ZERO)
  2445. {
  2446. foreach (DataRow r in drRow)
  2447. {
  2448. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2449. if (r["ProductionDefectID"].ToString() != "")
  2450. {
  2451. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2452. }
  2453. if (r["StaffID"].ToString() != "")
  2454. {
  2455. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2456. }
  2457. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2458. defectResponsible.StaffName = r["StaffName"].ToString();
  2459. if (r["StaffStatus"].ToString() != "")
  2460. {
  2461. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2462. }
  2463. if (r["UJobsID"].ToString() != "")
  2464. {
  2465. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2466. }
  2467. if (r["SJobsID"].ToString() != "")
  2468. {
  2469. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2470. }
  2471. defect.PDADefectResponsibles.Add(defectResponsible);
  2472. }
  2473. }
  2474. //------------------------------
  2475. //--------漏检员工-------------------
  2476. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2477. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2478. {
  2479. foreach (DataRow r in drMissedRow)
  2480. {
  2481. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2482. if (r["ProductionDefectID"].ToString() != "")
  2483. {
  2484. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2485. }
  2486. if (r["StaffID"].ToString() != "")
  2487. {
  2488. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2489. }
  2490. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2491. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2492. if (r["StaffStatus"].ToString() != "")
  2493. {
  2494. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2495. }
  2496. if (r["UJobsID"].ToString() != "")
  2497. {
  2498. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2499. }
  2500. if (r["SJobsID"].ToString() != "")
  2501. {
  2502. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2503. }
  2504. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2505. }
  2506. }
  2507. //------------------------------
  2508. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2509. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2510. {
  2511. foreach (DataRow r in drImageRow)
  2512. {
  2513. PDADefectImageResult defectImage = new PDADefectImageResult();
  2514. if (r["ProductionDefectID"].ToString() != "")
  2515. {
  2516. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2517. }
  2518. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2519. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2520. //{
  2521. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2522. //}
  2523. defect.PDADefectImageResults.Add(defectImage);
  2524. }
  2525. }
  2526. productionData.PDADefects.Add(defect);
  2527. }
  2528. if (productionDatas.PDAProductionData == null)
  2529. {
  2530. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2531. }
  2532. productionDatas.PDAProductionData.Add(productionData);
  2533. //---------------------------------------------------------------------------------
  2534. }
  2535. }
  2536. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2537. actionResult.Status = (int)Constant.PDAResult.Success;
  2538. }
  2539. else
  2540. {
  2541. actionResult.Status = (int)Constant.PDAResult.Fail;
  2542. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2543. }
  2544. }
  2545. catch (Exception ex)
  2546. {
  2547. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2548. OutputLog.TraceLog(LogPriority.Error,
  2549. this.ToString(),
  2550. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2551. ex.ToString(),
  2552. LocalPath.LogExePath);
  2553. actionResult.Status = (int)Constant.PDAResult.Exception;
  2554. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2555. }
  2556. return actionResult;
  2557. }
  2558. /// <summary>
  2559. /// 编辑后删除生产数据
  2560. /// </summary>
  2561. /// <param name="productionDataID">生产数据ID</param>
  2562. /// <returns>int</returns>
  2563. public ActionResult DeleteProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2564. {
  2565. ActionResult actionResult = new ActionResult();
  2566. try
  2567. {
  2568. // 验证请求头信息
  2569. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2570. // 验证失败
  2571. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2572. {
  2573. return actionResult;
  2574. }
  2575. int row = ServiceInvoker.Invoke<int>(this,
  2576. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2577. actionResult.Result = JsonHelper.ToJson(row);
  2578. actionResult.Status = (int)Constant.PDAResult.Success;
  2579. }
  2580. catch (Exception ex)
  2581. {
  2582. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2583. OutputLog.TraceLog(LogPriority.Error,
  2584. this.ToString(),
  2585. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2586. ex.ToString(),
  2587. LocalPath.LogExePath);
  2588. actionResult.Status = (int)Constant.PDAResult.Exception;
  2589. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2590. }
  2591. return actionResult;
  2592. }
  2593. /// <summary>
  2594. /// 获取产品完成工序的ID
  2595. /// </summary>
  2596. /// <param name="barcode">产品条码</param>
  2597. /// <returns>int</returns>
  2598. public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2599. {
  2600. ActionResult actionResult = new ActionResult();
  2601. try
  2602. {
  2603. // 验证请求头信息
  2604. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2605. // 验证失败
  2606. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2607. {
  2608. return actionResult;
  2609. }
  2610. int row = ServiceInvoker.Invoke<int>(this,
  2611. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2612. actionResult.Result = JsonHelper.ToJson(row);
  2613. actionResult.Status = (int)Constant.PDAResult.Success;
  2614. }
  2615. catch (Exception ex)
  2616. {
  2617. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2618. OutputLog.TraceLog(LogPriority.Error,
  2619. this.ToString(),
  2620. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2621. ex.ToString(),
  2622. LocalPath.LogExePath);
  2623. actionResult.Status = (int)Constant.PDAResult.Exception;
  2624. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2625. }
  2626. return actionResult;
  2627. }
  2628. /// <summary>
  2629. /// 绑定图片
  2630. /// </summary>
  2631. /// <param name="accountCode">帐套code</param>
  2632. /// <param name="userCode">用户code</param>
  2633. /// <param name="userPassword">用户密码</param>
  2634. /// <param name="sessionKey">本次登陆密钥</param>
  2635. /// <param name="imagePath">图片路径</param>
  2636. /// <returns></returns>
  2637. public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2638. {
  2639. try
  2640. {
  2641. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2642. }
  2643. catch (Exception ex)
  2644. {
  2645. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2646. OutputLog.TraceLog(LogPriority.Error,
  2647. this.ToString(),
  2648. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2649. ex.ToString(),
  2650. LocalPath.LogExePath);
  2651. return null;
  2652. }
  2653. }
  2654. /// <summary>
  2655. /// 根据所选工号对应的工种,查出缺陷责任员工
  2656. /// </summary>
  2657. /// <param name="jobs">工种ID</param>
  2658. /// <returns></returns>
  2659. public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2660. {
  2661. ActionResult actionResult = new ActionResult();
  2662. try
  2663. {
  2664. // 验证请求头信息
  2665. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2666. // 验证失败
  2667. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2668. {
  2669. return actionResult;
  2670. }
  2671. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2672. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2673. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2674. {
  2675. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2676. actionResult.Status = (int)Constant.PDAResult.Success;
  2677. }
  2678. else
  2679. {
  2680. actionResult.Status = (int)Constant.PDAResult.Fail;
  2681. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2682. }
  2683. }
  2684. catch (Exception ex)
  2685. {
  2686. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2687. OutputLog.TraceLog(LogPriority.Error,
  2688. this.ToString(),
  2689. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2690. ex.ToString(),
  2691. LocalPath.LogExePath);
  2692. actionResult.Status = (int)Constant.PDAResult.Exception;
  2693. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2694. }
  2695. return actionResult;
  2696. }
  2697. #region 产品报废
  2698. /// <summary>
  2699. /// 验证废弃产品唯一性
  2700. /// </summary>
  2701. /// <param name="barcode">产品条码</param>
  2702. /// <returns>int</returns>
  2703. public ActionResult ScrapProductChack(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2704. {
  2705. ActionResult actionResult = new ActionResult();
  2706. try
  2707. {
  2708. // 验证请求头信息
  2709. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2710. // 验证失败
  2711. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2712. {
  2713. return actionResult;
  2714. }
  2715. string row = ServiceInvoker.Invoke<string>(this,
  2716. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2717. string[] rm = row.Split(':');
  2718. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2719. if (rm.Length > 1)
  2720. {
  2721. actionResult.Message = rm[1];
  2722. }
  2723. actionResult.Status = (int)Constant.PDAResult.Success;
  2724. }
  2725. catch (Exception ex)
  2726. {
  2727. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2728. OutputLog.TraceLog(LogPriority.Error,
  2729. this.ToString(),
  2730. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2731. ex.ToString(),
  2732. LocalPath.LogExePath);
  2733. actionResult.Status = (int)Constant.PDAResult.Exception;
  2734. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2735. }
  2736. return actionResult;
  2737. }
  2738. /// <summary>
  2739. /// 根据条码获取该产品的在产信息以及生产数据
  2740. /// </summary>
  2741. /// <param name="Barcode">产品条码</param>
  2742. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2743. public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2744. {
  2745. ActionResult actionResult = new ActionResult();
  2746. try
  2747. {
  2748. // 验证请求头信息
  2749. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2750. // 验证失败
  2751. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2752. {
  2753. return actionResult;
  2754. }
  2755. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2756. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2757. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2758. {
  2759. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2760. actionResult.Status = (int)Constant.PDAResult.Success;
  2761. }
  2762. else
  2763. {
  2764. actionResult.Status = (int)Constant.PDAResult.Fail;
  2765. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2766. }
  2767. }
  2768. catch (Exception ex)
  2769. {
  2770. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2771. OutputLog.TraceLog(LogPriority.Error,
  2772. this.ToString(),
  2773. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2774. ex.ToString(),
  2775. LocalPath.LogExePath);
  2776. actionResult.Status = (int)Constant.PDAResult.Exception;
  2777. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2778. }
  2779. return actionResult;
  2780. }
  2781. /// <summary>
  2782. /// 根据工号查询员工档案信息
  2783. /// </summary>
  2784. /// <param name="accountCode"></param>
  2785. /// <param name="userCode"></param>
  2786. /// <param name="userPassword"></param>
  2787. /// <param name="sessionKey"></param>
  2788. /// <param name="userId"></param>
  2789. /// <returns></returns>
  2790. public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2791. {
  2792. ActionResult actionResult = new ActionResult();
  2793. try
  2794. {
  2795. // 验证请求头信息
  2796. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2797. // 验证失败
  2798. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2799. {
  2800. return actionResult;
  2801. }
  2802. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2803. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2804. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2805. {
  2806. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2807. actionResult.Status = (int)Constant.PDAResult.Success;
  2808. }
  2809. else
  2810. {
  2811. actionResult.Status = (int)Constant.PDAResult.Fail;
  2812. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2813. }
  2814. }
  2815. catch (Exception ex)
  2816. {
  2817. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2818. OutputLog.TraceLog(LogPriority.Error,
  2819. this.ToString(),
  2820. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2821. ex.ToString(),
  2822. LocalPath.LogExePath);
  2823. actionResult.Status = (int)Constant.PDAResult.Exception;
  2824. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2825. }
  2826. return actionResult;
  2827. }
  2828. /// <summary>
  2829. /// 添加废弃产品记录
  2830. /// </summary>
  2831. /// <param name="SProductEntity">废弃产品实体</param>
  2832. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2833. /// <param name="SResponsibleList">责任者集合</param>
  2834. /// <param name="userInfo">用户基本信息</param>
  2835. /// <returns>int结果返回值</returns>
  2836. /// <remarks>
  2837. /// 庄天威 2014.09.24 新建
  2838. /// </remarks>
  2839. public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey,
  2840. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2841. ScrapResponsibleEntity[] SResponsibleList)
  2842. {
  2843. ActionResult actionResult = new ActionResult();
  2844. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2845. {
  2846. actionResult.Status = (int)Constant.PDAResult.Fail;
  2847. actionResult.Message = "没有选择责任人";
  2848. }
  2849. try
  2850. {
  2851. // 验证请求头信息
  2852. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2853. // 验证失败
  2854. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2855. {
  2856. return actionResult;
  2857. }
  2858. int addRow = ServiceInvoker.Invoke<int>(this,
  2859. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  2860. actionResult.Result = JsonHelper.ToJson(addRow);
  2861. actionResult.Status = (int)Constant.PDAResult.Success;
  2862. }
  2863. catch (Exception ex)
  2864. {
  2865. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2866. OutputLog.TraceLog(LogPriority.Error,
  2867. this.ToString(),
  2868. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2869. ex.ToString(),
  2870. LocalPath.LogExePath);
  2871. actionResult.Status = (int)Constant.PDAResult.Exception;
  2872. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2873. // TODO 空指针异常问题检测
  2874. try
  2875. {
  2876. OutputLog.TraceLog(LogPriority.Error,
  2877. this.ToString(),
  2878. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2879. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  2880. LocalPath.LogExePath);
  2881. string json1 = JsonHelper.ToJson(SProductEntity);
  2882. OutputLog.TraceLog(LogPriority.Error,
  2883. this.ToString(),
  2884. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2885. "SProductEntity:" + json1,
  2886. LocalPath.LogExePath);
  2887. string json2 = JsonHelper.ToJson(RProcedureEntity);
  2888. OutputLog.TraceLog(LogPriority.Error,
  2889. this.ToString(),
  2890. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2891. "RProcedureEntity:" + json2,
  2892. LocalPath.LogExePath);
  2893. string json3 = JsonHelper.ToJson(SResponsibleList);
  2894. OutputLog.TraceLog(LogPriority.Error,
  2895. this.ToString(),
  2896. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2897. "SResponsibleList:" + json3,
  2898. LocalPath.LogExePath);
  2899. }
  2900. catch (Exception exc)
  2901. {
  2902. OutputLog.TraceLog(LogPriority.Error,
  2903. this.ToString(),
  2904. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2905. "参数输入异常:" + exc.Message,
  2906. LocalPath.LogExePath);
  2907. }
  2908. }
  2909. return actionResult;
  2910. }
  2911. /// <summary>
  2912. /// 获取产品分级的数据(根据ID)
  2913. /// </summary>
  2914. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  2915. /// <param name="GoodsLevelID">分类ID</param>
  2916. /// <param name="sUserInfo">用户基本信息</param>
  2917. /// <returns>DataSet</returns>
  2918. /// <remarks>
  2919. /// 2014.10.22 庄天威 新建
  2920. public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  2921. {
  2922. ActionResult actionResult = new ActionResult();
  2923. try
  2924. {
  2925. // 验证请求头信息
  2926. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2927. // 验证失败
  2928. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2929. {
  2930. return actionResult;
  2931. }
  2932. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2933. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  2934. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2935. {
  2936. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2937. actionResult.Status = (int)Constant.PDAResult.Success;
  2938. }
  2939. else
  2940. {
  2941. actionResult.Status = (int)Constant.PDAResult.Fail;
  2942. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2943. }
  2944. }
  2945. catch (Exception ex)
  2946. {
  2947. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2948. OutputLog.TraceLog(LogPriority.Error,
  2949. this.ToString(),
  2950. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2951. ex.ToString(),
  2952. LocalPath.LogExePath);
  2953. actionResult.Status = (int)Constant.PDAResult.Exception;
  2954. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2955. }
  2956. return actionResult;
  2957. }
  2958. /// <summary>
  2959. /// 获取账务日期
  2960. /// </summary>
  2961. /// <param name="accountCode"></param>
  2962. /// <param name="userCode"></param>
  2963. /// <param name="userPassword"></param>
  2964. /// <param name="sessionKey"></param>
  2965. /// <returns></returns>
  2966. public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey)
  2967. {
  2968. ActionResult actionResult = new ActionResult();
  2969. try
  2970. {
  2971. // 验证请求头信息
  2972. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2973. // 验证失败
  2974. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2975. {
  2976. return actionResult;
  2977. }
  2978. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  2979. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  2980. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2981. actionResult.Status = (int)Constant.PDAResult.Success;
  2982. }
  2983. catch (Exception ex)
  2984. {
  2985. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2986. OutputLog.TraceLog(LogPriority.Error,
  2987. this.ToString(),
  2988. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2989. ex.ToString(),
  2990. LocalPath.LogExePath);
  2991. actionResult.Status = (int)Constant.PDAResult.Exception;
  2992. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2993. }
  2994. return actionResult;
  2995. }
  2996. /// <summary>
  2997. /// 获取登陆帐户有无报损权限
  2998. /// </summary>
  2999. /// <param name="accountCode"></param>
  3000. /// <param name="userCode"></param>
  3001. /// <param name="userPassword"></param>
  3002. /// <param name="sessionKey"></param>
  3003. /// <param name="usercode">工号编码</param>
  3004. /// <returns></returns>
  3005. public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3006. {
  3007. ActionResult actionResult = new ActionResult();
  3008. try
  3009. {
  3010. // 验证请求头信息
  3011. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3012. // 验证失败
  3013. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3014. {
  3015. return actionResult;
  3016. }
  3017. int returnValue = ServiceInvoker.Invoke<int>(this,
  3018. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  3019. actionResult.Result = JsonHelper.ToJson(returnValue);
  3020. actionResult.Status = (int)Constant.PDAResult.Success;
  3021. }
  3022. catch (Exception ex)
  3023. {
  3024. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3025. OutputLog.TraceLog(LogPriority.Error,
  3026. this.ToString(),
  3027. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3028. ex.ToString(),
  3029. LocalPath.LogExePath);
  3030. actionResult.Status = (int)Constant.PDAResult.Exception;
  3031. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3032. }
  3033. return actionResult;
  3034. }
  3035. #endregion
  3036. /// <summary>
  3037. /// 获取是否存在报损未审核产品
  3038. /// </summary>
  3039. /// <param name="barcode">产品条码</param>
  3040. /// <returns>int</returns>
  3041. public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  3042. {
  3043. ActionResult actionResult = new ActionResult();
  3044. try
  3045. {
  3046. // 验证请求头信息
  3047. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3048. // 验证失败
  3049. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3050. {
  3051. return actionResult;
  3052. }
  3053. int row = ServiceInvoker.Invoke<int>(this,
  3054. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  3055. actionResult.Result = JsonHelper.ToJson(row);
  3056. actionResult.Status = (int)Constant.PDAResult.Success;
  3057. }
  3058. catch (Exception ex)
  3059. {
  3060. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3061. OutputLog.TraceLog(LogPriority.Error,
  3062. this.ToString(),
  3063. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3064. ex.ToString(),
  3065. LocalPath.LogExePath);
  3066. actionResult.Status = (int)Constant.PDAResult.Exception;
  3067. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3068. }
  3069. return actionResult;
  3070. }
  3071. /// <summary>
  3072. /// 查询报废产品信息
  3073. /// </summary>
  3074. /// <param name="accountCode"></param>
  3075. /// <param name="userCode"></param>
  3076. /// <param name="userPassword"></param>
  3077. /// <param name="sessionKey"></param>
  3078. /// <param name="barCode">产品条码</param>
  3079. /// <param name="scrapProductID">报废产品ID</param>
  3080. /// <returns></returns>
  3081. public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  3082. {
  3083. ActionResult actionResult = new ActionResult();
  3084. try
  3085. {
  3086. // 验证请求头信息
  3087. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3088. // 验证失败
  3089. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3090. {
  3091. return actionResult;
  3092. }
  3093. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  3094. selectProEntity.BarCode = barCode;
  3095. selectProEntity.ScrapProductID = scrapProductID;
  3096. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3097. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  3098. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3099. {
  3100. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3101. actionResult.Status = (int)Constant.PDAResult.Success;
  3102. }
  3103. else
  3104. {
  3105. actionResult.Status = (int)Constant.PDAResult.Fail;
  3106. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3107. }
  3108. }
  3109. catch (Exception ex)
  3110. {
  3111. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3112. OutputLog.TraceLog(LogPriority.Error,
  3113. this.ToString(),
  3114. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3115. ex.ToString(),
  3116. LocalPath.LogExePath);
  3117. actionResult.Status = (int)Constant.PDAResult.Exception;
  3118. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3119. }
  3120. return actionResult;
  3121. }
  3122. /// <summary>
  3123. /// 根据废弃产品ID获取责任工序
  3124. /// </summary>
  3125. /// <param name="accountCode"></param>
  3126. /// <param name="userCode"></param>
  3127. /// <param name="userPassword"></param>
  3128. /// <param name="sessionKey"></param>
  3129. /// <param name="scrapProductID">报废产品ID</param>
  3130. /// <returns></returns>
  3131. public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3132. {
  3133. ActionResult actionResult = new ActionResult();
  3134. try
  3135. {
  3136. // 验证请求头信息
  3137. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3138. // 验证失败
  3139. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3140. {
  3141. return actionResult;
  3142. }
  3143. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3144. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  3145. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3146. {
  3147. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3148. actionResult.Status = (int)Constant.PDAResult.Success;
  3149. }
  3150. else
  3151. {
  3152. actionResult.Status = (int)Constant.PDAResult.Fail;
  3153. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3154. }
  3155. }
  3156. catch (Exception ex)
  3157. {
  3158. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3159. OutputLog.TraceLog(LogPriority.Error,
  3160. this.ToString(),
  3161. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3162. ex.ToString(),
  3163. LocalPath.LogExePath);
  3164. actionResult.Status = (int)Constant.PDAResult.Exception;
  3165. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3166. }
  3167. return actionResult;
  3168. }
  3169. /// <summary>
  3170. /// 根据废弃产品ID获取责任人列表
  3171. /// </summary>
  3172. /// <param name="accountCode"></param>
  3173. /// <param name="userCode"></param>
  3174. /// <param name="userPassword"></param>
  3175. /// <param name="sessionKey"></param>
  3176. /// <param name="scrapProductID">报废产品ID</param>
  3177. /// <returns></returns>
  3178. public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3179. {
  3180. ActionResult actionResult = new ActionResult();
  3181. try
  3182. {
  3183. // 验证请求头信息
  3184. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3185. // 验证失败
  3186. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3187. {
  3188. return actionResult;
  3189. }
  3190. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3191. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  3192. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3193. {
  3194. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3195. actionResult.Status = (int)Constant.PDAResult.Success;
  3196. }
  3197. else
  3198. {
  3199. actionResult.Status = (int)Constant.PDAResult.Fail;
  3200. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3201. }
  3202. }
  3203. catch (Exception ex)
  3204. {
  3205. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3206. OutputLog.TraceLog(LogPriority.Error,
  3207. this.ToString(),
  3208. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3209. ex.ToString(),
  3210. LocalPath.LogExePath);
  3211. actionResult.Status = (int)Constant.PDAResult.Exception;
  3212. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3213. }
  3214. return actionResult;
  3215. }
  3216. /// <summary>
  3217. /// 添加废弃产品记录
  3218. /// </summary>
  3219. /// <param name="SProductEntity">废弃产品实体</param>
  3220. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3221. /// <param name="SResponsibleList">责任者集合</param>
  3222. /// <param name="userInfo">用户基本信息</param>
  3223. /// <returns>int结果返回值</returns>
  3224. /// <remarks>
  3225. /// 庄天威 2014.09.24 新建
  3226. /// </remarks>
  3227. public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3228. ResponProcedureEntity UpdateRProcedureEntity,
  3229. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3230. {
  3231. ActionResult actionResult = new ActionResult();
  3232. try
  3233. {
  3234. // 验证请求头信息
  3235. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3236. // 验证失败
  3237. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3238. {
  3239. return actionResult;
  3240. }
  3241. int addRow = ServiceInvoker.Invoke<int>(this,
  3242. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3243. actionResult.Result = JsonHelper.ToJson(addRow);
  3244. actionResult.Status = (int)Constant.PDAResult.Success;
  3245. }
  3246. catch (Exception ex)
  3247. {
  3248. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3249. OutputLog.TraceLog(LogPriority.Error,
  3250. this.ToString(),
  3251. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3252. ex.ToString(),
  3253. LocalPath.LogExePath);
  3254. actionResult.Status = (int)Constant.PDAResult.Exception;
  3255. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3256. }
  3257. return actionResult;
  3258. }
  3259. /// <summary>
  3260. /// 获取产品窑炉
  3261. /// </summary>
  3262. /// <param name="accountCode"></param>
  3263. /// <param name="userCode"></param>
  3264. /// <param name="userPassword"></param>
  3265. /// <param name="sessionKey"></param>
  3266. /// <returns>Datase</returns>
  3267. public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  3268. {
  3269. ActionResult actionResult = new ActionResult();
  3270. try
  3271. {
  3272. // 验证请求头信息
  3273. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3274. // 验证失败
  3275. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3276. {
  3277. return actionResult;
  3278. }
  3279. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3280. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3281. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3282. {
  3283. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3284. actionResult.Status = (int)Constant.PDAResult.Success;
  3285. }
  3286. else
  3287. {
  3288. actionResult.Status = (int)Constant.PDAResult.Fail;
  3289. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3290. }
  3291. }
  3292. catch (Exception ex)
  3293. {
  3294. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3295. OutputLog.TraceLog(LogPriority.Error,
  3296. this.ToString(),
  3297. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3298. ex.ToString(),
  3299. LocalPath.LogExePath);
  3300. actionResult.Status = (int)Constant.PDAResult.Exception;
  3301. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3302. }
  3303. return actionResult;
  3304. }
  3305. /// <summary>
  3306. /// 获取次品产品条码允许编辑
  3307. /// </summary>
  3308. /// <param name="accountCode"></param>
  3309. /// <param name="userCode"></param>
  3310. /// <param name="userPassword"></param>
  3311. /// <param name="sessionKey"></param>
  3312. /// <param name="barcode">产品条码</param>
  3313. /// <returns>Datase</returns>
  3314. public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3315. {
  3316. ActionResult actionResult = new ActionResult();
  3317. try
  3318. {
  3319. // 验证请求头信息
  3320. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3321. // 验证失败
  3322. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3323. {
  3324. return actionResult;
  3325. }
  3326. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3327. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3328. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3329. {
  3330. actionResult.Result = JsonHelper.ToJson(1);
  3331. actionResult.Status = (int)Constant.PDAResult.Success;
  3332. }
  3333. else
  3334. {
  3335. actionResult.Result = JsonHelper.ToJson(0);
  3336. actionResult.Status = (int)Constant.PDAResult.Fail;
  3337. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3338. }
  3339. }
  3340. catch (Exception ex)
  3341. {
  3342. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3343. OutputLog.TraceLog(LogPriority.Error,
  3344. this.ToString(),
  3345. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3346. ex.ToString(),
  3347. LocalPath.LogExePath);
  3348. actionResult.Status = (int)Constant.PDAResult.Exception;
  3349. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3350. }
  3351. return actionResult;
  3352. }
  3353. /// <summary>
  3354. /// 获取产品条码是否重烧
  3355. /// </summary>
  3356. /// <param name="accountCode"></param>
  3357. /// <param name="userCode"></param>
  3358. /// <param name="userPassword"></param>
  3359. /// <param name="sessionKey"></param>
  3360. /// <param name="barcode">产品条码</param>
  3361. /// <returns>Datase</returns>
  3362. public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3363. {
  3364. ActionResult actionResult = new ActionResult();
  3365. try
  3366. {
  3367. // 验证请求头信息
  3368. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3369. // 验证失败
  3370. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3371. {
  3372. return actionResult;
  3373. }
  3374. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3375. () => PDAModuleLogic.GetReFine(barcode));
  3376. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3377. {
  3378. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3379. }
  3380. else
  3381. {
  3382. actionResult.Result = JsonHelper.ToJson(0);
  3383. }
  3384. actionResult.Status = (int)Constant.PDAResult.Success;
  3385. }
  3386. catch (Exception ex)
  3387. {
  3388. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3389. OutputLog.TraceLog(LogPriority.Error,
  3390. this.ToString(),
  3391. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3392. ex.ToString(),
  3393. LocalPath.LogExePath);
  3394. actionResult.Status = (int)Constant.PDAResult.Exception;
  3395. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3396. }
  3397. return actionResult;
  3398. }
  3399. /// <summary>
  3400. /// 获取登陆帐户有无成检编辑权限
  3401. /// </summary>
  3402. /// <param name="accountCode"></param>
  3403. /// <param name="userCode"></param>
  3404. /// <param name="userPassword"></param>
  3405. /// <param name="sessionKey"></param>
  3406. /// <param name="usercode">工号编码</param>
  3407. /// <returns></returns>
  3408. public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3409. {
  3410. ActionResult actionResult = new ActionResult();
  3411. try
  3412. {
  3413. // 验证请求头信息
  3414. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3415. // 验证失败
  3416. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3417. {
  3418. return actionResult;
  3419. }
  3420. int returnValue = ServiceInvoker.Invoke<int>(this,
  3421. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3422. actionResult.Result = JsonHelper.ToJson(returnValue);
  3423. actionResult.Status = (int)Constant.PDAResult.Success;
  3424. }
  3425. catch (Exception ex)
  3426. {
  3427. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3428. OutputLog.TraceLog(LogPriority.Error,
  3429. this.ToString(),
  3430. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3431. ex.ToString(),
  3432. LocalPath.LogExePath);
  3433. actionResult.Status = (int)Constant.PDAResult.Exception;
  3434. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3435. }
  3436. return actionResult;
  3437. }
  3438. /// <summary>
  3439. /// 根据条码及工序判断是否漏扫
  3440. /// </summary>
  3441. /// <param name="accountCode"></param>
  3442. /// <param name="userCode"></param>
  3443. /// <param name="userPassword"></param>
  3444. /// <param name="sessionKey"></param>
  3445. /// <param name="usercode">工号编码</param>
  3446. /// <param name="barcode">产品条码</param>
  3447. /// <param name="produceid">工序ID</param>
  3448. /// <returns></returns>
  3449. public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3450. {
  3451. ActionResult actionResult = new ActionResult();
  3452. try
  3453. {
  3454. // 验证请求头信息
  3455. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3456. // 验证失败
  3457. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3458. {
  3459. return actionResult;
  3460. }
  3461. int returnValue = 1;
  3462. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3463. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3464. actionResult.Result = JsonHelper.ToJson(returnValue);
  3465. actionResult.Status = (int)Constant.PDAResult.Success;
  3466. }
  3467. catch (Exception ex)
  3468. {
  3469. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3470. OutputLog.TraceLog(LogPriority.Error,
  3471. this.ToString(),
  3472. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3473. ex.ToString(),
  3474. LocalPath.LogExePath);
  3475. actionResult.Status = (int)Constant.PDAResult.Exception;
  3476. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3477. }
  3478. return actionResult;
  3479. }
  3480. /// <summary>
  3481. /// 获取登陆帐户有无报损审批权限
  3482. /// </summary>
  3483. /// <param name="accountCode"></param>
  3484. /// <param name="userCode"></param>
  3485. /// <param name="userPassword"></param>
  3486. /// <param name="sessionKey"></param>
  3487. /// <param name="usercode">工号编码</param>
  3488. /// <returns></returns>
  3489. public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3490. {
  3491. ActionResult actionResult = new ActionResult();
  3492. try
  3493. {
  3494. // 验证请求头信息
  3495. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3496. // 验证失败
  3497. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3498. {
  3499. return actionResult;
  3500. }
  3501. int returnValue = ServiceInvoker.Invoke<int>(this,
  3502. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3503. actionResult.Result = JsonHelper.ToJson(returnValue);
  3504. actionResult.Status = (int)Constant.PDAResult.Success;
  3505. }
  3506. catch (Exception ex)
  3507. {
  3508. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3509. OutputLog.TraceLog(LogPriority.Error,
  3510. this.ToString(),
  3511. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3512. ex.ToString(),
  3513. LocalPath.LogExePath);
  3514. actionResult.Status = (int)Constant.PDAResult.Exception;
  3515. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3516. }
  3517. return actionResult;
  3518. }
  3519. /// <summary>
  3520. /// 获取登陆帐户有无报损审批权限
  3521. /// </summary>
  3522. /// <param name="accountCode"></param>
  3523. /// <param name="userCode"></param>
  3524. /// <param name="userPassword"></param>
  3525. /// <param name="sessionKey"></param>
  3526. /// <param name="usercode">工号编码</param>
  3527. /// <returns></returns>
  3528. public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3529. {
  3530. ActionResult actionResult = new ActionResult();
  3531. try
  3532. {
  3533. // 验证请求头信息
  3534. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3535. // 验证失败
  3536. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3537. {
  3538. return actionResult;
  3539. }
  3540. int returnValue = ServiceInvoker.Invoke<int>(this,
  3541. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3542. actionResult.Result = JsonHelper.ToJson(returnValue);
  3543. actionResult.Status = (int)Constant.PDAResult.Success;
  3544. }
  3545. catch (Exception ex)
  3546. {
  3547. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3548. OutputLog.TraceLog(LogPriority.Error,
  3549. this.ToString(),
  3550. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3551. ex.ToString(),
  3552. LocalPath.LogExePath);
  3553. actionResult.Status = (int)Constant.PDAResult.Exception;
  3554. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3555. }
  3556. return actionResult;
  3557. }
  3558. /// <summary>
  3559. /// 获取窑车对应产品列表
  3560. /// </summary>
  3561. /// <param name="accountCode"></param>
  3562. /// <param name="userCode"></param>
  3563. /// <param name="userPassword"></param>
  3564. /// <param name="sessionKey"></param>
  3565. /// <param name="KilnCarID">窑车ID</param>
  3566. /// <returns>Dataset</returns>
  3567. public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  3568. {
  3569. ActionResult actionResult = new ActionResult();
  3570. try
  3571. {
  3572. // 验证请求头信息
  3573. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3574. // 验证失败
  3575. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3576. {
  3577. return actionResult;
  3578. }
  3579. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3580. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3581. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3582. {
  3583. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3584. actionResult.Status = (int)Constant.PDAResult.Success;
  3585. }
  3586. else
  3587. {
  3588. actionResult.Status = (int)Constant.PDAResult.Fail;
  3589. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3590. }
  3591. }
  3592. catch (Exception ex)
  3593. {
  3594. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3595. OutputLog.TraceLog(LogPriority.Error,
  3596. this.ToString(),
  3597. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3598. ex.ToString(),
  3599. LocalPath.LogExePath);
  3600. actionResult.Status = (int)Constant.PDAResult.Exception;
  3601. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3602. }
  3603. return actionResult;
  3604. }
  3605. /// <summary>
  3606. /// 更换条码
  3607. /// </summary>
  3608. /// <param name="accountCode"></param>
  3609. /// <param name="userCode"></param>
  3610. /// <param name="userPassword"></param>
  3611. /// <param name="sessionKey"></param>
  3612. ///<param name="barcode">原条码</param>
  3613. /// <param name="newBarcode">新条码</param>
  3614. /// <param name="remarks">备注</param>
  3615. /// <returns>操作结果</returns>
  3616. public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  3617. {
  3618. ActionResult actionResult = new ActionResult();
  3619. try
  3620. {
  3621. // 验证请求头信息
  3622. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3623. // 验证失败
  3624. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3625. {
  3626. return actionResult;
  3627. }
  3628. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3629. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3630. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3631. {
  3632. actionResult.Result = 1;
  3633. actionResult.Status = (int)Constant.PDAResult.Success;
  3634. }
  3635. else
  3636. {
  3637. actionResult.Status = (int)Constant.PDAResult.Fail;
  3638. actionResult.Message = serviceResultEntity.Message;
  3639. }
  3640. }
  3641. catch (Exception ex)
  3642. {
  3643. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3644. OutputLog.TraceLog(LogPriority.Error,
  3645. this.ToString(),
  3646. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3647. ex.ToString(),
  3648. LocalPath.LogExePath);
  3649. actionResult.Status = (int)Constant.PDAResult.Exception;
  3650. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3651. }
  3652. return actionResult;
  3653. }
  3654. /// <summary>
  3655. /// 获取(注浆登记)的查询数据
  3656. /// </summary>
  3657. /// <param name="accountCode"></param>
  3658. /// <param name="userCode"></param>
  3659. /// <param name="userPassword"></param>
  3660. /// <param name="sessionKey"></param>
  3661. /// <param name="se">查询条件</param>
  3662. /// <returns>Dataset</returns>
  3663. public ActionResult GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  3664. {
  3665. ActionResult actionResult = new ActionResult();
  3666. try
  3667. {
  3668. // 验证请求头信息
  3669. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3670. // 验证失败
  3671. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3672. {
  3673. return actionResult;
  3674. }
  3675. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3676. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3677. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3678. {
  3679. // PDA不显示的列删除掉
  3680. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3681. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3682. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3683. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3684. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3685. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3686. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3687. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3688. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3689. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3690. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3691. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3692. actionResult.Status = (int)Constant.PDAResult.Success;
  3693. }
  3694. else
  3695. {
  3696. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3697. actionResult.Message = "无查询数据";
  3698. }
  3699. }
  3700. catch (Exception ex)
  3701. {
  3702. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3703. OutputLog.TraceLog(LogPriority.Error,
  3704. this.ToString(),
  3705. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3706. ex.ToString(),
  3707. LocalPath.LogExePath);
  3708. actionResult.Status = (int)Constant.PDAResult.Exception;
  3709. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3710. }
  3711. return actionResult;
  3712. }
  3713. /// <summary>
  3714. /// 获取(注浆登记)的查询数据
  3715. /// </summary>
  3716. /// <param name="accountCode"></param>
  3717. /// <param name="userCode"></param>
  3718. /// <param name="userPassword"></param>
  3719. /// <param name="sessionKey"></param>
  3720. /// <param name="se">查询条件</param>
  3721. /// <returns>Dataset</returns>
  3722. public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3723. {
  3724. ActionResult actionResult = new ActionResult();
  3725. try
  3726. {
  3727. // 验证请求头信息
  3728. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3729. // 验证失败
  3730. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3731. {
  3732. return actionResult;
  3733. }
  3734. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3735. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3736. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3737. {
  3738. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3739. actionResult.Status = (int)Constant.PDAResult.Success;
  3740. }
  3741. else
  3742. {
  3743. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3744. actionResult.Message = "无查询数据";
  3745. }
  3746. }
  3747. catch (Exception ex)
  3748. {
  3749. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3750. OutputLog.TraceLog(LogPriority.Error,
  3751. this.ToString(),
  3752. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3753. ex.ToString(),
  3754. LocalPath.LogExePath);
  3755. actionResult.Status = (int)Constant.PDAResult.Exception;
  3756. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3757. }
  3758. return actionResult;
  3759. }
  3760. /// <summary>
  3761. ///获得成型线信息
  3762. /// </summary>
  3763. /// <param name="accountCode"></param>
  3764. /// <param name="userCode"></param>
  3765. /// <param name="userPassword"></param>
  3766. /// <param name="sessionKey"></param>
  3767. /// <param name="se">查询条件</param>
  3768. /// <returns>Dataset</returns>
  3769. public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3770. {
  3771. ActionResult actionResult = new ActionResult();
  3772. try
  3773. {
  3774. // 验证请求头信息
  3775. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3776. // 验证失败
  3777. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3778. {
  3779. return actionResult;
  3780. }
  3781. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3782. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3783. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3784. {
  3785. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3786. actionResult.Status = (int)Constant.PDAResult.Success;
  3787. }
  3788. else
  3789. {
  3790. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3791. actionResult.Message = "无查询数据";
  3792. }
  3793. }
  3794. catch (Exception ex)
  3795. {
  3796. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3797. OutputLog.TraceLog(LogPriority.Error,
  3798. this.ToString(),
  3799. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3800. ex.ToString(),
  3801. LocalPath.LogExePath);
  3802. actionResult.Status = (int)Constant.PDAResult.Exception;
  3803. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3804. }
  3805. return actionResult;
  3806. }
  3807. /// <summary>
  3808. ///获取在产产品的信息标识列表
  3809. /// </summary>
  3810. /// <param name="accountCode"></param>
  3811. /// <param name="userCode"></param>
  3812. /// <param name="userPassword"></param>
  3813. /// <param name="sessionKey"></param>
  3814. /// <param name="barcode">查询条件</param>
  3815. /// <returns>Dataset</returns>
  3816. public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3817. {
  3818. ActionResult actionResult = new ActionResult();
  3819. try
  3820. {
  3821. // 验证请求头信息
  3822. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3823. // 验证失败
  3824. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3825. {
  3826. return actionResult;
  3827. }
  3828. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3829. () => PMModuleLogic.GetInProductionDataList(barcode));
  3830. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3831. {
  3832. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3833. actionResult.Status = (int)Constant.PDAResult.Success;
  3834. }
  3835. else
  3836. {
  3837. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3838. actionResult.Message = "无查询数据";
  3839. }
  3840. }
  3841. catch (Exception ex)
  3842. {
  3843. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3844. OutputLog.TraceLog(LogPriority.Error,
  3845. this.ToString(),
  3846. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3847. ex.ToString(),
  3848. LocalPath.LogExePath);
  3849. actionResult.Status = (int)Constant.PDAResult.Exception;
  3850. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3851. }
  3852. return actionResult;
  3853. }
  3854. /// <summary>
  3855. ///获取条码是否注浆登记过,0行无效
  3856. /// </summary>
  3857. /// <param name="accountCode"></param>
  3858. /// <param name="userCode"></param>
  3859. /// <param name="userPassword"></param>
  3860. /// <param name="sessionKey"></param>
  3861. /// <param name="barcode">查询条件</param>
  3862. /// <returns>Dataset</returns>
  3863. public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3864. {
  3865. ActionResult actionResult = new ActionResult();
  3866. try
  3867. {
  3868. // 验证请求头信息
  3869. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3870. // 验证失败
  3871. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3872. {
  3873. return actionResult;
  3874. }
  3875. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3876. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  3877. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3878. {
  3879. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3880. actionResult.Status = (int)Constant.PDAResult.Success;
  3881. }
  3882. else
  3883. {
  3884. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3885. actionResult.Message = "该产品条码无效,无法报损!";
  3886. }
  3887. }
  3888. catch (Exception ex)
  3889. {
  3890. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3891. OutputLog.TraceLog(LogPriority.Error,
  3892. this.ToString(),
  3893. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3894. ex.ToString(),
  3895. LocalPath.LogExePath);
  3896. actionResult.Status = (int)Constant.PDAResult.Exception;
  3897. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3898. }
  3899. return actionResult;
  3900. }
  3901. /// <summary>
  3902. /// 获取登陆帐户有变更条码权限
  3903. /// </summary>
  3904. /// <param name="accountCode"></param>
  3905. /// <param name="userCode"></param>
  3906. /// <param name="userPassword"></param>
  3907. /// <param name="sessionKey"></param>
  3908. /// <returns></returns>
  3909. public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3910. {
  3911. ActionResult actionResult = new ActionResult();
  3912. try
  3913. {
  3914. // 验证请求头信息
  3915. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3916. // 验证失败
  3917. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3918. {
  3919. return actionResult;
  3920. }
  3921. int returnValue = ServiceInvoker.Invoke<int>(this,
  3922. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  3923. actionResult.Result = JsonHelper.ToJson(returnValue);
  3924. actionResult.Status = (int)Constant.PDAResult.Success;
  3925. }
  3926. catch (Exception ex)
  3927. {
  3928. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3929. OutputLog.TraceLog(LogPriority.Error,
  3930. this.ToString(),
  3931. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3932. ex.ToString(),
  3933. LocalPath.LogExePath);
  3934. actionResult.Status = (int)Constant.PDAResult.Exception;
  3935. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3936. }
  3937. return actionResult;
  3938. }
  3939. /// <summary>
  3940. /// 成检时获取此条码是否报损
  3941. /// </summary>
  3942. /// <param name="accountCode"></param>
  3943. /// <param name="userCode"></param>
  3944. /// <param name="userPassword"></param>
  3945. /// <param name="sessionKey"></param>
  3946. /// <param name="barcode">产品条码</param>
  3947. /// <returns></returns>
  3948. public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3949. {
  3950. ActionResult actionResult = new ActionResult();
  3951. try
  3952. {
  3953. // 验证请求头信息
  3954. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3955. // 验证失败
  3956. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3957. {
  3958. return actionResult;
  3959. }
  3960. int returnValue = ServiceInvoker.Invoke<int>(this,
  3961. () => PMModuleLogic.CheckScrapProduct(barcode));
  3962. if (returnValue == -100)
  3963. {
  3964. actionResult.Result = JsonHelper.ToJson(returnValue);
  3965. actionResult.Status = (int)Constant.PDAResult.Success;
  3966. }
  3967. else
  3968. {
  3969. actionResult.Status = (int)Constant.PDAResult.Fail;
  3970. if (returnValue == 0)
  3971. {
  3972. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  3973. }
  3974. else
  3975. {
  3976. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  3977. }
  3978. }
  3979. }
  3980. catch (Exception ex)
  3981. {
  3982. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3983. OutputLog.TraceLog(LogPriority.Error,
  3984. this.ToString(),
  3985. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3986. ex.ToString(),
  3987. LocalPath.LogExePath);
  3988. actionResult.Status = (int)Constant.PDAResult.Exception;
  3989. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3990. }
  3991. return actionResult;
  3992. }
  3993. /// <summary>
  3994. /// 获取产品完成工序的ID(PDA)
  3995. /// </summary>
  3996. /// <param name="barcode">产品条码</param>
  3997. /// <returns>int</returns>
  3998. public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3999. {
  4000. ActionResult actionResult = new ActionResult();
  4001. try
  4002. {
  4003. // 验证请求头信息
  4004. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4005. // 验证失败
  4006. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4007. {
  4008. return actionResult;
  4009. }
  4010. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4011. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  4012. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  4013. actionResult.Status = (int)Constant.PDAResult.Success;
  4014. }
  4015. catch (Exception ex)
  4016. {
  4017. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4018. OutputLog.TraceLog(LogPriority.Error,
  4019. this.ToString(),
  4020. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4021. ex.ToString(),
  4022. LocalPath.LogExePath);
  4023. actionResult.Status = (int)Constant.PDAResult.Exception;
  4024. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4025. }
  4026. return actionResult;
  4027. }
  4028. /// <summary>
  4029. /// 获取产品完成工序的ID(PDA)
  4030. /// </summary>
  4031. /// <param name="barcode">产品条码</param>
  4032. /// <returns>int</returns>
  4033. public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  4034. {
  4035. ActionResult actionResult = new ActionResult();
  4036. try
  4037. {
  4038. // 验证请求头信息
  4039. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4040. // 验证失败
  4041. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4042. {
  4043. return actionResult;
  4044. }
  4045. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4046. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  4047. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  4048. actionResult.Status = (int)Constant.PDAResult.Success;
  4049. }
  4050. catch (Exception ex)
  4051. {
  4052. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4053. OutputLog.TraceLog(LogPriority.Error,
  4054. this.ToString(),
  4055. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4056. ex.ToString(),
  4057. LocalPath.LogExePath);
  4058. actionResult.Status = (int)Constant.PDAResult.Exception;
  4059. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4060. }
  4061. return actionResult;
  4062. }
  4063. /// <summary>
  4064. /// 成检-校验生产工号
  4065. /// </summary>
  4066. /// <param name="usercode">生产工号</param>
  4067. /// <returns>int</returns>
  4068. public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode)
  4069. {
  4070. ActionResult actionResult = new ActionResult();
  4071. try
  4072. {
  4073. // 验证请求头信息
  4074. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4075. // 验证失败
  4076. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4077. {
  4078. return actionResult;
  4079. }
  4080. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4081. () => PDAModuleLogic.GetUserCode(usercode, sUserInfo));
  4082. actionResult.Result = JsonHelper.ToJson(ds);
  4083. actionResult.Status = (int)Constant.PDAResult.Success;
  4084. }
  4085. catch (Exception ex)
  4086. {
  4087. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4088. OutputLog.TraceLog(LogPriority.Error,
  4089. this.ToString(),
  4090. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4091. ex.ToString(),
  4092. LocalPath.LogExePath);
  4093. actionResult.Status = (int)Constant.PDAResult.Exception;
  4094. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4095. }
  4096. return actionResult;
  4097. }
  4098. /// <summary>
  4099. /// 更新漏扫的成型工号
  4100. /// </summary>
  4101. /// <param name="accountCode"></param>
  4102. /// <param name="userCode"></param>
  4103. /// <param name="userPassword"></param>
  4104. /// <param name="sessionKey"></param>
  4105. /// <param name="groutingUserCode">成型工号</param>
  4106. /// <param name="missingID">漏扫ID</param>
  4107. /// <returns></returns>
  4108. public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  4109. {
  4110. ActionResult actionResult = new ActionResult();
  4111. try
  4112. {
  4113. // 验证请求头信息
  4114. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4115. // 验证失败
  4116. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4117. {
  4118. return actionResult;
  4119. }
  4120. int returnValue = ServiceInvoker.Invoke<int>(this,
  4121. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  4122. if (returnValue != -1)
  4123. {
  4124. actionResult.Result = JsonHelper.ToJson(returnValue);
  4125. actionResult.Status = (int)Constant.PDAResult.Success;
  4126. }
  4127. else
  4128. {
  4129. actionResult.Status = (int)Constant.PDAResult.Fail;
  4130. actionResult.Message = "存在无效的漏扫工号";
  4131. }
  4132. }
  4133. catch (Exception ex)
  4134. {
  4135. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4136. OutputLog.TraceLog(LogPriority.Error,
  4137. this.ToString(),
  4138. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4139. ex.ToString(),
  4140. LocalPath.LogExePath);
  4141. actionResult.Status = (int)Constant.PDAResult.Exception;
  4142. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4143. }
  4144. return actionResult;
  4145. }
  4146. /// <summary>
  4147. /// 在入窑工序检验窑车号是否存在
  4148. /// </summary>
  4149. /// <param name="accountCode"></param>
  4150. /// <param name="userCode"></param>
  4151. /// <param name="userPassword"></param>
  4152. /// <param name="sessionKey"></param>
  4153. /// <param name="kilncarcode">窑车编码</param>
  4154. /// <param name="procedureid">工序ID</param>
  4155. /// <returns></returns>
  4156. public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4157. {
  4158. ActionResult actionResult = new ActionResult();
  4159. try
  4160. {
  4161. // 验证请求头信息
  4162. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4163. // 验证失败
  4164. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4165. {
  4166. return actionResult;
  4167. }
  4168. int returnValue = ServiceInvoker.Invoke<int>(this,
  4169. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  4170. if (returnValue == 1)
  4171. {
  4172. actionResult.Result = JsonHelper.ToJson(returnValue);
  4173. actionResult.Status = (int)Constant.PDAResult.Success;
  4174. }
  4175. else
  4176. {
  4177. actionResult.Status = (int)Constant.PDAResult.Fail;
  4178. if (returnValue == -99)
  4179. actionResult.Message = "窑炉车号无效";
  4180. else if (returnValue == -98)
  4181. actionResult.Message = "窑车己无产品";
  4182. else if (returnValue == -97)
  4183. actionResult.Message = "窑车没有入窑,不可以撤销";
  4184. else if (returnValue == -1)
  4185. actionResult.Message = "保存失败";
  4186. }
  4187. }
  4188. catch (Exception ex)
  4189. {
  4190. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4191. OutputLog.TraceLog(LogPriority.Error,
  4192. this.ToString(),
  4193. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4194. ex.ToString(),
  4195. LocalPath.LogExePath);
  4196. actionResult.Status = (int)Constant.PDAResult.Exception;
  4197. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4198. }
  4199. return actionResult;
  4200. }
  4201. /// <summary>
  4202. /// 获取盘点单列表
  4203. /// </summary>
  4204. /// <param name="sUserInfo"></param>
  4205. /// <returns></returns>
  4206. public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey)
  4207. {
  4208. ActionResult actionResult = new ActionResult();
  4209. try
  4210. {
  4211. // 验证请求头信息
  4212. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4213. // 验证失败
  4214. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4215. {
  4216. return actionResult;
  4217. }
  4218. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4219. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  4220. actionResult.Result = JsonHelper.ToJson(ds);
  4221. actionResult.Status = (int)Constant.PDAResult.Success;
  4222. }
  4223. catch (Exception ex)
  4224. {
  4225. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4226. OutputLog.TraceLog(LogPriority.Error,
  4227. this.ToString(),
  4228. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4229. ex.ToString(),
  4230. LocalPath.LogExePath);
  4231. actionResult.Status = (int)Constant.PDAResult.Exception;
  4232. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4233. }
  4234. return actionResult;
  4235. }
  4236. /// <summary>
  4237. /// 进行盘点操作
  4238. /// </summary>
  4239. /// <param name="accountCode"></param>
  4240. /// <param name="userCode"></param>
  4241. /// <param name="userPassword"></param>
  4242. /// <param name="sessionKey"></param>
  4243. /// <param name="InCheckedID">盘点单ID</param>
  4244. /// <param name="BarCode">产品条码</param>
  4245. /// <returns></returns>
  4246. public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4247. {
  4248. ActionResult actionResult = new ActionResult();
  4249. try
  4250. {
  4251. // 验证请求头信息
  4252. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4253. // 验证失败
  4254. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4255. {
  4256. return actionResult;
  4257. }
  4258. int returnValue = ServiceInvoker.Invoke<int>(this,
  4259. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4260. if (returnValue > 0)
  4261. {
  4262. actionResult.Result = JsonHelper.ToJson(returnValue);
  4263. actionResult.Status = (int)Constant.PDAResult.Success;
  4264. actionResult.Message = "产品" + BarCode + "盘点成功";
  4265. }
  4266. else if (returnValue == 10)
  4267. {
  4268. actionResult.Result = JsonHelper.ToJson(returnValue);
  4269. actionResult.Status = (int)Constant.PDAResult.Success;
  4270. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4271. }
  4272. else
  4273. {
  4274. actionResult.Status = (int)Constant.PDAResult.Fail;
  4275. if (returnValue == -2)
  4276. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4277. //if (returnValue == 10)
  4278. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4279. //if (returnValue > 0)
  4280. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4281. if (returnValue == -22)
  4282. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4283. if (returnValue == -23)
  4284. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4285. if (returnValue == -24)
  4286. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4287. if (returnValue == -25)
  4288. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4289. else if (returnValue == 0)
  4290. actionResult.Message = "盘点失败";
  4291. }
  4292. }
  4293. catch (Exception ex)
  4294. {
  4295. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4296. OutputLog.TraceLog(LogPriority.Error,
  4297. this.ToString(),
  4298. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4299. ex.ToString(),
  4300. LocalPath.LogExePath);
  4301. actionResult.Status = (int)Constant.PDAResult.Exception;
  4302. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4303. }
  4304. return actionResult;
  4305. }
  4306. #region 班次配置
  4307. /// <summary>
  4308. /// 班次配置-通过工号获取工种列表
  4309. /// </summary>
  4310. /// <param name="userId">工号ID</param>
  4311. /// <returns></returns>
  4312. public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4313. {
  4314. ActionResult actionResult = new ActionResult();
  4315. try
  4316. {
  4317. // 验证请求头信息
  4318. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4319. // 验证失败
  4320. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4321. {
  4322. return actionResult;
  4323. }
  4324. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4325. () => SystemModuleLogic.GetJobByUserId(userId));
  4326. actionResult.Result = JsonHelper.ToJson(ds);
  4327. actionResult.Status = (int)Constant.PDAResult.Success;
  4328. }
  4329. catch (Exception ex)
  4330. {
  4331. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4332. OutputLog.TraceLog(LogPriority.Error,
  4333. this.ToString(),
  4334. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4335. ex.ToString(),
  4336. LocalPath.LogExePath);
  4337. actionResult.Status = (int)Constant.PDAResult.Exception;
  4338. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4339. }
  4340. return actionResult;
  4341. }
  4342. ///// <summary>
  4343. ///// 班次配置-根据工号查询员工档案信息
  4344. ///// </summary>
  4345. ///// <param name="userId">工号ID</param>
  4346. ///// <returns></returns>
  4347. //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4348. //{
  4349. // ActionResult actionResult = new ActionResult();
  4350. // try
  4351. // {
  4352. // // 验证请求头信息
  4353. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4354. // // 验证失败
  4355. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4356. // {
  4357. // return actionResult;
  4358. // }
  4359. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4360. // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
  4361. // actionResult.Result = JsonHelper.ToJson(ds);
  4362. // actionResult.Status = (int)Constant.PDAResult.Success;
  4363. // }
  4364. // catch (Exception ex)
  4365. // {
  4366. // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4367. // OutputLog.TraceLog(LogPriority.Error,
  4368. // this.ToString(),
  4369. // System.Reflection.MethodBase.GetCurrentMethod().Name,
  4370. // ex.ToString(),
  4371. // LocalPath.LogExePath);
  4372. // actionResult.Status = (int)Constant.PDAResult.Exception;
  4373. // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4374. // }
  4375. // return actionResult;
  4376. //}
  4377. /// <summary>
  4378. /// 班次配置-根据员工姓名查员工信息
  4379. /// </summary>
  4380. /// <param name="searchStaffEntity"></param>
  4381. /// <returns></returns>
  4382. public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4383. {
  4384. ActionResult actionResult = new ActionResult();
  4385. try
  4386. {
  4387. // 验证请求头信息
  4388. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4389. // 验证失败
  4390. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4391. {
  4392. return actionResult;
  4393. }
  4394. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4395. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4396. actionResult.Result = JsonHelper.ToJson(ds);
  4397. actionResult.Status = (int)Constant.PDAResult.Success;
  4398. }
  4399. catch (Exception ex)
  4400. {
  4401. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4402. OutputLog.TraceLog(LogPriority.Error,
  4403. this.ToString(),
  4404. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4405. ex.ToString(),
  4406. LocalPath.LogExePath);
  4407. actionResult.Status = (int)Constant.PDAResult.Exception;
  4408. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4409. }
  4410. return actionResult;
  4411. }
  4412. /// <summary>
  4413. /// 获取班次配置信息
  4414. /// </summary>
  4415. /// <param name="searchEntity"></param>
  4416. /// <returns></returns>
  4417. public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  4418. {
  4419. ActionResult actionResult = new ActionResult();
  4420. try
  4421. {
  4422. // 验证请求头信息
  4423. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4424. // 验证失败
  4425. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4426. {
  4427. return actionResult;
  4428. }
  4429. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4430. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4431. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4432. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4433. actionResult.Result = JsonHelper.ToJson(ds);
  4434. actionResult.Status = (int)Constant.PDAResult.Success;
  4435. }
  4436. catch (Exception ex)
  4437. {
  4438. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4439. OutputLog.TraceLog(LogPriority.Error,
  4440. this.ToString(),
  4441. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4442. ex.ToString(),
  4443. LocalPath.LogExePath);
  4444. actionResult.Status = (int)Constant.PDAResult.Exception;
  4445. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4446. }
  4447. return actionResult;
  4448. }
  4449. public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4450. {
  4451. ActionResult actionResult = new ActionResult();
  4452. try
  4453. {
  4454. // 验证请求头信息
  4455. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4456. // 验证失败
  4457. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4458. {
  4459. return actionResult;
  4460. }
  4461. int returnValue = ServiceInvoker.Invoke<int>(this,
  4462. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4463. if (returnValue > 0)
  4464. {
  4465. actionResult.Result = JsonHelper.ToJson(returnValue);
  4466. actionResult.Status = (int)Constant.PDAResult.Success;
  4467. }
  4468. else
  4469. {
  4470. actionResult.Status = (int)Constant.PDAResult.Fail;
  4471. actionResult.Message = "保存失败";
  4472. }
  4473. }
  4474. catch (Exception ex)
  4475. {
  4476. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4477. OutputLog.TraceLog(LogPriority.Error,
  4478. this.ToString(),
  4479. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4480. ex.ToString(),
  4481. LocalPath.LogExePath);
  4482. actionResult.Status = (int)Constant.PDAResult.Exception;
  4483. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4484. }
  4485. return actionResult;
  4486. }
  4487. /// <summary>
  4488. /// 班次配置--获取详细信息
  4489. /// </summary>
  4490. /// <param name="searchEntity"></param>
  4491. /// <returns></returns>
  4492. public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4493. {
  4494. ActionResult actionResult = new ActionResult();
  4495. try
  4496. {
  4497. // 验证请求头信息
  4498. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4499. // 验证失败
  4500. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4501. {
  4502. return actionResult;
  4503. }
  4504. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4505. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4506. actionResult.Result = JsonHelper.ToJson(ds);
  4507. actionResult.Status = (int)Constant.PDAResult.Success;
  4508. }
  4509. catch (Exception ex)
  4510. {
  4511. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4512. OutputLog.TraceLog(LogPriority.Error,
  4513. this.ToString(),
  4514. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4515. ex.ToString(),
  4516. LocalPath.LogExePath);
  4517. actionResult.Status = (int)Constant.PDAResult.Exception;
  4518. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4519. }
  4520. return actionResult;
  4521. }
  4522. /// <summary>
  4523. /// 获取用户是否有班次配置权限
  4524. /// </summary>
  4525. /// <param name="accountCode"></param>
  4526. /// <param name="userCode"></param>
  4527. /// <param name="userPassword"></param>
  4528. /// <param name="sessionKey"></param>
  4529. /// <returns></returns>
  4530. public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4531. {
  4532. ActionResult actionResult = new ActionResult();
  4533. try
  4534. {
  4535. // 验证请求头信息
  4536. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4537. // 验证失败
  4538. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4539. {
  4540. return actionResult;
  4541. }
  4542. int returnValue = ServiceInvoker.Invoke<int>(this,
  4543. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4544. actionResult.Result = JsonHelper.ToJson(returnValue);
  4545. actionResult.Status = (int)Constant.PDAResult.Success;
  4546. }
  4547. catch (Exception ex)
  4548. {
  4549. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4550. OutputLog.TraceLog(LogPriority.Error,
  4551. this.ToString(),
  4552. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4553. ex.ToString(),
  4554. LocalPath.LogExePath);
  4555. actionResult.Status = (int)Constant.PDAResult.Exception;
  4556. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4557. }
  4558. return actionResult;
  4559. }
  4560. /// <summary>
  4561. /// 获取盘点单列表
  4562. /// </summary>
  4563. /// <param name="sUserInfo"></param>
  4564. /// <returns></returns>
  4565. public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  4566. {
  4567. ActionResult actionResult = new ActionResult();
  4568. try
  4569. {
  4570. // 验证请求头信息
  4571. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4572. // 验证失败
  4573. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4574. {
  4575. return actionResult;
  4576. }
  4577. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4578. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4579. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4580. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4581. actionResult.Result = JsonHelper.ToJson(ds);
  4582. actionResult.Status = (int)Constant.PDAResult.Success;
  4583. }
  4584. catch (Exception ex)
  4585. {
  4586. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4587. OutputLog.TraceLog(LogPriority.Error,
  4588. this.ToString(),
  4589. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4590. ex.ToString(),
  4591. LocalPath.LogExePath);
  4592. actionResult.Status = (int)Constant.PDAResult.Exception;
  4593. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4594. }
  4595. return actionResult;
  4596. }
  4597. #endregion
  4598. #region PDA报表
  4599. /// <summary>
  4600. /// 产品质量跟踪
  4601. /// </summary>
  4602. /// <param name="accountCode"></param>
  4603. /// <param name="userCode"></param>
  4604. /// <param name="userPassword"></param>
  4605. /// <param name="sessionKey"></param>
  4606. /// <param name="se"></param>
  4607. /// <returns></returns>
  4608. public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4609. {
  4610. ActionResult actionResult = new ActionResult();
  4611. try
  4612. {
  4613. // 验证请求头信息
  4614. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4615. // 验证失败
  4616. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4617. {
  4618. return actionResult;
  4619. }
  4620. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4621. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4622. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4623. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4624. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4625. {
  4626. actionResult.Status = (int)Constant.PDAResult.Fail;
  4627. actionResult.Message = Messages.MSG_CMN_I002;
  4628. }
  4629. else
  4630. {
  4631. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4632. actionResult.Status = (int)Constant.PDAResult.Success;
  4633. }
  4634. }
  4635. catch (Exception ex)
  4636. {
  4637. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4638. OutputLog.TraceLog(LogPriority.Error,
  4639. this.ToString(),
  4640. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4641. ex.ToString(),
  4642. LocalPath.LogExePath);
  4643. actionResult.Status = (int)Constant.PDAResult.Exception;
  4644. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4645. }
  4646. return actionResult;
  4647. }
  4648. /// <summary>
  4649. /// 工号产量质量分析表
  4650. /// </summary>
  4651. /// <param name="accountCode"></param>
  4652. /// <param name="userCode"></param>
  4653. /// <param name="userPassword"></param>
  4654. /// <param name="sessionKey"></param>
  4655. /// <param name="se"></param>
  4656. /// <returns></returns>
  4657. public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4658. int rptSProcedureID, string workcode, string date)
  4659. {
  4660. ActionResult actionResult = new ActionResult();
  4661. try
  4662. {
  4663. // 验证请求头信息
  4664. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4665. // 验证失败
  4666. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4667. {
  4668. return actionResult;
  4669. }
  4670. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4671. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4672. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4673. {
  4674. actionResult.Status = (int)Constant.PDAResult.Fail;
  4675. actionResult.Message = Messages.MSG_CMN_I002;
  4676. }
  4677. else
  4678. {
  4679. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4680. actionResult.Status = (int)Constant.PDAResult.Success;
  4681. }
  4682. }
  4683. catch (Exception ex)
  4684. {
  4685. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4686. OutputLog.TraceLog(LogPriority.Error,
  4687. this.ToString(),
  4688. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4689. ex.ToString(),
  4690. LocalPath.LogExePath);
  4691. actionResult.Status = (int)Constant.PDAResult.Exception;
  4692. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4693. }
  4694. return actionResult;
  4695. }
  4696. /// <summary>
  4697. /// 工号产量质量分析表(中陶)
  4698. /// </summary>
  4699. /// <param name="accountCode"></param>
  4700. /// <param name="userCode"></param>
  4701. /// <param name="userPassword"></param>
  4702. /// <param name="sessionKey"></param>
  4703. /// <param name="se"></param>
  4704. /// <returns></returns>
  4705. public ActionResult GetFP00002_1Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4706. int rptSProcedureID, string workcode, string date, string goodscode)
  4707. {
  4708. ActionResult actionResult = new ActionResult();
  4709. try
  4710. {
  4711. // 验证请求头信息
  4712. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4713. // 验证失败
  4714. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4715. {
  4716. return actionResult;
  4717. }
  4718. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4719. () => PDAModuleLogic.GetFP00002_1Data(sUserInfo, rptSProcedureID, workcode,
  4720. Convert.ToDateTime(date), goodscode));
  4721. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4722. {
  4723. actionResult.Status = (int)Constant.PDAResult.Fail;
  4724. actionResult.Message = Messages.MSG_CMN_I002;
  4725. }
  4726. else
  4727. {
  4728. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4729. actionResult.Status = (int)Constant.PDAResult.Success;
  4730. }
  4731. }
  4732. catch (Exception ex)
  4733. {
  4734. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4735. OutputLog.TraceLog(LogPriority.Error,
  4736. this.ToString(),
  4737. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4738. ex.ToString(),
  4739. LocalPath.LogExePath);
  4740. actionResult.Status = (int)Constant.PDAResult.Exception;
  4741. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4742. }
  4743. return actionResult;
  4744. }
  4745. /// <summary>
  4746. /// 半检数据统计表
  4747. /// </summary>
  4748. /// <param name="accountCode"></param>
  4749. /// <param name="userCode"></param>
  4750. /// <param name="userPassword"></param>
  4751. /// <param name="sessionKey"></param>
  4752. /// <param name="se"></param>
  4753. /// <returns></returns>
  4754. public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4755. string workcode, string datebegin, string dateend)
  4756. {
  4757. ActionResult actionResult = new ActionResult();
  4758. try
  4759. {
  4760. // 验证请求头信息
  4761. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4762. // 验证失败
  4763. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4764. {
  4765. return actionResult;
  4766. }
  4767. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4768. DateTime datetimeend = Convert.ToDateTime(dateend);
  4769. datetimebegin = datetimebegin.Date;
  4770. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4771. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4772. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4773. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4774. {
  4775. actionResult.Status = (int)Constant.PDAResult.Fail;
  4776. actionResult.Message = Messages.MSG_CMN_I002;
  4777. }
  4778. else
  4779. {
  4780. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4781. actionResult.Status = (int)Constant.PDAResult.Success;
  4782. }
  4783. }
  4784. catch (Exception ex)
  4785. {
  4786. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4787. OutputLog.TraceLog(LogPriority.Error,
  4788. this.ToString(),
  4789. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4790. ex.ToString(),
  4791. LocalPath.LogExePath);
  4792. actionResult.Status = (int)Constant.PDAResult.Exception;
  4793. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4794. }
  4795. return actionResult;
  4796. }
  4797. /// <summary>
  4798. /// 工号质量统计表
  4799. /// </summary>
  4800. /// <param name="accountCode"></param>
  4801. /// <param name="userCode"></param>
  4802. /// <param name="userPassword"></param>
  4803. /// <param name="sessionKey"></param>
  4804. /// <param name="se"></param>
  4805. /// <returns></returns>
  4806. public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4807. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4808. {
  4809. ActionResult actionResult = new ActionResult();
  4810. try
  4811. {
  4812. // 验证请求头信息
  4813. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4814. // 验证失败
  4815. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4816. {
  4817. return actionResult;
  4818. }
  4819. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4820. DateTime datetimeend = Convert.ToDateTime(dateend);
  4821. datetimebegin = datetimebegin.Date;
  4822. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4823. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4824. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4825. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4826. {
  4827. actionResult.Status = (int)Constant.PDAResult.Fail;
  4828. actionResult.Message = Messages.MSG_CMN_I002;
  4829. }
  4830. else
  4831. {
  4832. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4833. actionResult.Status = (int)Constant.PDAResult.Success;
  4834. }
  4835. }
  4836. catch (Exception ex)
  4837. {
  4838. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4839. OutputLog.TraceLog(LogPriority.Error,
  4840. this.ToString(),
  4841. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4842. ex.ToString(),
  4843. LocalPath.LogExePath);
  4844. actionResult.Status = (int)Constant.PDAResult.Exception;
  4845. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4846. }
  4847. return actionResult;
  4848. }
  4849. /// <summary>
  4850. /// 损坯数据统计表
  4851. /// </summary>
  4852. /// <param name="accountCode"></param>
  4853. /// <param name="userCode"></param>
  4854. /// <param name="userPassword"></param>
  4855. /// <param name="sessionKey"></param>
  4856. /// <param name="se"></param>
  4857. /// <returns></returns>
  4858. public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4859. string workcode, string datebegin, string dateend)
  4860. {
  4861. ActionResult actionResult = new ActionResult();
  4862. try
  4863. {
  4864. // 验证请求头信息
  4865. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4866. // 验证失败
  4867. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4868. {
  4869. return actionResult;
  4870. }
  4871. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4872. DateTime datetimeend = Convert.ToDateTime(dateend);
  4873. datetimebegin = datetimebegin.Date;
  4874. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4875. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4876. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4877. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4878. {
  4879. actionResult.Status = (int)Constant.PDAResult.Fail;
  4880. actionResult.Message = Messages.MSG_CMN_I002;
  4881. }
  4882. else
  4883. {
  4884. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4885. actionResult.Status = (int)Constant.PDAResult.Success;
  4886. }
  4887. }
  4888. catch (Exception ex)
  4889. {
  4890. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4891. OutputLog.TraceLog(LogPriority.Error,
  4892. this.ToString(),
  4893. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4894. ex.ToString(),
  4895. LocalPath.LogExePath);
  4896. actionResult.Status = (int)Constant.PDAResult.Exception;
  4897. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4898. }
  4899. return actionResult;
  4900. }
  4901. #endregion
  4902. /// <summary>
  4903. /// 取得报表数据源数据
  4904. /// </summary>
  4905. /// <param name="accountCode"></param>
  4906. /// <param name="userCode"></param>
  4907. /// <param name="userPassword"></param>
  4908. /// <param name="sessionKey"></param>
  4909. /// <returns></returns>
  4910. public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
  4911. {
  4912. ActionResult actionResult = new ActionResult();
  4913. try
  4914. {
  4915. // 验证请求头信息
  4916. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4917. // 验证失败
  4918. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4919. {
  4920. return actionResult;
  4921. }
  4922. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4923. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4924. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4925. {
  4926. actionResult.Status = (int)Constant.PDAResult.Fail;
  4927. actionResult.Message = Messages.MSG_CMN_I002;
  4928. }
  4929. else
  4930. {
  4931. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4932. actionResult.Status = (int)Constant.PDAResult.Success;
  4933. }
  4934. }
  4935. catch (Exception ex)
  4936. {
  4937. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4938. OutputLog.TraceLog(LogPriority.Error,
  4939. this.ToString(),
  4940. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4941. ex.ToString(),
  4942. LocalPath.LogExePath);
  4943. actionResult.Status = (int)Constant.PDAResult.Exception;
  4944. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4945. }
  4946. return actionResult;
  4947. }
  4948. /// <summary>
  4949. /// 取得报表的查询数据源统计工序数据
  4950. /// </summary>
  4951. /// <param name="accountCode"></param>
  4952. /// <param name="userCode"></param>
  4953. /// <param name="userPassword"></param>
  4954. /// <param name="sessionKey"></param>
  4955. /// <param name="RptProcedureID"></param>
  4956. /// <returns></returns>
  4957. public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  4958. {
  4959. ActionResult actionResult = new ActionResult();
  4960. try
  4961. {
  4962. // 验证请求头信息
  4963. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4964. // 验证失败
  4965. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4966. {
  4967. return actionResult;
  4968. }
  4969. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4970. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  4971. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4972. {
  4973. actionResult.Status = (int)Constant.PDAResult.Fail;
  4974. actionResult.Message = Messages.MSG_CMN_I002;
  4975. }
  4976. else
  4977. {
  4978. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4979. actionResult.Status = (int)Constant.PDAResult.Success;
  4980. }
  4981. }
  4982. catch (Exception ex)
  4983. {
  4984. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4985. OutputLog.TraceLog(LogPriority.Error,
  4986. this.ToString(),
  4987. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4988. ex.ToString(),
  4989. LocalPath.LogExePath);
  4990. actionResult.Status = (int)Constant.PDAResult.Exception;
  4991. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4992. }
  4993. return actionResult;
  4994. }
  4995. /// <summary>
  4996. /// 获取用户是否有统计产成品权限
  4997. /// </summary>
  4998. /// <param name="accountCode"></param>
  4999. /// <param name="userCode"></param>
  5000. /// <param name="userPassword"></param>
  5001. /// <param name="sessionKey"></param>
  5002. /// <returns></returns>
  5003. public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  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. int returnValue = ServiceInvoker.Invoke<int>(this,
  5016. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  5017. actionResult.Result = JsonHelper.ToJson(returnValue);
  5018. actionResult.Status = (int)Constant.PDAResult.Success;
  5019. }
  5020. catch (Exception ex)
  5021. {
  5022. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5023. OutputLog.TraceLog(LogPriority.Error,
  5024. this.ToString(),
  5025. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5026. ex.ToString(),
  5027. LocalPath.LogExePath);
  5028. actionResult.Status = (int)Constant.PDAResult.Exception;
  5029. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5030. }
  5031. return actionResult;
  5032. }
  5033. /// <summary>
  5034. /// 获取用户是否有盘点权限
  5035. /// </summary>
  5036. /// <param name="accountCode"></param>
  5037. /// <param name="userCode"></param>
  5038. /// <param name="userPassword"></param>
  5039. /// <param name="sessionKey"></param>
  5040. /// <returns></returns>
  5041. public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5042. {
  5043. ActionResult actionResult = new ActionResult();
  5044. try
  5045. {
  5046. // 验证请求头信息
  5047. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5048. // 验证失败
  5049. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5050. {
  5051. return actionResult;
  5052. }
  5053. int returnValue = ServiceInvoker.Invoke<int>(this,
  5054. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  5055. actionResult.Result = JsonHelper.ToJson(returnValue);
  5056. actionResult.Status = (int)Constant.PDAResult.Success;
  5057. }
  5058. catch (Exception ex)
  5059. {
  5060. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5061. OutputLog.TraceLog(LogPriority.Error,
  5062. this.ToString(),
  5063. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5064. ex.ToString(),
  5065. LocalPath.LogExePath);
  5066. actionResult.Status = (int)Constant.PDAResult.Exception;
  5067. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5068. }
  5069. return actionResult;
  5070. }
  5071. /// <summary>
  5072. /// 根据条件查询是否存在班次配置
  5073. /// </summary>
  5074. /// <param name="accountCode"></param>
  5075. /// <param name="userCode"></param>
  5076. /// <param name="userPassword"></param>
  5077. /// <param name="sessionKey"></param>
  5078. /// <param name="userCode">工号编码</param>
  5079. /// <returns></returns>
  5080. public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  5081. {
  5082. ActionResult actionResult = new ActionResult();
  5083. try
  5084. {
  5085. // 验证请求头信息
  5086. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5087. // 验证失败
  5088. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5089. {
  5090. return actionResult;
  5091. }
  5092. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5093. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  5094. actionResult.Result = JsonHelper.ToJson(ds);
  5095. actionResult.Status = (int)Constant.PDAResult.Success;
  5096. }
  5097. catch (Exception ex)
  5098. {
  5099. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5100. OutputLog.TraceLog(LogPriority.Error,
  5101. this.ToString(),
  5102. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5103. ex.ToString(),
  5104. LocalPath.LogExePath);
  5105. actionResult.Status = (int)Constant.PDAResult.Exception;
  5106. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5107. }
  5108. return actionResult;
  5109. }
  5110. /// <summary>
  5111. /// 报损工序查出工号根据生产数据ID
  5112. /// </summary>
  5113. /// <param name="accountCode"></param>
  5114. /// <param name="userCode"></param>
  5115. /// <param name="userPassword"></param>
  5116. /// <param name="sessionKey"></param>
  5117. /// <param name="ProductionDataID">生产数据ID</param>
  5118. /// <returns></returns>
  5119. public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  5120. {
  5121. ActionResult actionResult = new ActionResult();
  5122. try
  5123. {
  5124. // 验证请求头信息
  5125. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5126. // 验证失败
  5127. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5128. {
  5129. return actionResult;
  5130. }
  5131. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5132. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  5133. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5134. {
  5135. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5136. actionResult.Status = (int)Constant.PDAResult.Success;
  5137. }
  5138. else
  5139. {
  5140. actionResult.Status = (int)Constant.PDAResult.Fail;
  5141. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5142. }
  5143. }
  5144. catch (Exception ex)
  5145. {
  5146. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5147. OutputLog.TraceLog(LogPriority.Error,
  5148. this.ToString(),
  5149. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5150. ex.ToString(),
  5151. LocalPath.LogExePath);
  5152. actionResult.Status = (int)Constant.PDAResult.Exception;
  5153. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5154. }
  5155. return actionResult;
  5156. }
  5157. /// <summary>
  5158. /// 在入窑工序检验窑车号是否存在
  5159. /// </summary>
  5160. /// <param name="accountCode"></param>
  5161. /// <param name="userCode"></param>
  5162. /// <param name="userPassword"></param>
  5163. /// <param name="sessionKey"></param>
  5164. /// <param name="kilncarcode">窑车编码</param>
  5165. /// <param name="procedureid">工序ID</param>
  5166. /// <returns></returns>
  5167. public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  5168. {
  5169. ActionResult actionResult = new ActionResult();
  5170. try
  5171. {
  5172. // 验证请求头信息
  5173. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5174. // 验证失败
  5175. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5176. {
  5177. return actionResult;
  5178. }
  5179. int returnValue = ServiceInvoker.Invoke<int>(this,
  5180. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  5181. if (returnValue == 1)
  5182. {
  5183. actionResult.Result = JsonHelper.ToJson(returnValue);
  5184. actionResult.Status = (int)Constant.PDAResult.Success;
  5185. }
  5186. else
  5187. {
  5188. actionResult.Status = (int)Constant.PDAResult.Fail;
  5189. if (returnValue == -99)
  5190. actionResult.Message = "窑炉车号无效";
  5191. else if (returnValue == -98)
  5192. actionResult.Message = "窑车己无产品";
  5193. else if (returnValue == -97)
  5194. actionResult.Message = "窑车没有入窑,不可以撤销";
  5195. else if (returnValue == -1)
  5196. actionResult.Message = "保存失败";
  5197. }
  5198. }
  5199. catch (Exception ex)
  5200. {
  5201. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5202. OutputLog.TraceLog(LogPriority.Error,
  5203. this.ToString(),
  5204. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5205. ex.ToString(),
  5206. LocalPath.LogExePath);
  5207. actionResult.Status = (int)Constant.PDAResult.Exception;
  5208. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5209. }
  5210. return actionResult;
  5211. }
  5212. /// <summary>
  5213. /// 撤销包装
  5214. /// </summary>
  5215. /// <param name="accountCode"></param>
  5216. /// <param name="userCode"></param>
  5217. /// <param name="userPassword"></param>
  5218. /// <param name="sessionKey"></param>
  5219. /// <param name="barcode"></param>
  5220. /// <returns></returns>
  5221. public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5222. {
  5223. ActionResult actionResult = new ActionResult();
  5224. try
  5225. {
  5226. // 验证请求头信息
  5227. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5228. // 验证失败
  5229. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5230. {
  5231. return actionResult;
  5232. }
  5233. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5234. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  5235. if (Convert.ToInt32(returnValue.Result) > 0)
  5236. {
  5237. actionResult.Result = JsonHelper.ToJson(returnValue);
  5238. actionResult.Status = (int)Constant.PDAResult.Success;
  5239. }
  5240. else
  5241. {
  5242. actionResult.Status = (int)Constant.PDAResult.Fail;
  5243. if (Convert.ToInt32(returnValue.Result) == -1)
  5244. actionResult.Message = "产品条码不存在包装记录";
  5245. else if (Convert.ToInt32(returnValue.Result) == -200)
  5246. actionResult.Message = returnValue.Message;
  5247. else
  5248. actionResult.Message = "成品撤销失败";
  5249. }
  5250. }
  5251. catch (Exception ex)
  5252. {
  5253. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5254. OutputLog.TraceLog(LogPriority.Error,
  5255. this.ToString(),
  5256. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5257. ex.ToString(),
  5258. LocalPath.LogExePath);
  5259. actionResult.Status = (int)Constant.PDAResult.Exception;
  5260. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5261. }
  5262. return actionResult;
  5263. }
  5264. /*
  5265. /// <summary>
  5266. /// 获取用户是否有撤销包装权限
  5267. /// </summary>
  5268. /// <param name="accountCode"></param>
  5269. /// <param name="userCode"></param>
  5270. /// <param name="userPassword"></param>
  5271. /// <param name="sessionKey"></param>
  5272. /// <returns></returns>
  5273. public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5274. {
  5275. ActionResult actionResult = new ActionResult();
  5276. try
  5277. {
  5278. // 验证请求头信息
  5279. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5280. // 验证失败
  5281. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5282. {
  5283. return actionResult;
  5284. }
  5285. int returnValue = ServiceInvoker.Invoke<int>(this,
  5286. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5287. actionResult.Result = JsonHelper.ToJson(returnValue);
  5288. actionResult.Status = (int)Constant.PDAResult.Success;
  5289. }
  5290. catch (Exception ex)
  5291. {
  5292. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5293. OutputLog.TraceLog(LogPriority.Error,
  5294. this.ToString(),
  5295. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5296. ex.ToString(),
  5297. LocalPath.LogExePath);
  5298. actionResult.Status = (int)Constant.PDAResult.Exception;
  5299. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5300. }
  5301. return actionResult;
  5302. }
  5303. */
  5304. /// <summary>
  5305. /// 窑车状态明细表查询
  5306. /// </summary>
  5307. /// <param name="accountCode"></param>
  5308. /// <param name="userCode"></param>
  5309. /// <param name="userPassword"></param>
  5310. /// <param name="sessionKey"></param>
  5311. /// <param name="kilnCarCode"></param>
  5312. /// <returns></returns>
  5313. public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5314. {
  5315. ActionResult actionResult = new ActionResult();
  5316. try
  5317. {
  5318. // 验证请求头信息
  5319. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5320. // 验证失败
  5321. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5322. {
  5323. return actionResult;
  5324. }
  5325. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5326. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5327. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5328. {
  5329. actionResult.Status = (int)Constant.PDAResult.Fail;
  5330. actionResult.Message = Messages.MSG_CMN_I002;
  5331. }
  5332. else
  5333. {
  5334. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5335. actionResult.Status = (int)Constant.PDAResult.Success;
  5336. }
  5337. }
  5338. catch (Exception ex)
  5339. {
  5340. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5341. OutputLog.TraceLog(LogPriority.Error,
  5342. this.ToString(),
  5343. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5344. ex.ToString(),
  5345. LocalPath.LogExePath);
  5346. actionResult.Status = (int)Constant.PDAResult.Exception;
  5347. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5348. }
  5349. return actionResult;
  5350. }
  5351. /// <summary>
  5352. /// 损坯撤销
  5353. /// </summary>
  5354. /// <param name="accountCode"></param>
  5355. /// <param name="userCode"></param>
  5356. /// <param name="userPassword"></param>
  5357. /// <param name="sessionKey"></param>
  5358. /// <param name="barcode"></param>
  5359. /// <returns></returns>
  5360. public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5361. {
  5362. ActionResult actionResult = new ActionResult();
  5363. try
  5364. {
  5365. // 验证请求头信息
  5366. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5367. // 验证失败
  5368. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5369. {
  5370. return actionResult;
  5371. }
  5372. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5373. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5374. if (Convert.ToInt32(returnValue.Result) > 0)
  5375. {
  5376. actionResult.Result = JsonHelper.ToJson(returnValue);
  5377. actionResult.Status = (int)Constant.PDAResult.Success;
  5378. }
  5379. else
  5380. {
  5381. actionResult.Status = (int)Constant.PDAResult.Fail;
  5382. if (Convert.ToInt32(returnValue.Result) == -1)
  5383. actionResult.Message = "此产品没有损坯,不能撤销";
  5384. else if (Convert.ToInt32(returnValue.Result) == -200)
  5385. actionResult.Message = returnValue.Message;
  5386. else
  5387. actionResult.Message = "损坯撤销失败";
  5388. }
  5389. }
  5390. catch (Exception ex)
  5391. {
  5392. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5393. OutputLog.TraceLog(LogPriority.Error,
  5394. this.ToString(),
  5395. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5396. ex.ToString(),
  5397. LocalPath.LogExePath);
  5398. actionResult.Status = (int)Constant.PDAResult.Exception;
  5399. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5400. }
  5401. return actionResult;
  5402. }
  5403. /*
  5404. /// <summary>
  5405. /// 获取用户是否有损坯撤销权限
  5406. /// </summary>
  5407. /// <param name="accountCode"></param>
  5408. /// <param name="userCode"></param>
  5409. /// <param name="userPassword"></param>
  5410. /// <param name="sessionKey"></param>
  5411. /// <returns></returns>
  5412. public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5413. {
  5414. ActionResult actionResult = new ActionResult();
  5415. try
  5416. {
  5417. // 验证请求头信息
  5418. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5419. // 验证失败
  5420. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5421. {
  5422. return actionResult;
  5423. }
  5424. int returnValue = ServiceInvoker.Invoke<int>(this,
  5425. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5426. actionResult.Result = JsonHelper.ToJson(returnValue);
  5427. actionResult.Status = (int)Constant.PDAResult.Success;
  5428. }
  5429. catch (Exception ex)
  5430. {
  5431. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5432. OutputLog.TraceLog(LogPriority.Error,
  5433. this.ToString(),
  5434. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5435. ex.ToString(),
  5436. LocalPath.LogExePath);
  5437. actionResult.Status = (int)Constant.PDAResult.Exception;
  5438. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5439. }
  5440. return actionResult;
  5441. }
  5442. */
  5443. /// <summary>
  5444. /// 获取条码注浆信息
  5445. /// </summary>
  5446. /// <param name="accountCode"></param>
  5447. /// <param name="userCode"></param>
  5448. /// <param name="userPassword"></param>
  5449. /// <param name="sessionKey"></param>
  5450. /// <returns></returns>
  5451. public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5452. {
  5453. ActionResult actionResult = new ActionResult();
  5454. try
  5455. {
  5456. // 验证请求头信息
  5457. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5458. // 验证失败
  5459. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5460. {
  5461. return actionResult;
  5462. }
  5463. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5464. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5465. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5466. {
  5467. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5468. actionResult.Status = (int)Constant.PDAResult.Success;
  5469. }
  5470. else
  5471. {
  5472. actionResult.Status = (int)Constant.PDAResult.Fail;
  5473. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5474. }
  5475. }
  5476. catch (Exception ex)
  5477. {
  5478. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5479. OutputLog.TraceLog(LogPriority.Error,
  5480. this.ToString(),
  5481. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5482. ex.ToString(),
  5483. LocalPath.LogExePath);
  5484. actionResult.Status = (int)Constant.PDAResult.Exception;
  5485. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5486. }
  5487. return actionResult;
  5488. }
  5489. /// <summary>
  5490. /// 获取条码注浆信息
  5491. /// </summary>
  5492. /// <param name="accountCode"></param>
  5493. /// <param name="userCode"></param>
  5494. /// <param name="userPassword"></param>
  5495. /// <param name="sessionKey"></param>
  5496. /// <returns></returns>
  5497. public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5498. {
  5499. ActionResult actionResult = new ActionResult();
  5500. try
  5501. {
  5502. // 验证请求头信息
  5503. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5504. // 验证失败
  5505. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5506. {
  5507. return actionResult;
  5508. }
  5509. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5510. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5511. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5512. {
  5513. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5514. actionResult.Status = (int)Constant.PDAResult.Success;
  5515. }
  5516. else
  5517. {
  5518. actionResult.Status = (int)Constant.PDAResult.Fail;
  5519. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5520. }
  5521. }
  5522. catch (Exception ex)
  5523. {
  5524. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5525. OutputLog.TraceLog(LogPriority.Error,
  5526. this.ToString(),
  5527. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5528. ex.ToString(),
  5529. LocalPath.LogExePath);
  5530. actionResult.Status = (int)Constant.PDAResult.Exception;
  5531. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5532. }
  5533. return actionResult;
  5534. }
  5535. /// <summary>
  5536. /// 公坯设定
  5537. /// </summary>
  5538. /// <param name="accountCode"></param>
  5539. /// <param name="userCode"></param>
  5540. /// <param name="userPassword"></param>
  5541. /// <param name="sessionKey"></param>
  5542. /// <param name="barcode"></param>
  5543. /// <returns></returns>
  5544. public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5545. {
  5546. ActionResult actionResult = new ActionResult();
  5547. try
  5548. {
  5549. // 验证请求头信息
  5550. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5551. // 验证失败
  5552. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5553. {
  5554. return actionResult;
  5555. }
  5556. int returnValue = ServiceInvoker.Invoke<int>(this,
  5557. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5558. if (returnValue > 0)
  5559. {
  5560. actionResult.Result = JsonHelper.ToJson(returnValue);
  5561. actionResult.Status = (int)Constant.PDAResult.Success;
  5562. }
  5563. else
  5564. {
  5565. actionResult.Status = (int)Constant.PDAResult.Fail;
  5566. if (returnValue == -1)
  5567. actionResult.Message = "此产品不在生产线上";
  5568. else if (returnValue == -2)
  5569. actionResult.Message = "该产品已经标识为公坯";
  5570. else
  5571. actionResult.Message = "公坯设定失败";
  5572. }
  5573. }
  5574. catch (Exception ex)
  5575. {
  5576. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5577. OutputLog.TraceLog(LogPriority.Error,
  5578. this.ToString(),
  5579. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5580. ex.ToString(),
  5581. LocalPath.LogExePath);
  5582. actionResult.Status = (int)Constant.PDAResult.Exception;
  5583. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5584. }
  5585. return actionResult;
  5586. }
  5587. /*
  5588. /// <summary>
  5589. /// 获取用户是否有公坯设定
  5590. /// </summary>
  5591. /// <param name="accountCode"></param>
  5592. /// <param name="userCode"></param>
  5593. /// <param name="userPassword"></param>
  5594. /// <param name="sessionKey"></param>
  5595. /// <returns></returns>
  5596. public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5597. {
  5598. ActionResult actionResult = new ActionResult();
  5599. try
  5600. {
  5601. // 验证请求头信息
  5602. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5603. // 验证失败
  5604. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5605. {
  5606. return actionResult;
  5607. }
  5608. int returnValue = ServiceInvoker.Invoke<int>(this,
  5609. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5610. actionResult.Result = JsonHelper.ToJson(returnValue);
  5611. actionResult.Status = (int)Constant.PDAResult.Success;
  5612. }
  5613. catch (Exception ex)
  5614. {
  5615. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5616. OutputLog.TraceLog(LogPriority.Error,
  5617. this.ToString(),
  5618. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5619. ex.ToString(),
  5620. LocalPath.LogExePath);
  5621. actionResult.Status = (int)Constant.PDAResult.Exception;
  5622. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5623. }
  5624. return actionResult;
  5625. }
  5626. */
  5627. /// <summary>
  5628. /// 校验产品条码是否可以走到该工序
  5629. /// </summary>
  5630. /// <param name="accountCode">帐套code</param>
  5631. /// <param name="userCode">用户code</param>
  5632. /// <param name="userPassword">用户密码</param>
  5633. /// <param name="sessionKey">本次登陆密钥</param>
  5634. /// <param name="procedureID">工序ID</param>
  5635. /// <param name="barcode">条码</param>
  5636. /// <returns></returns>
  5637. /// <remarks>
  5638. /// 陈冰 2014.09.18 新建
  5639. /// </remarks>
  5640. public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5641. {
  5642. ActionResult actionResult = new ActionResult();
  5643. try
  5644. {
  5645. // 验证请求头信息
  5646. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5647. // 验证失败
  5648. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5649. {
  5650. return actionResult;
  5651. }
  5652. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5653. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5654. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5655. {
  5656. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5657. actionResult.Status = (int)Constant.PDAResult.Success;
  5658. }
  5659. else
  5660. {
  5661. actionResult.Status = (int)Constant.PDAResult.Fail;
  5662. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5663. }
  5664. }
  5665. catch (Exception ex)
  5666. {
  5667. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5668. OutputLog.TraceLog(LogPriority.Error,
  5669. this.ToString(),
  5670. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5671. ex.ToString(),
  5672. LocalPath.LogExePath);
  5673. actionResult.Status = (int)Constant.PDAResult.Exception;
  5674. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5675. }
  5676. return actionResult;
  5677. }
  5678. /// <summary>
  5679. /// 获取用户所有菜单权限
  5680. /// </summary>
  5681. /// <param name="accountCode"></param>
  5682. /// <param name="userCode"></param>
  5683. /// <param name="userPassword"></param>
  5684. /// <param name="sessionKey"></param>
  5685. /// <returns></returns>
  5686. public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
  5687. {
  5688. ActionResult actionResult = new ActionResult();
  5689. try
  5690. {
  5691. // 验证请求头信息
  5692. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5693. // 验证失败
  5694. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5695. {
  5696. return actionResult;
  5697. }
  5698. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5699. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5700. actionResult.Result = JsonHelper.ToJson(returnValue);
  5701. actionResult.Status = (int)Constant.PDAResult.Success;
  5702. }
  5703. catch (Exception ex)
  5704. {
  5705. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5706. OutputLog.TraceLog(LogPriority.Error,
  5707. this.ToString(),
  5708. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5709. ex.ToString(),
  5710. LocalPath.LogExePath);
  5711. actionResult.Status = (int)Constant.PDAResult.Exception;
  5712. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5713. }
  5714. return actionResult;
  5715. }
  5716. public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5717. {
  5718. ActionResult actionResult = new ActionResult();
  5719. try
  5720. {
  5721. // 验证请求头信息
  5722. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5723. // 验证失败
  5724. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5725. {
  5726. return actionResult;
  5727. }
  5728. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5729. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5730. if (Convert.ToInt32(returnValue.Result) > 0)
  5731. {
  5732. actionResult.Result = JsonHelper.ToJson(returnValue);
  5733. actionResult.Status = (int)Constant.PDAResult.Success;
  5734. }
  5735. else
  5736. {
  5737. actionResult.Status = (int)Constant.PDAResult.Fail;
  5738. if (Convert.ToInt32(returnValue.Result) == -1)
  5739. actionResult.Message = "无效条码";
  5740. else if (Convert.ToInt32(returnValue.Result) == -2)
  5741. actionResult.Message = "已经生产完成";
  5742. else if (Convert.ToInt32(returnValue.Result) == -3)
  5743. actionResult.Message = "条码已经申请报废";
  5744. else if (Convert.ToInt32(returnValue.Result) == -4)
  5745. actionResult.Message = "此条码当前工序不允许进行撤销";
  5746. else if (Convert.ToInt32(returnValue.Result) == -5)
  5747. actionResult.Message = "此条码没有生产数据";
  5748. else if (Convert.ToInt32(returnValue.Result) == -6)
  5749. actionResult.Message = "没有当前工序权限";
  5750. else if (Convert.ToInt32(returnValue.Result) == -7)
  5751. actionResult.Message = "条码不在生产线上";
  5752. else if (Convert.ToInt32(returnValue.Result) == -8)
  5753. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5754. else if (Convert.ToInt32(returnValue.Result) == -9)
  5755. actionResult.Message = "条码已经是返工状态";
  5756. else if (Convert.ToInt32(returnValue.Result) == -200)
  5757. actionResult.Message = returnValue.Message;
  5758. }
  5759. }
  5760. catch (Exception ex)
  5761. {
  5762. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5763. OutputLog.TraceLog(LogPriority.Error,
  5764. this.ToString(),
  5765. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5766. ex.ToString(),
  5767. LocalPath.LogExePath);
  5768. actionResult.Status = (int)Constant.PDAResult.Exception;
  5769. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5770. }
  5771. return actionResult;
  5772. }
  5773. public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5774. {
  5775. ActionResult actionResult = new ActionResult();
  5776. try
  5777. {
  5778. // 验证请求头信息
  5779. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5780. // 验证失败
  5781. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5782. {
  5783. return actionResult;
  5784. }
  5785. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5786. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5787. if (Convert.ToInt32(returnValue.Result) > 0)
  5788. {
  5789. actionResult.Result = JsonHelper.ToJson(returnValue);
  5790. actionResult.Status = (int)Constant.PDAResult.Success;
  5791. }
  5792. else
  5793. {
  5794. actionResult.Status = (int)Constant.PDAResult.Fail;
  5795. if (Convert.ToInt32(returnValue.Result) == -1)
  5796. actionResult.Message = "无效条码";
  5797. else if (Convert.ToInt32(returnValue.Result) == -2)
  5798. actionResult.Message = "已经生产完成";
  5799. else if (Convert.ToInt32(returnValue.Result) == -3)
  5800. actionResult.Message = "条码已经申请报废";
  5801. else if (Convert.ToInt32(returnValue.Result) == -4)
  5802. actionResult.Message = "此条码当前工序不允许进行撤销";
  5803. else if (Convert.ToInt32(returnValue.Result) == -5)
  5804. actionResult.Message = "此条码没有生产数据";
  5805. else if (Convert.ToInt32(returnValue.Result) == -55)
  5806. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5807. else if (Convert.ToInt32(returnValue.Result) == -6)
  5808. actionResult.Message = "没有任何影响行";
  5809. else if (Convert.ToInt32(returnValue.Result) == -7)
  5810. actionResult.Message = "条码不在生产线上";
  5811. else if (Convert.ToInt32(returnValue.Result) == -8)
  5812. actionResult.Message = "条码已经是返工状态";
  5813. else if (Convert.ToInt32(returnValue.Result) == -200)
  5814. actionResult.Message = returnValue.Message;
  5815. }
  5816. }
  5817. catch (Exception ex)
  5818. {
  5819. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5820. OutputLog.TraceLog(LogPriority.Error,
  5821. this.ToString(),
  5822. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5823. ex.ToString(),
  5824. LocalPath.LogExePath);
  5825. actionResult.Status = (int)Constant.PDAResult.Exception;
  5826. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5827. }
  5828. return actionResult;
  5829. }
  5830. public ActionResult GetAllLogoInfo(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. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5844. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5845. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5846. {
  5847. //DataView dv = returnValue.Tables[0].DefaultView;
  5848. //dv.RowFilter = "ValueFlag=1";
  5849. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5850. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5851. actionResult.Status = (int)Constant.PDAResult.Success;
  5852. }
  5853. }
  5854. catch (Exception ex)
  5855. {
  5856. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5857. OutputLog.TraceLog(LogPriority.Error,
  5858. this.ToString(),
  5859. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5860. ex.ToString(),
  5861. LocalPath.LogExePath);
  5862. actionResult.Status = (int)Constant.PDAResult.Exception;
  5863. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5864. }
  5865. return actionResult;
  5866. }
  5867. /// <summary>
  5868. /// 变更产品商标用
  5869. /// </summary>
  5870. /// <param name="accountCode"></param>
  5871. /// <param name="userCode"></param>
  5872. /// <param name="userPassword"></param>
  5873. /// <param name="sessionKey"></param>
  5874. /// <param name="goodsid"></param>
  5875. /// <returns></returns>
  5876. public ActionResult GetLogoInfoForChange(string accountCode, string userCode, string userPassword, string sessionKey
  5877. , int goodsid)
  5878. {
  5879. ActionResult actionResult = new ActionResult();
  5880. try
  5881. {
  5882. // 验证请求头信息
  5883. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5884. // 验证失败
  5885. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5886. {
  5887. return actionResult;
  5888. }
  5889. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5890. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5891. //() => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5892. () => SystemModuleLogic.GetLogoInfoForChange(sUserInfo, goodsid));
  5893. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5894. {
  5895. //DataView dv = returnValue.Tables[0].DefaultView;
  5896. //dv.RowFilter = "ValueFlag=1";
  5897. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5898. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5899. actionResult.Status = (int)Constant.PDAResult.Success;
  5900. }
  5901. }
  5902. catch (Exception ex)
  5903. {
  5904. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5905. OutputLog.TraceLog(LogPriority.Error,
  5906. this.ToString(),
  5907. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5908. ex.ToString(),
  5909. LocalPath.LogExePath);
  5910. actionResult.Status = (int)Constant.PDAResult.Exception;
  5911. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5912. }
  5913. return actionResult;
  5914. }
  5915. public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5916. {
  5917. ActionResult actionResult = new ActionResult();
  5918. try
  5919. {
  5920. // 验证请求头信息
  5921. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5922. // 验证失败
  5923. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5924. {
  5925. return actionResult;
  5926. }
  5927. int returnValue = ServiceInvoker.Invoke<int>(this,
  5928. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5929. actionResult.Result = JsonHelper.ToJson(returnValue);
  5930. actionResult.Status = (int)Constant.PDAResult.Success;
  5931. }
  5932. catch (Exception ex)
  5933. {
  5934. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5935. OutputLog.TraceLog(LogPriority.Error,
  5936. this.ToString(),
  5937. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5938. ex.ToString(),
  5939. LocalPath.LogExePath);
  5940. actionResult.Status = (int)Constant.PDAResult.Exception;
  5941. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5942. }
  5943. return actionResult;
  5944. }
  5945. public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  5946. {
  5947. ActionResult actionResult = new ActionResult();
  5948. try
  5949. {
  5950. // 验证请求头信息
  5951. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5952. // 验证失败
  5953. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5954. {
  5955. return actionResult;
  5956. }
  5957. string returnMessage = "";
  5958. int returnValue = ServiceInvoker.Invoke<int>(this,
  5959. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo, out returnMessage));
  5960. actionResult.Result = JsonHelper.ToJson(returnValue);
  5961. if (returnValue > 0)
  5962. {
  5963. actionResult.Status = (int)Constant.PDAResult.Success;
  5964. }
  5965. else if (returnValue == -2)
  5966. {
  5967. //lsq 20210723 已注浆非产成品没有商标可以变更商标
  5968. //begin
  5969. //actionResult.Message = "条码不存在";
  5970. actionResult.Message = "该条码未注浆";
  5971. //end
  5972. actionResult.Status = (int)Constant.PDAResult.Fail;
  5973. }
  5974. else if (returnValue == -3)
  5975. {
  5976. actionResult.Message = "已交接的产品不能变更商标";
  5977. actionResult.Status = (int)Constant.PDAResult.Fail;
  5978. }
  5979. else if (returnValue == -5)
  5980. {
  5981. actionResult.Message = "该商标已超过生产计划允许变更数量,不能变更商标";
  5982. actionResult.Status = (int)Constant.PDAResult.Fail;
  5983. }
  5984. else
  5985. {
  5986. actionResult.Message = returnMessage;
  5987. actionResult.Status = (int)Constant.PDAResult.Fail;
  5988. }
  5989. }
  5990. catch (Exception ex)
  5991. {
  5992. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5993. OutputLog.TraceLog(LogPriority.Error,
  5994. this.ToString(),
  5995. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5996. ex.ToString(),
  5997. LocalPath.LogExePath);
  5998. actionResult.Status = (int)Constant.PDAResult.Exception;
  5999. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6000. }
  6001. return actionResult;
  6002. }
  6003. public ActionResult SaveBarCodeLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  6004. string barcode, int logoid, int glazetypeid)
  6005. {
  6006. ActionResult actionResult = new ActionResult();
  6007. try
  6008. {
  6009. // 验证请求头信息
  6010. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6011. // 验证失败
  6012. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6013. {
  6014. return actionResult;
  6015. }
  6016. string returnMessage = "";
  6017. int returnValue = ServiceInvoker.Invoke<int>(this,
  6018. () => PMModuleLogicDAL.SaveBarCodeLogoAndGlazetype(barcode, logoid, glazetypeid, sUserInfo, out returnMessage));
  6019. actionResult.Result = JsonHelper.ToJson(returnValue);
  6020. if (returnValue > 0)
  6021. {
  6022. actionResult.Status = (int)Constant.PDAResult.Success;
  6023. }
  6024. else
  6025. {
  6026. actionResult.Status = (int)Constant.PDAResult.Fail;
  6027. actionResult.Message = returnMessage;
  6028. }
  6029. }
  6030. catch (Exception ex)
  6031. {
  6032. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6033. OutputLog.TraceLog(LogPriority.Error,
  6034. this.ToString(),
  6035. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6036. ex.ToString(),
  6037. LocalPath.LogExePath);
  6038. actionResult.Status = (int)Constant.PDAResult.Exception;
  6039. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6040. }
  6041. return actionResult;
  6042. }
  6043. public ActionResult SaveBarCodesLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  6044. string barcodes, int logoid, int glazetypeid, int procedureID)
  6045. {
  6046. ActionResult actionResult = new ActionResult();
  6047. try
  6048. {
  6049. // 验证请求头信息
  6050. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6051. // 验证失败
  6052. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6053. {
  6054. return actionResult;
  6055. }
  6056. string returnMessage = "";
  6057. int returnValue = ServiceInvoker.Invoke<int>(this,
  6058. () => PMModuleLogicDAL.SaveBarCodesLogoAndGlazetype(barcodes, logoid, glazetypeid, procedureID, sUserInfo, out returnMessage));
  6059. actionResult.Result = JsonHelper.ToJson(returnValue);
  6060. if (returnValue > 0)
  6061. {
  6062. actionResult.Status = (int)Constant.PDAResult.Success;
  6063. }
  6064. else
  6065. {
  6066. actionResult.Status = (int)Constant.PDAResult.Fail;
  6067. actionResult.Message = returnMessage;
  6068. }
  6069. }
  6070. catch (Exception ex)
  6071. {
  6072. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6073. OutputLog.TraceLog(LogPriority.Error,
  6074. this.ToString(),
  6075. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6076. ex.ToString(),
  6077. LocalPath.LogExePath);
  6078. actionResult.Status = (int)Constant.PDAResult.Exception;
  6079. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6080. }
  6081. return actionResult;
  6082. }
  6083. public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6084. {
  6085. ActionResult actionResult = new ActionResult();
  6086. try
  6087. {
  6088. // 验证请求头信息
  6089. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6090. // 验证失败
  6091. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6092. {
  6093. return actionResult;
  6094. }
  6095. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  6096. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  6097. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  6098. {
  6099. string err_msg = returnValue.Tables[0].Rows[0]["err_msg"] + "";
  6100. if (!string.IsNullOrWhiteSpace(err_msg))
  6101. {
  6102. actionResult.Status = (int)Constant.PDAResult.Fail;
  6103. actionResult.Message = err_msg;
  6104. }
  6105. else
  6106. {
  6107. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  6108. actionResult.Status = (int)Constant.PDAResult.Success;
  6109. }
  6110. }
  6111. else
  6112. {
  6113. actionResult.Status = (int)Constant.PDAResult.Fail;
  6114. }
  6115. }
  6116. catch (Exception ex)
  6117. {
  6118. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6119. OutputLog.TraceLog(LogPriority.Error,
  6120. this.ToString(),
  6121. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6122. ex.ToString(),
  6123. LocalPath.LogExePath);
  6124. actionResult.Status = (int)Constant.PDAResult.Exception;
  6125. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6126. }
  6127. return actionResult;
  6128. }
  6129. /// <summary>
  6130. /// 半检时,入窑前检验获取此条码是否报损为废品
  6131. /// </summary>
  6132. /// <param name="accountCode"></param>
  6133. /// <param name="userCode"></param>
  6134. /// <param name="userPassword"></param>
  6135. /// <param name="sessionKey"></param>
  6136. /// <param name="barcode">产品条码</param>
  6137. /// <returns></returns>
  6138. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6139. {
  6140. ActionResult actionResult = new ActionResult();
  6141. try
  6142. {
  6143. // 验证请求头信息
  6144. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6145. // 验证失败
  6146. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6147. {
  6148. return actionResult;
  6149. }
  6150. int returnValue = ServiceInvoker.Invoke<int>(this,
  6151. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  6152. if (returnValue != -100)
  6153. {
  6154. actionResult.Result = JsonHelper.ToJson(returnValue);
  6155. actionResult.Status = (int)Constant.PDAResult.Success;
  6156. }
  6157. else
  6158. {
  6159. actionResult.Status = (int)Constant.PDAResult.Fail;
  6160. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  6161. }
  6162. }
  6163. catch (Exception ex)
  6164. {
  6165. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6166. OutputLog.TraceLog(LogPriority.Error,
  6167. this.ToString(),
  6168. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6169. ex.ToString(),
  6170. LocalPath.LogExePath);
  6171. actionResult.Status = (int)Constant.PDAResult.Exception;
  6172. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6173. }
  6174. return actionResult;
  6175. }
  6176. /// <summary>
  6177. /// 获取登陆帐户有无入窑前检验数据编辑权限
  6178. /// </summary>
  6179. /// <param name="accountCode"></param>
  6180. /// <param name="userCode"></param>
  6181. /// <param name="userPassword"></param>
  6182. /// <param name="sessionKey"></param>
  6183. /// <param name="usercode">工号编码</param>
  6184. /// <returns></returns>
  6185. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6186. {
  6187. ActionResult actionResult = new ActionResult();
  6188. try
  6189. {
  6190. // 验证请求头信息
  6191. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6192. // 验证失败
  6193. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6194. {
  6195. return actionResult;
  6196. }
  6197. int returnValue = ServiceInvoker.Invoke<int>(this,
  6198. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  6199. actionResult.Result = JsonHelper.ToJson(returnValue);
  6200. actionResult.Status = (int)Constant.PDAResult.Success;
  6201. }
  6202. catch (Exception ex)
  6203. {
  6204. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6205. OutputLog.TraceLog(LogPriority.Error,
  6206. this.ToString(),
  6207. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6208. ex.ToString(),
  6209. LocalPath.LogExePath);
  6210. actionResult.Status = (int)Constant.PDAResult.Exception;
  6211. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6212. }
  6213. return actionResult;
  6214. }
  6215. /// <summary>
  6216. /// 获取登陆帐户有无半检验数据编辑权限
  6217. /// </summary>
  6218. /// <param name="accountCode"></param>
  6219. /// <param name="userCode"></param>
  6220. /// <param name="userPassword"></param>
  6221. /// <param name="sessionKey"></param>
  6222. /// <param name="usercode">工号编码</param>
  6223. /// <returns></returns>
  6224. public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6225. {
  6226. ActionResult actionResult = new ActionResult();
  6227. try
  6228. {
  6229. // 验证请求头信息
  6230. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6231. // 验证失败
  6232. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6233. {
  6234. return actionResult;
  6235. }
  6236. int returnValue = ServiceInvoker.Invoke<int>(this,
  6237. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  6238. actionResult.Result = JsonHelper.ToJson(returnValue);
  6239. actionResult.Status = (int)Constant.PDAResult.Success;
  6240. }
  6241. catch (Exception ex)
  6242. {
  6243. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6244. OutputLog.TraceLog(LogPriority.Error,
  6245. this.ToString(),
  6246. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6247. ex.ToString(),
  6248. LocalPath.LogExePath);
  6249. actionResult.Status = (int)Constant.PDAResult.Exception;
  6250. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6251. }
  6252. return actionResult;
  6253. }
  6254. /// <summary>
  6255. /// 获取缺陷扣罚管理的全部数据
  6256. /// </summary>
  6257. /// <param name="accountCode"></param>
  6258. /// <param name="userCode"></param>
  6259. /// <param name="userPassword"></param>
  6260. /// <param name="sessionKey"></param>
  6261. /// <returns></returns>
  6262. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  6263. {
  6264. ActionResult actionResult = new ActionResult();
  6265. try
  6266. {
  6267. // 验证请求头信息
  6268. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6269. // 验证失败
  6270. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6271. {
  6272. return actionResult;
  6273. }
  6274. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6275. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  6276. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6277. {
  6278. DataView dv = ds.Tables[0].DefaultView;
  6279. dv.RowFilter = "valueflag=1";
  6280. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6281. actionResult.Status = (int)Constant.PDAResult.Success;
  6282. }
  6283. else
  6284. {
  6285. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6286. actionResult.Status = (int)Constant.PDAResult.Success;
  6287. }
  6288. }
  6289. catch (Exception ex)
  6290. {
  6291. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6292. OutputLog.TraceLog(LogPriority.Error,
  6293. this.ToString(),
  6294. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6295. ex.ToString(),
  6296. LocalPath.LogExePath);
  6297. actionResult.Status = (int)Constant.PDAResult.Exception;
  6298. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6299. }
  6300. return actionResult;
  6301. }
  6302. /// <summary>
  6303. /// 获取缺陷扣除数管理的全部数据
  6304. /// </summary>
  6305. /// <param name="accountCode"></param>
  6306. /// <param name="userCode"></param>
  6307. /// <param name="userPassword"></param>
  6308. /// <param name="sessionKey"></param>
  6309. /// <returns></returns>
  6310. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  6311. {
  6312. ActionResult actionResult = new ActionResult();
  6313. try
  6314. {
  6315. // 验证请求头信息
  6316. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6317. // 验证失败
  6318. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6319. {
  6320. return actionResult;
  6321. }
  6322. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6323. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  6324. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6325. {
  6326. DataView dv = ds.Tables[0].DefaultView;
  6327. dv.RowFilter = "valueflag=1";
  6328. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6329. actionResult.Status = (int)Constant.PDAResult.Success;
  6330. }
  6331. else
  6332. {
  6333. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6334. actionResult.Status = (int)Constant.PDAResult.Success;
  6335. }
  6336. }
  6337. catch (Exception ex)
  6338. {
  6339. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6340. OutputLog.TraceLog(LogPriority.Error,
  6341. this.ToString(),
  6342. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6343. ex.ToString(),
  6344. LocalPath.LogExePath);
  6345. actionResult.Status = (int)Constant.PDAResult.Exception;
  6346. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6347. }
  6348. return actionResult;
  6349. }
  6350. /// <summary>
  6351. /// 获取缺陷扣罚关系管理的全部数据
  6352. /// </summary>
  6353. /// <param name="accountCode"></param>
  6354. /// <param name="userCode"></param>
  6355. /// <param name="userPassword"></param>
  6356. /// <param name="sessionKey"></param>
  6357. /// <returns></returns>
  6358. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6359. {
  6360. ActionResult actionResult = new ActionResult();
  6361. try
  6362. {
  6363. // 验证请求头信息
  6364. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6365. // 验证失败
  6366. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6367. {
  6368. return actionResult;
  6369. }
  6370. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6371. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  6372. DataTable dt = new DataTable();
  6373. dt.Columns.Add("DefectID");
  6374. dt.Columns.Add("DefectFineID");
  6375. DataView dv = ds.Tables[0].DefaultView;
  6376. DataTable dtFor = dv.ToTable("defectid", true);
  6377. for (int i = 0; i < dtFor.Rows.Count; i++)
  6378. {
  6379. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6380. string substring = "";
  6381. foreach (DataRow r1 in r)
  6382. {
  6383. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  6384. }
  6385. if (substring != "")
  6386. {
  6387. DataRow drnew = dt.NewRow();
  6388. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6389. drnew["DefectFineID"] = substring.TrimEnd(',');
  6390. dt.Rows.Add(drnew);
  6391. }
  6392. }
  6393. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6394. actionResult.Status = (int)Constant.PDAResult.Success;
  6395. }
  6396. catch (Exception ex)
  6397. {
  6398. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6399. OutputLog.TraceLog(LogPriority.Error,
  6400. this.ToString(),
  6401. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6402. ex.ToString(),
  6403. LocalPath.LogExePath);
  6404. actionResult.Status = (int)Constant.PDAResult.Exception;
  6405. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6406. }
  6407. return actionResult;
  6408. }
  6409. /// <summary>
  6410. /// 获取缺陷扣除数关系管理的全部数据
  6411. /// </summary>
  6412. /// <param name="accountCode"></param>
  6413. /// <param name="userCode"></param>
  6414. /// <param name="userPassword"></param>
  6415. /// <param name="sessionKey"></param>
  6416. /// <returns></returns>
  6417. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6418. {
  6419. ActionResult actionResult = new ActionResult();
  6420. try
  6421. {
  6422. // 验证请求头信息
  6423. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6424. // 验证失败
  6425. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6426. {
  6427. return actionResult;
  6428. }
  6429. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6430. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6431. DataTable dt = new DataTable();
  6432. dt.Columns.Add("DefectID");
  6433. dt.Columns.Add("DefectDeductionNum");
  6434. DataView dv = ds.Tables[0].DefaultView;
  6435. DataTable dtFor = dv.ToTable("defectid", true);
  6436. for (int i = 0; i < dtFor.Rows.Count; i++)
  6437. {
  6438. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6439. string substring = "";
  6440. foreach (DataRow r1 in r)
  6441. {
  6442. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6443. }
  6444. if (substring != "")
  6445. {
  6446. DataRow drnew = dt.NewRow();
  6447. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6448. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6449. dt.Rows.Add(drnew);
  6450. }
  6451. }
  6452. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6453. actionResult.Status = (int)Constant.PDAResult.Success;
  6454. }
  6455. catch (Exception ex)
  6456. {
  6457. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6458. OutputLog.TraceLog(LogPriority.Error,
  6459. this.ToString(),
  6460. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6461. ex.ToString(),
  6462. LocalPath.LogExePath);
  6463. actionResult.Status = (int)Constant.PDAResult.Exception;
  6464. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6465. }
  6466. return actionResult;
  6467. }
  6468. /// <summary>
  6469. /// 获取盘点单明细
  6470. /// </summary>
  6471. /// <param name="sUserInfo"></param>
  6472. /// <returns></returns>
  6473. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6474. {
  6475. ActionResult actionResult = new ActionResult();
  6476. try
  6477. {
  6478. // 验证请求头信息
  6479. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6480. // 验证失败
  6481. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6482. {
  6483. return actionResult;
  6484. }
  6485. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6486. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6487. actionResult.Result = JsonHelper.ToJson(ds);
  6488. actionResult.Status = (int)Constant.PDAResult.Success;
  6489. }
  6490. catch (Exception ex)
  6491. {
  6492. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6493. OutputLog.TraceLog(LogPriority.Error,
  6494. this.ToString(),
  6495. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6496. ex.ToString(),
  6497. LocalPath.LogExePath);
  6498. actionResult.Status = (int)Constant.PDAResult.Exception;
  6499. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6500. }
  6501. return actionResult;
  6502. }
  6503. /// <summary>
  6504. /// 半检检验条码
  6505. /// </summary>
  6506. /// <param name="sUserInfo"></param>
  6507. /// <returns></returns>
  6508. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6509. {
  6510. ActionResult actionResult = new ActionResult();
  6511. try
  6512. {
  6513. // 验证请求头信息
  6514. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6515. // 验证失败
  6516. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6517. {
  6518. return actionResult;
  6519. }
  6520. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6521. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6522. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6523. if (Convert.ToInt32(resultEntity.Result) < 0)
  6524. {
  6525. actionResult.Status = (int)Constant.PDAResult.Fail;
  6526. }
  6527. else
  6528. {
  6529. actionResult.Status = (int)Constant.PDAResult.Success;
  6530. }
  6531. actionResult.Message = resultEntity.Message;
  6532. }
  6533. catch (Exception ex)
  6534. {
  6535. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6536. OutputLog.TraceLog(LogPriority.Error,
  6537. this.ToString(),
  6538. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6539. ex.ToString(),
  6540. LocalPath.LogExePath);
  6541. actionResult.Status = (int)Constant.PDAResult.Exception;
  6542. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6543. }
  6544. return actionResult;
  6545. }
  6546. /// <summary>
  6547. /// 根据条码获取经过的工序,用于绑定返工工序
  6548. /// </summary>
  6549. /// <param name="sUserInfo"></param>
  6550. /// <returns></returns>
  6551. public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6552. {
  6553. ActionResult actionResult = new ActionResult();
  6554. try
  6555. {
  6556. // 验证请求头信息
  6557. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6558. // 验证失败
  6559. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6560. {
  6561. return actionResult;
  6562. }
  6563. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6564. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6565. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6566. actionResult.Status = (int)Constant.PDAResult.Success;
  6567. }
  6568. catch (Exception ex)
  6569. {
  6570. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6571. OutputLog.TraceLog(LogPriority.Error,
  6572. this.ToString(),
  6573. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6574. ex.ToString(),
  6575. LocalPath.LogExePath);
  6576. actionResult.Status = (int)Constant.PDAResult.Exception;
  6577. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6578. }
  6579. return actionResult;
  6580. }
  6581. /// <summary>
  6582. /// 获取登陆帐户有无半检状态权限
  6583. /// </summary>
  6584. /// <param name="sUserInfo"></param>
  6585. /// <returns></returns>
  6586. public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6587. {
  6588. ActionResult actionResult = new ActionResult();
  6589. try
  6590. {
  6591. // 验证请求头信息
  6592. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6593. // 验证失败
  6594. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6595. {
  6596. return actionResult;
  6597. }
  6598. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6599. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6600. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6601. actionResult.Status = (int)Constant.PDAResult.Success;
  6602. }
  6603. catch (Exception ex)
  6604. {
  6605. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6606. OutputLog.TraceLog(LogPriority.Error,
  6607. this.ToString(),
  6608. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6609. ex.ToString(),
  6610. LocalPath.LogExePath);
  6611. actionResult.Status = (int)Constant.PDAResult.Exception;
  6612. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6613. }
  6614. return actionResult;
  6615. }
  6616. /// <summary>
  6617. /// 复检状态数据源
  6618. /// </summary>
  6619. /// <param name="sUserInfo"></param>
  6620. /// <returns></returns>
  6621. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6622. {
  6623. ActionResult actionResult = new ActionResult();
  6624. try
  6625. {
  6626. // 验证请求头信息
  6627. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6628. // 验证失败
  6629. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6630. {
  6631. return actionResult;
  6632. }
  6633. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6634. () => SystemModuleLogic.GetSemiCheckType());
  6635. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6636. actionResult.Status = (int)Constant.PDAResult.Success;
  6637. }
  6638. catch (Exception ex)
  6639. {
  6640. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6641. OutputLog.TraceLog(LogPriority.Error,
  6642. this.ToString(),
  6643. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6644. ex.ToString(),
  6645. LocalPath.LogExePath);
  6646. actionResult.Status = (int)Constant.PDAResult.Exception;
  6647. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6648. }
  6649. return actionResult;
  6650. }
  6651. /// <summary>
  6652. /// 根据半成品检验数据ID,显示半成品数据信息
  6653. /// </summary>
  6654. /// <param name="sUserInfo"></param>
  6655. /// <returns></returns>
  6656. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6657. {
  6658. ActionResult actionResult = new ActionResult();
  6659. try
  6660. {
  6661. // 验证请求头信息
  6662. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6663. // 验证失败
  6664. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6665. {
  6666. return actionResult;
  6667. }
  6668. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6669. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6670. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6671. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6672. {
  6673. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6674. {
  6675. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6676. {
  6677. SemiCheckEntity productionData = new SemiCheckEntity();
  6678. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6679. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6680. {
  6681. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6682. }
  6683. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6684. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6685. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6686. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6687. productionData.ReFine = 0;
  6688. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6689. {
  6690. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6691. }
  6692. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6693. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6694. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6695. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6696. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6697. {
  6698. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6699. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6700. }
  6701. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6702. {
  6703. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6704. }
  6705. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6706. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6707. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6708. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6709. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6710. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6711. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6712. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6713. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6714. {
  6715. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6716. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6717. }
  6718. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6719. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6720. {
  6721. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6722. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6723. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6724. }
  6725. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6726. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6727. {
  6728. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6729. }
  6730. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6731. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6732. DataTable dtDefect = dvDefect.ToTable();
  6733. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6734. {
  6735. // 产品缺陷
  6736. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6737. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6738. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6739. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6740. //{
  6741. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6742. //}
  6743. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6744. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6745. {
  6746. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6747. }
  6748. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6749. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6750. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6751. {
  6752. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6753. }
  6754. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6755. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6756. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6757. {
  6758. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6759. }
  6760. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6761. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6762. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6763. {
  6764. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6765. }
  6766. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6767. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6768. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6769. //{
  6770. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6771. //}
  6772. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6773. //{
  6774. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6775. //}
  6776. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6777. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6778. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6779. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6780. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6781. {
  6782. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6783. }
  6784. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6785. {
  6786. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6787. }
  6788. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6789. //{
  6790. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6791. //}
  6792. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6793. //--------责任员工-------------------
  6794. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6795. if (drRow.Length > Constant.INT_IS_ZERO)
  6796. {
  6797. if (defect.DefectResponsibles == null)
  6798. {
  6799. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6800. }
  6801. foreach (DataRow r in drRow)
  6802. {
  6803. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6804. if (r["SemiCheckDefectID"].ToString() != "")
  6805. {
  6806. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6807. }
  6808. if (r["StaffID"].ToString() != "")
  6809. {
  6810. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6811. }
  6812. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6813. defectResponsible.StaffName = r["StaffName"].ToString();
  6814. if (r["StaffStatus"].ToString() != "")
  6815. {
  6816. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6817. }
  6818. if (r["UJobsID"].ToString() != "")
  6819. {
  6820. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6821. }
  6822. if (r["SJobsID"].ToString() != "")
  6823. {
  6824. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6825. }
  6826. defect.DefectResponsibles.Add(defectResponsible);
  6827. }
  6828. }
  6829. //------------------------------
  6830. if (productionData.SemiCheckDefects == null)
  6831. {
  6832. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6833. }
  6834. productionData.SemiCheckDefects.Add(defect);
  6835. }
  6836. //if (productionDatas.PDAProductionData == null)
  6837. //{
  6838. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6839. //}
  6840. productionDatas[0] = productionData;
  6841. //---------------------------------------------------------------------------------
  6842. }
  6843. }
  6844. }
  6845. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6846. actionResult.Status = (int)Constant.PDAResult.Success;
  6847. }
  6848. catch (Exception ex)
  6849. {
  6850. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6851. OutputLog.TraceLog(LogPriority.Error,
  6852. this.ToString(),
  6853. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6854. ex.ToString(),
  6855. LocalPath.LogExePath);
  6856. actionResult.Status = (int)Constant.PDAResult.Exception;
  6857. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6858. }
  6859. return actionResult;
  6860. }
  6861. /// <summary>
  6862. /// 保存半检登记
  6863. /// </summary>
  6864. /// <param name="accountCode">帐套code</param>
  6865. /// <param name="userCode">用户code</param>
  6866. /// <param name="userPassword">用户密码</param>
  6867. /// <param name="sessionKey">本次登陆密钥</param>
  6868. /// <param name="entity">半检实体类</param>
  6869. /// <param name="sUserInfo">用户基本信息</param>
  6870. /// <returns></returns>
  6871. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6872. {
  6873. ActionResult actionResult = new ActionResult();
  6874. try
  6875. {
  6876. // 验证请求头信息
  6877. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6878. // 验证失败
  6879. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6880. {
  6881. return actionResult;
  6882. }
  6883. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6884. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6885. string err = string.Empty;
  6886. err = resultEntity.Message;
  6887. if (err == null)
  6888. {
  6889. err = "";
  6890. }
  6891. SemiCheckEntity entity = entityobj[0];
  6892. if (entity.SemiCheckCategory == 1) // 半检登记
  6893. {
  6894. }
  6895. else if (entity.SemiCheckCategory == 2)// 复检登记
  6896. {
  6897. err = JsonHelper.ToJson(err);
  6898. }
  6899. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6900. {
  6901. err = JsonHelper.ToJson(err);
  6902. }
  6903. //actionResult.Result = JsonHelper.ToJson(err);
  6904. actionResult.Result = err;//JsonHelper.ToJson(err);
  6905. actionResult.Status = (int)Constant.PDAResult.Success;
  6906. }
  6907. catch (Exception ex)
  6908. {
  6909. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6910. OutputLog.TraceLog(LogPriority.Error,
  6911. this.ToString(),
  6912. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6913. ex.ToString(),
  6914. LocalPath.LogExePath);
  6915. actionResult.Status = (int)Constant.PDAResult.Exception;
  6916. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6917. }
  6918. return actionResult;
  6919. }
  6920. /// <summary>
  6921. /// 根据所选工号,查出缺陷责任员工
  6922. /// </summary>
  6923. /// <param name="sUserInfo"></param>
  6924. /// <returns></returns>
  6925. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6926. {
  6927. ActionResult actionResult = new ActionResult();
  6928. try
  6929. {
  6930. // 验证请求头信息
  6931. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6932. // 验证失败
  6933. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6934. {
  6935. return actionResult;
  6936. }
  6937. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6938. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  6939. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6940. actionResult.Status = (int)Constant.PDAResult.Success;
  6941. }
  6942. catch (Exception ex)
  6943. {
  6944. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6945. OutputLog.TraceLog(LogPriority.Error,
  6946. this.ToString(),
  6947. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6948. ex.ToString(),
  6949. LocalPath.LogExePath);
  6950. actionResult.Status = (int)Constant.PDAResult.Exception;
  6951. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6952. }
  6953. return actionResult;
  6954. }
  6955. /// <summary>
  6956. /// 获取半成品缺陷管理的全部数据
  6957. /// </summary>
  6958. /// <param name="sUserInfo"></param>
  6959. /// <returns></returns>
  6960. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  6961. {
  6962. ActionResult actionResult = new ActionResult();
  6963. try
  6964. {
  6965. // 验证请求头信息
  6966. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6967. // 验证失败
  6968. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6969. {
  6970. return actionResult;
  6971. }
  6972. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6973. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  6974. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6975. actionResult.Status = (int)Constant.PDAResult.Success;
  6976. }
  6977. catch (Exception ex)
  6978. {
  6979. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6980. OutputLog.TraceLog(LogPriority.Error,
  6981. this.ToString(),
  6982. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6983. ex.ToString(),
  6984. LocalPath.LogExePath);
  6985. actionResult.Status = (int)Constant.PDAResult.Exception;
  6986. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6987. }
  6988. return actionResult;
  6989. }
  6990. /// <summary>
  6991. /// 获取PLC参数
  6992. /// </summary>
  6993. /// <param name="sUserInfo"></param>
  6994. /// <returns></returns>
  6995. public ActionResult GetPLCParameter(string accountCode, string userCode, string userPassword, string sessionKey,string PlcName)
  6996. {
  6997. ActionResult actionResult = new ActionResult();
  6998. try
  6999. {
  7000. // 验证请求头信息
  7001. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7002. // 验证失败
  7003. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7004. {
  7005. return actionResult;
  7006. }
  7007. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7008. () => SystemModuleLogic.GetPLCParameter(PlcName));
  7009. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7010. actionResult.Status = (int)Constant.PDAResult.Success;
  7011. }
  7012. catch (Exception ex)
  7013. {
  7014. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7015. OutputLog.TraceLog(LogPriority.Error,
  7016. this.ToString(),
  7017. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7018. ex.ToString(),
  7019. LocalPath.LogExePath);
  7020. actionResult.Status = (int)Constant.PDAResult.Exception;
  7021. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7022. }
  7023. return actionResult;
  7024. }
  7025. /// <summary>
  7026. /// 获取产品信息
  7027. /// </summary>
  7028. /// <param name="sUserInfo"></param>
  7029. /// <returns></returns>
  7030. public ActionResult GetGodsParameter(string accountCode, string userCode, string userPassword, string sessionKey, string BarCode)
  7031. {
  7032. ActionResult actionResult = new ActionResult();
  7033. try
  7034. {
  7035. // 验证请求头信息
  7036. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7037. // 验证失败
  7038. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7039. {
  7040. return actionResult;
  7041. }
  7042. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7043. () => SystemModuleLogic.GetGodsParameter(BarCode));
  7044. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7045. actionResult.Status = (int)Constant.PDAResult.Success;
  7046. }
  7047. catch (Exception ex)
  7048. {
  7049. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7050. OutputLog.TraceLog(LogPriority.Error,
  7051. this.ToString(),
  7052. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7053. ex.ToString(),
  7054. LocalPath.LogExePath);
  7055. actionResult.Status = (int)Constant.PDAResult.Exception;
  7056. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7057. }
  7058. return actionResult;
  7059. }
  7060. /// <summary>
  7061. /// 传输PLC产品信息
  7062. /// </summary>
  7063. /// <param name="sUserInfo"></param>
  7064. /// <returns></returns>
  7065. public ActionResult AddPlcGood(string accountCode, string userCode, string userPassword, string sessionKey,string Plcid, string BarCode,string GROUTINGLINECODE, string GOODSMODEL, string GOODSTYPENAME, string GOODSSPECIFICATION)
  7066. {
  7067. ActionResult actionResult = new ActionResult();
  7068. try
  7069. {
  7070. // 验证请求头信息
  7071. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7072. // 验证失败
  7073. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7074. {
  7075. return actionResult;
  7076. }
  7077. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7078. () => SystemModuleLogic.AddPlcGood(Plcid, BarCode, GROUTINGLINECODE, GOODSMODEL, GOODSTYPENAME, GOODSSPECIFICATION));
  7079. actionResult.Result = JsonHelper.ToJson(resultEntity);
  7080. actionResult.Status = (int)Constant.PDAResult.Success;
  7081. }
  7082. catch (Exception ex)
  7083. {
  7084. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7085. OutputLog.TraceLog(LogPriority.Error,
  7086. this.ToString(),
  7087. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7088. ex.ToString(),
  7089. LocalPath.LogExePath);
  7090. actionResult.Status = (int)Constant.PDAResult.Exception;
  7091. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7092. }
  7093. return actionResult;
  7094. }
  7095. /// <summary>
  7096. /// 获取半成品缺陷位置管理的全部数据
  7097. /// </summary>
  7098. /// <param name="sUserInfo"></param>
  7099. /// <returns></returns>
  7100. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  7101. {
  7102. ActionResult actionResult = new ActionResult();
  7103. try
  7104. {
  7105. // 验证请求头信息
  7106. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7107. // 验证失败
  7108. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7109. {
  7110. return actionResult;
  7111. }
  7112. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7113. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  7114. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7115. actionResult.Status = (int)Constant.PDAResult.Success;
  7116. }
  7117. catch (Exception ex)
  7118. {
  7119. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7120. OutputLog.TraceLog(LogPriority.Error,
  7121. this.ToString(),
  7122. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7123. ex.ToString(),
  7124. LocalPath.LogExePath);
  7125. actionResult.Status = (int)Constant.PDAResult.Exception;
  7126. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7127. }
  7128. return actionResult;
  7129. }
  7130. /// <summary>
  7131. /// 复检验条码
  7132. /// </summary>
  7133. /// <param name="sUserInfo"></param>
  7134. /// <returns></returns>
  7135. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7136. {
  7137. ActionResult actionResult = new ActionResult();
  7138. try
  7139. {
  7140. // 验证请求头信息
  7141. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7142. // 验证失败
  7143. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7144. {
  7145. return actionResult;
  7146. }
  7147. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7148. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  7149. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7150. if (Convert.ToInt32(resultEntity.Result) < 0)
  7151. {
  7152. actionResult.Status = (int)Constant.PDAResult.Fail;
  7153. }
  7154. else
  7155. {
  7156. actionResult.Status = (int)Constant.PDAResult.Success;
  7157. }
  7158. actionResult.Message = resultEntity.Message;
  7159. }
  7160. catch (Exception ex)
  7161. {
  7162. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7163. OutputLog.TraceLog(LogPriority.Error,
  7164. this.ToString(),
  7165. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7166. ex.ToString(),
  7167. LocalPath.LogExePath);
  7168. actionResult.Status = (int)Constant.PDAResult.Exception;
  7169. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7170. }
  7171. return actionResult;
  7172. }
  7173. /// <summary>
  7174. /// 撤销复检验条码
  7175. /// </summary>
  7176. /// <param name="sUserInfo"></param>
  7177. /// <returns></returns>
  7178. public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7179. {
  7180. ActionResult actionResult = new ActionResult();
  7181. try
  7182. {
  7183. // 验证请求头信息
  7184. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7185. // 验证失败
  7186. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7187. {
  7188. return actionResult;
  7189. }
  7190. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7191. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  7192. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7193. if (Convert.ToInt32(resultEntity.Result) < 0)
  7194. {
  7195. actionResult.Status = (int)Constant.PDAResult.Fail;
  7196. }
  7197. else
  7198. {
  7199. actionResult.Status = (int)Constant.PDAResult.Success;
  7200. }
  7201. actionResult.Message = resultEntity.Message;
  7202. }
  7203. catch (Exception ex)
  7204. {
  7205. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7206. OutputLog.TraceLog(LogPriority.Error,
  7207. this.ToString(),
  7208. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7209. ex.ToString(),
  7210. LocalPath.LogExePath);
  7211. actionResult.Status = (int)Constant.PDAResult.Exception;
  7212. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7213. }
  7214. return actionResult;
  7215. }
  7216. /// <summary>
  7217. /// 恢复数据
  7218. /// </summary>
  7219. /// <param name="sUserInfo"></param>
  7220. /// <returns></returns>
  7221. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7222. {
  7223. ActionResult actionResult = new ActionResult();
  7224. try
  7225. {
  7226. // 验证请求头信息
  7227. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7228. // 验证失败
  7229. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7230. {
  7231. return actionResult;
  7232. }
  7233. int resultEntity = ServiceInvoker.Invoke<int>(this,
  7234. () => PMModuleLogicDAL.ResetBarCode(barcode));
  7235. if (resultEntity > 0)
  7236. {
  7237. actionResult.Status = (int)Constant.PDAResult.Success;
  7238. actionResult.Message = "恢复数据成功";
  7239. }
  7240. else
  7241. {
  7242. actionResult.Status = (int)Constant.PDAResult.Fail;
  7243. if (resultEntity == -1)
  7244. {
  7245. actionResult.Message = "此条码没有清除,不能恢复";
  7246. }
  7247. else if (resultEntity == 0)
  7248. {
  7249. actionResult.Message = "没有可恢复的数据";
  7250. }
  7251. }
  7252. }
  7253. catch (Exception ex)
  7254. {
  7255. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7256. OutputLog.TraceLog(LogPriority.Error,
  7257. this.ToString(),
  7258. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7259. ex.ToString(),
  7260. LocalPath.LogExePath);
  7261. actionResult.Status = (int)Constant.PDAResult.Exception;
  7262. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7263. }
  7264. return actionResult;
  7265. }
  7266. /// <summary>
  7267. /// 通过SettingCode获取系统参数管理的数据
  7268. /// </summary>
  7269. /// <param name="accountCode"></param>
  7270. /// <param name="userCode"></param>
  7271. /// <param name="userPassword"></param>
  7272. /// <param name="sessionKey"></param>
  7273. /// <param name="settingcode">设置编码</param>
  7274. /// <returns></returns>
  7275. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  7276. {
  7277. ActionResult actionResult = new ActionResult();
  7278. try
  7279. {
  7280. // 验证请求头信息
  7281. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7282. // 验证失败
  7283. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7284. {
  7285. return actionResult;
  7286. }
  7287. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7288. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  7289. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7290. actionResult.Status = (int)Constant.PDAResult.Success;
  7291. }
  7292. catch (Exception ex)
  7293. {
  7294. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7295. OutputLog.TraceLog(LogPriority.Error,
  7296. this.ToString(),
  7297. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7298. ex.ToString(),
  7299. LocalPath.LogExePath);
  7300. actionResult.Status = (int)Constant.PDAResult.Exception;
  7301. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7302. }
  7303. return actionResult;
  7304. }
  7305. /// <summary>
  7306. /// 校验条码是否允许撤销,如果不允许提示错误消息
  7307. /// </summary>
  7308. /// <param name="accountCode"></param>
  7309. /// <param name="userCode"></param>
  7310. /// <param name="userPassword"></param>
  7311. /// <param name="sessionKey"></param>
  7312. /// <param name="orgTime">原时间</param>
  7313. /// <param name="days">允许撤销天数</param>
  7314. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  7315. /// <returns></returns>
  7316. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  7317. {
  7318. ActionResult actionResult = new ActionResult();
  7319. try
  7320. {
  7321. // 验证请求头信息
  7322. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7323. // 验证失败
  7324. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7325. {
  7326. return actionResult;
  7327. }
  7328. string[] subOrgTime = orgTime.Split('-');
  7329. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  7330. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7331. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  7332. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7333. if (Convert.ToInt32(resultEntity.Result) < 0)
  7334. {
  7335. actionResult.Status = (int)Constant.PDAResult.Fail;
  7336. }
  7337. else
  7338. {
  7339. actionResult.Status = (int)Constant.PDAResult.Success;
  7340. }
  7341. actionResult.Message = resultEntity.Message;
  7342. }
  7343. catch (Exception ex)
  7344. {
  7345. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7346. OutputLog.TraceLog(LogPriority.Error,
  7347. this.ToString(),
  7348. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7349. ex.ToString(),
  7350. LocalPath.LogExePath);
  7351. actionResult.Status = (int)Constant.PDAResult.Exception;
  7352. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7353. }
  7354. return actionResult;
  7355. }
  7356. /// <summary>
  7357. /// 获取生产订单管理的全部数据
  7358. /// </summary>
  7359. /// <param name="sUserInfo"></param>
  7360. /// <returns></returns>
  7361. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  7362. {
  7363. ActionResult actionResult = new ActionResult();
  7364. try
  7365. {
  7366. // 验证请求头信息
  7367. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7368. // 验证失败
  7369. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7370. {
  7371. return actionResult;
  7372. }
  7373. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7374. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  7375. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7376. actionResult.Status = (int)Constant.PDAResult.Success;
  7377. }
  7378. catch (Exception ex)
  7379. {
  7380. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7381. OutputLog.TraceLog(LogPriority.Error,
  7382. this.ToString(),
  7383. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7384. ex.ToString(),
  7385. LocalPath.LogExePath);
  7386. actionResult.Status = (int)Constant.PDAResult.Exception;
  7387. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7388. }
  7389. return actionResult;
  7390. }
  7391. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7392. {
  7393. ActionResult actionResult = new ActionResult();
  7394. try
  7395. {
  7396. // 验证请求头信息
  7397. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7398. // 验证失败
  7399. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7400. {
  7401. return actionResult;
  7402. }
  7403. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7404. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  7405. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7406. if (Convert.ToInt32(resultEntity.Result) < 0)
  7407. {
  7408. actionResult.Status = (int)Constant.PDAResult.Fail;
  7409. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  7410. }
  7411. else
  7412. {
  7413. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  7414. actionResult.Status = (int)Constant.PDAResult.Success;
  7415. }
  7416. actionResult.Message = resultEntity.Message;
  7417. }
  7418. catch (Exception ex)
  7419. {
  7420. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7421. OutputLog.TraceLog(LogPriority.Error,
  7422. this.ToString(),
  7423. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7424. ex.ToString(),
  7425. LocalPath.LogExePath);
  7426. actionResult.Status = (int)Constant.PDAResult.Exception;
  7427. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7428. }
  7429. return actionResult;
  7430. }
  7431. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  7432. {
  7433. ActionResult actionResult = new ActionResult();
  7434. try
  7435. {
  7436. // 验证请求头信息
  7437. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7438. // 验证失败
  7439. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7440. {
  7441. return actionResult;
  7442. }
  7443. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7444. () => SystemModuleLogic.GetSystemData(sUserInfo));
  7445. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7446. actionResult.Status = (int)Constant.PDAResult.Success;
  7447. }
  7448. catch (Exception ex)
  7449. {
  7450. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7451. OutputLog.TraceLog(LogPriority.Error,
  7452. this.ToString(),
  7453. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7454. ex.ToString(),
  7455. LocalPath.LogExePath);
  7456. actionResult.Status = (int)Constant.PDAResult.Exception;
  7457. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7458. }
  7459. return actionResult;
  7460. }
  7461. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  7462. {
  7463. ActionResult actionResult = new ActionResult();
  7464. try
  7465. {
  7466. // 验证请求头信息
  7467. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7468. // 验证失败
  7469. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7470. {
  7471. return actionResult;
  7472. }
  7473. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  7474. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7475. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  7476. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7477. if (Convert.ToInt32(resultEntity.Result) < 0)
  7478. {
  7479. actionResult.Status = (int)Constant.PDAResult.Fail;
  7480. }
  7481. else
  7482. {
  7483. actionResult.Status = (int)Constant.PDAResult.Success;
  7484. }
  7485. actionResult.Message = resultEntity.Message;
  7486. }
  7487. catch (Exception ex)
  7488. {
  7489. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7490. OutputLog.TraceLog(LogPriority.Error,
  7491. this.ToString(),
  7492. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7493. ex.ToString(),
  7494. LocalPath.LogExePath);
  7495. actionResult.Status = (int)Constant.PDAResult.Exception;
  7496. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7497. }
  7498. return actionResult;
  7499. }
  7500. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7501. {
  7502. ActionResult actionResult = new ActionResult();
  7503. try
  7504. {
  7505. // 验证请求头信息
  7506. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7507. // 验证失败
  7508. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7509. {
  7510. return actionResult;
  7511. }
  7512. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7513. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7514. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7515. if (Convert.ToInt32(resultEntity.Result) < 0)
  7516. {
  7517. actionResult.Status = (int)Constant.PDAResult.Fail;
  7518. }
  7519. else
  7520. {
  7521. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7522. actionResult.Status = (int)Constant.PDAResult.Success;
  7523. }
  7524. actionResult.Message = resultEntity.Message;
  7525. }
  7526. catch (Exception ex)
  7527. {
  7528. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7529. OutputLog.TraceLog(LogPriority.Error,
  7530. this.ToString(),
  7531. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7532. ex.ToString(),
  7533. LocalPath.LogExePath);
  7534. actionResult.Status = (int)Constant.PDAResult.Exception;
  7535. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7536. }
  7537. return actionResult;
  7538. }
  7539. public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7540. {
  7541. ActionResult actionResult = new ActionResult();
  7542. try
  7543. {
  7544. // 验证请求头信息
  7545. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7546. // 验证失败
  7547. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7548. {
  7549. return actionResult;
  7550. }
  7551. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7552. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7553. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7554. if (Convert.ToInt32(resultEntity.Result) < 0)
  7555. {
  7556. actionResult.Status = (int)Constant.PDAResult.Fail;
  7557. }
  7558. else
  7559. {
  7560. actionResult.Status = (int)Constant.PDAResult.Success;
  7561. }
  7562. actionResult.Message = resultEntity.Message;
  7563. }
  7564. catch (Exception ex)
  7565. {
  7566. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7567. OutputLog.TraceLog(LogPriority.Error,
  7568. this.ToString(),
  7569. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7570. ex.ToString(),
  7571. LocalPath.LogExePath);
  7572. actionResult.Status = (int)Constant.PDAResult.Exception;
  7573. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7574. }
  7575. return actionResult;
  7576. }
  7577. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7578. {
  7579. ActionResult actionResult = new ActionResult();
  7580. try
  7581. {
  7582. // 验证请求头信息
  7583. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7584. // 验证失败
  7585. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7586. {
  7587. return actionResult;
  7588. }
  7589. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7590. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7591. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7592. if (Convert.ToInt32(resultEntity.Result) < 0)
  7593. {
  7594. actionResult.Status = (int)Constant.PDAResult.Fail;
  7595. }
  7596. else
  7597. {
  7598. actionResult.Status = (int)Constant.PDAResult.Success;
  7599. }
  7600. actionResult.Message = resultEntity.Message;
  7601. }
  7602. catch (Exception ex)
  7603. {
  7604. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7605. OutputLog.TraceLog(LogPriority.Error,
  7606. this.ToString(),
  7607. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7608. ex.ToString(),
  7609. LocalPath.LogExePath);
  7610. actionResult.Status = (int)Constant.PDAResult.Exception;
  7611. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7612. }
  7613. return actionResult;
  7614. }
  7615. #region PDA条码打印
  7616. /// <summary>
  7617. /// 获取条码打印机
  7618. /// </summary>
  7619. /// <param name="accountCode"></param>
  7620. /// <param name="userCode"></param>
  7621. /// <param name="userPassword"></param>
  7622. /// <param name="sessionKey"></param>
  7623. /// <returns></returns>
  7624. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printType = 0)
  7625. {
  7626. ActionResult actionResult = new ActionResult();
  7627. try
  7628. {
  7629. // 验证请求头信息
  7630. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7631. // 验证失败
  7632. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7633. {
  7634. return actionResult;
  7635. }
  7636. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType);
  7637. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7638. actionResult.Status = (int)Constant.PDAResult.Success;
  7639. }
  7640. catch (Exception ex)
  7641. {
  7642. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7643. OutputLog.TraceLog(LogPriority.Error,
  7644. this.ToString(),
  7645. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7646. ex.ToString(),
  7647. LocalPath.LogExePath);
  7648. actionResult.Status = (int)Constant.PDAResult.Exception;
  7649. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7650. }
  7651. return actionResult;
  7652. }
  7653. /// <summary>
  7654. /// 打印条码样式(补打)
  7655. /// </summary>
  7656. /// <param name="accountCode"></param>
  7657. /// <param name="userCode"></param>
  7658. /// <param name="userPassword"></param>
  7659. /// <param name="sessionKey"></param>
  7660. /// <returns></returns>
  7661. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey,
  7662. string barcode, int copies, int printerID, int printWay = 2)
  7663. {
  7664. ActionResult actionResult = new ActionResult();
  7665. try
  7666. {
  7667. // 验证请求头信息
  7668. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7669. // 验证失败
  7670. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7671. {
  7672. return actionResult;
  7673. }
  7674. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7675. // copies, printerID, sUserInfo);
  7676. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(barcode,
  7677. copies, printerID, sUserInfo, printWay);
  7678. if (sre.Status != Constant.ServiceResultStatus.Success)
  7679. {
  7680. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7681. actionResult.Message = sre.Message;
  7682. return actionResult;
  7683. }
  7684. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7685. actionResult.Status = (int)Constant.PDAResult.Success;
  7686. }
  7687. catch (Exception ex)
  7688. {
  7689. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7690. OutputLog.TraceLog(LogPriority.Error,
  7691. this.ToString(),
  7692. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7693. ex.ToString(),
  7694. LocalPath.LogExePath);
  7695. actionResult.Status = (int)Constant.PDAResult.Exception;
  7696. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7697. }
  7698. return actionResult;
  7699. }
  7700. #endregion PDA条码打印
  7701. #region 统计报表
  7702. /// <summary>
  7703. /// 成型结算报表
  7704. /// </summary>
  7705. /// <param name="accountCode"></param>
  7706. /// <param name="userCode"></param>
  7707. /// <param name="userPassword"></param>
  7708. /// <param name="sessionKey"></param>
  7709. /// <returns></returns>
  7710. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7711. int currentMonth)
  7712. {
  7713. ActionResult actionResult = new ActionResult();
  7714. try
  7715. {
  7716. // 验证请求头信息
  7717. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7718. // 验证失败
  7719. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7720. {
  7721. return actionResult;
  7722. }
  7723. DateTime date = DateTime.Now;
  7724. if (currentMonth != 1)
  7725. {
  7726. date = date.AddMonths(-1);
  7727. }
  7728. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7729. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7730. if (resultEntity == null || resultEntity.Data == null)
  7731. {
  7732. actionResult.Status = (int)Constant.PDAResult.Fail;
  7733. actionResult.Message = "查询失败";
  7734. return actionResult;
  7735. }
  7736. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7737. {
  7738. actionResult.Status = (int)Constant.PDAResult.Fail;
  7739. actionResult.Message = resultEntity.Message;
  7740. return actionResult;
  7741. }
  7742. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7743. actionResult.Status = (int)Constant.PDAResult.Success;
  7744. }
  7745. catch (Exception ex)
  7746. {
  7747. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7748. OutputLog.TraceLog(LogPriority.Error,
  7749. this.ToString(),
  7750. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7751. ex.ToString(),
  7752. LocalPath.LogExePath);
  7753. actionResult.Status = (int)Constant.PDAResult.Exception;
  7754. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7755. }
  7756. return actionResult;
  7757. }
  7758. #endregion
  7759. #region 设置当期用户默认打印机配置
  7760. /// <summary>
  7761. /// 设置当期用户默认打印机配置
  7762. /// </summary>
  7763. /// <param name="accountCode"></param>
  7764. /// <param name="userCode"></param>
  7765. /// <param name="userPassword"></param>
  7766. /// <param name="sessionKey"></param>
  7767. /// <param name="printerID"></param>
  7768. /// <returns></returns>
  7769. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7770. int printerID)
  7771. {
  7772. ActionResult actionResult = new ActionResult();
  7773. try
  7774. {
  7775. // 验证请求头信息
  7776. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7777. // 验证失败
  7778. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7779. {
  7780. return actionResult;
  7781. }
  7782. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7783. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7784. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7785. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7786. {
  7787. actionResult.Status = (int)Constant.PDAResult.Fail;
  7788. }
  7789. else
  7790. {
  7791. actionResult.Status = (int)Constant.PDAResult.Success;
  7792. }
  7793. actionResult.Message = resultEntity.Message;
  7794. }
  7795. catch (Exception ex)
  7796. {
  7797. OutputLog.TraceLog(LogPriority.Error,
  7798. this.ToString(),
  7799. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7800. ex.ToString(),
  7801. LocalPath.LogExePath);
  7802. actionResult.Status = (int)Constant.PDAResult.Exception;
  7803. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7804. }
  7805. return actionResult;
  7806. }
  7807. /// <summary>
  7808. /// 校验产品条码是否可以进行回收
  7809. /// </summary>
  7810. /// <param name="accountCode">帐套code</param>
  7811. /// <param name="userCode">用户code</param>
  7812. /// <param name="userPassword">用户密码</param>
  7813. /// <param name="sessionKey">本次登陆密钥</param>
  7814. /// <param name="procedureID">工序ID</param>
  7815. /// <param name="barcode">条码</param>
  7816. /// <returns></returns>
  7817. /// <remarks>
  7818. /// 王鑫 2017.7.21 新建
  7819. /// </remarks>
  7820. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7821. {
  7822. ActionResult actionResult = new ActionResult();
  7823. try
  7824. {
  7825. // 验证请求头信息
  7826. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7827. // 验证失败
  7828. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7829. {
  7830. return actionResult;
  7831. }
  7832. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7833. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7834. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7835. {
  7836. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7837. actionResult.Status = (int)Constant.PDAResult.Success;
  7838. }
  7839. else
  7840. {
  7841. actionResult.Status = (int)Constant.PDAResult.Fail;
  7842. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7843. }
  7844. }
  7845. catch (Exception ex)
  7846. {
  7847. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7848. OutputLog.TraceLog(LogPriority.Error,
  7849. this.ToString(),
  7850. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7851. ex.ToString(),
  7852. LocalPath.LogExePath);
  7853. actionResult.Status = (int)Constant.PDAResult.Exception;
  7854. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7855. }
  7856. return actionResult;
  7857. }
  7858. /// <summary>
  7859. /// 获取回收标识
  7860. /// </summary>
  7861. /// <param name="accountCode"></param>
  7862. /// <param name="userCode"></param>
  7863. /// <param name="userPassword"></param>
  7864. /// <param name="sessionKey"></param>
  7865. /// <param name="usercode">工号编码</param>
  7866. /// <returns></returns>
  7867. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7868. {
  7869. ActionResult actionResult = new ActionResult();
  7870. try
  7871. {
  7872. // 验证请求头信息
  7873. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7874. // 验证失败
  7875. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7876. {
  7877. return actionResult;
  7878. }
  7879. int returnValue = ServiceInvoker.Invoke<int>(this,
  7880. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7881. actionResult.Result = JsonHelper.ToJson(returnValue);
  7882. actionResult.Status = (int)Constant.PDAResult.Success;
  7883. }
  7884. catch (Exception ex)
  7885. {
  7886. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7887. OutputLog.TraceLog(LogPriority.Error,
  7888. this.ToString(),
  7889. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7890. ex.ToString(),
  7891. LocalPath.LogExePath);
  7892. actionResult.Status = (int)Constant.PDAResult.Exception;
  7893. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7894. }
  7895. return actionResult;
  7896. }
  7897. #endregion
  7898. #region 注浆盘点
  7899. /// <summary>
  7900. /// 获取注浆盘点单列表
  7901. /// </summary>
  7902. /// <param name="sUserInfo"></param>
  7903. /// <returns></returns>
  7904. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7905. {
  7906. ActionResult actionResult = new ActionResult();
  7907. try
  7908. {
  7909. // 验证请求头信息
  7910. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7911. // 验证失败
  7912. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7913. {
  7914. return actionResult;
  7915. }
  7916. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7917. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7918. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7919. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7920. actionResult.Result = JsonHelper.ToJson(ds);
  7921. actionResult.Status = (int)Constant.PDAResult.Success;
  7922. }
  7923. catch (Exception ex)
  7924. {
  7925. string json = JsonHelper.ToJson(entity);
  7926. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7927. OutputLog.TraceLog(LogPriority.Error,
  7928. this.ToString(),
  7929. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7930. ex.ToString(),
  7931. LocalPath.LogExePath);
  7932. actionResult.Status = (int)Constant.PDAResult.Exception;
  7933. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7934. }
  7935. return actionResult;
  7936. }
  7937. /// <summary>
  7938. /// 进行盘点操作
  7939. /// </summary>
  7940. /// <param name="accountCode"></param>
  7941. /// <param name="userCode"></param>
  7942. /// <param name="userPassword"></param>
  7943. /// <param name="sessionKey"></param>
  7944. /// <param name="InCheckedID">盘点单ID</param>
  7945. /// <param name="BarCode">产品条码</param>
  7946. /// <returns></returns>
  7947. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7948. {
  7949. ActionResult actionResult = new ActionResult();
  7950. try
  7951. {
  7952. // 验证请求头信息
  7953. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7954. // 验证失败
  7955. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7956. {
  7957. return actionResult;
  7958. }
  7959. ClientRequestEntity cre = new ClientRequestEntity();
  7960. cre.Properties["CheckedID"] = CheckedID;
  7961. cre.Properties["Barcode"] = BarCode;
  7962. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7963. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7964. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7965. {
  7966. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7967. actionResult.Status = (int)Constant.PDAResult.Success;
  7968. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7969. }
  7970. else
  7971. {
  7972. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7973. actionResult.Status = (int)Constant.PDAResult.Fail;
  7974. actionResult.Message = returnValue.Message;
  7975. }
  7976. }
  7977. catch (Exception ex)
  7978. {
  7979. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7980. OutputLog.TraceLog(LogPriority.Error,
  7981. this.ToString(),
  7982. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7983. ex.ToString(),
  7984. LocalPath.LogExePath);
  7985. actionResult.Status = (int)Constant.PDAResult.Exception;
  7986. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7987. }
  7988. return actionResult;
  7989. }
  7990. /// <summary>
  7991. /// 获取盘点单明细
  7992. /// </summary>
  7993. /// <param name="sUserInfo"></param>
  7994. /// <returns></returns>
  7995. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7996. {
  7997. ActionResult actionResult = new ActionResult();
  7998. try
  7999. {
  8000. // 验证请求头信息
  8001. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8002. // 验证失败
  8003. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8004. {
  8005. return actionResult;
  8006. }
  8007. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8008. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  8009. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  8010. actionResult.Result = JsonHelper.ToJson(ds);
  8011. actionResult.Status = (int)Constant.PDAResult.Success;
  8012. }
  8013. catch (Exception ex)
  8014. {
  8015. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8016. OutputLog.TraceLog(LogPriority.Error,
  8017. this.ToString(),
  8018. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8019. ex.ToString(),
  8020. LocalPath.LogExePath);
  8021. actionResult.Status = (int)Constant.PDAResult.Exception;
  8022. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8023. }
  8024. return actionResult;
  8025. }
  8026. #endregion
  8027. #region 模具盘点
  8028. /// <summary>
  8029. /// 获取模具盘点单列表
  8030. /// </summary>
  8031. /// <param name="sUserInfo"></param>
  8032. /// <returns></returns>
  8033. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  8034. {
  8035. ActionResult actionResult = new ActionResult();
  8036. try
  8037. {
  8038. // 验证请求头信息
  8039. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8040. // 验证失败
  8041. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8042. {
  8043. return actionResult;
  8044. }
  8045. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  8046. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  8047. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8048. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  8049. actionResult.Result = JsonHelper.ToJson(ds);
  8050. actionResult.Status = (int)Constant.PDAResult.Success;
  8051. }
  8052. catch (Exception ex)
  8053. {
  8054. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8055. OutputLog.TraceLog(LogPriority.Error,
  8056. this.ToString(),
  8057. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8058. ex.ToString(),
  8059. LocalPath.LogExePath);
  8060. actionResult.Status = (int)Constant.PDAResult.Exception;
  8061. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8062. }
  8063. return actionResult;
  8064. }
  8065. /// <summary>
  8066. /// 进行盘点操作
  8067. /// </summary>
  8068. /// <param name="accountCode"></param>
  8069. /// <param name="userCode"></param>
  8070. /// <param name="userPassword"></param>
  8071. /// <param name="sessionKey"></param>
  8072. /// <param name="InCheckedID">盘点单ID</param>
  8073. /// <param name="BarCode">产品条码</param>
  8074. /// <returns></returns>
  8075. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  8076. {
  8077. ActionResult actionResult = new ActionResult();
  8078. try
  8079. {
  8080. // 验证请求头信息
  8081. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8082. // 验证失败
  8083. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8084. {
  8085. return actionResult;
  8086. }
  8087. ClientRequestEntity cre = new ClientRequestEntity();
  8088. cre.Properties["CheckedID"] = CheckedID;
  8089. cre.Properties["Barcode"] = BarCode;
  8090. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  8091. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  8092. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  8093. {
  8094. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8095. actionResult.Status = (int)Constant.PDAResult.Success;
  8096. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  8097. }
  8098. else
  8099. {
  8100. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8101. actionResult.Status = (int)Constant.PDAResult.Fail;
  8102. actionResult.Message = returnValue.Message;
  8103. }
  8104. }
  8105. catch (Exception ex)
  8106. {
  8107. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8108. OutputLog.TraceLog(LogPriority.Error,
  8109. this.ToString(),
  8110. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8111. ex.ToString(),
  8112. LocalPath.LogExePath);
  8113. actionResult.Status = (int)Constant.PDAResult.Exception;
  8114. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8115. }
  8116. return actionResult;
  8117. }
  8118. /// <summary>
  8119. /// 获取盘点单明细
  8120. /// </summary>
  8121. /// <param name="sUserInfo"></param>
  8122. /// <returns></returns>
  8123. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  8124. {
  8125. ActionResult actionResult = new ActionResult();
  8126. try
  8127. {
  8128. // 验证请求头信息
  8129. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8130. // 验证失败
  8131. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8132. {
  8133. return actionResult;
  8134. }
  8135. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8136. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  8137. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  8138. actionResult.Result = JsonHelper.ToJson(ds);
  8139. actionResult.Status = (int)Constant.PDAResult.Success;
  8140. }
  8141. catch (Exception ex)
  8142. {
  8143. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8144. OutputLog.TraceLog(LogPriority.Error,
  8145. this.ToString(),
  8146. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8147. ex.ToString(),
  8148. LocalPath.LogExePath);
  8149. actionResult.Status = (int)Constant.PDAResult.Exception;
  8150. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8151. }
  8152. return actionResult;
  8153. }
  8154. #endregion
  8155. #region 通用接口
  8156. /// <summary>
  8157. /// PDA调用通用接口
  8158. /// </summary>
  8159. /// <param name="accountCode"></param>
  8160. /// <param name="userCode"></param>
  8161. /// <param name="userPassword"></param>
  8162. /// <param name="sessionKey"></param>
  8163. /// <param name="module"></param>
  8164. /// <param name="action"></param>
  8165. /// <param name="data"></param>
  8166. /// <returns></returns>
  8167. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  8168. string module, string action, string jsonData)
  8169. {
  8170. ActionResult actionResult = null;
  8171. try
  8172. {
  8173. // 验证请求头信息
  8174. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8175. // 验证失败
  8176. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8177. {
  8178. return actionResult;
  8179. }
  8180. actionResult.Status = (int)Constant.PDAResult.Fail;
  8181. Dictionary<string, object> data = null;
  8182. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  8183. {
  8184. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  8185. }
  8186. #region PDA报表
  8187. if (module == "Report")
  8188. {
  8189. // 成型月度结算
  8190. if (action == "GetGroutingSettlementInfo")
  8191. {
  8192. DateTime month = DateTime.Now;
  8193. month = new DateTime(month.Year, month.Month, 1);
  8194. //month = new DateTime(2017, 6, 1);
  8195. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  8196. if (currentMonth != 1)
  8197. {
  8198. month = month.AddMonths(-1);
  8199. }
  8200. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  8201. if (sre.Status == Constant.ServiceResultStatus.Success)
  8202. {
  8203. actionResult.Status = (int)Constant.PDAResult.Success;
  8204. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8205. }
  8206. else
  8207. {
  8208. actionResult.Status = (int)Constant.PDAResult.Fail;
  8209. actionResult.Message = sre.Message;
  8210. }
  8211. return actionResult;
  8212. }
  8213. // 成型月度结算-明细
  8214. if (action == "GetGroutingSettlementDetail")
  8215. {
  8216. DateTime month = DateTime.Now;
  8217. month = new DateTime(month.Year, month.Month, 1);
  8218. //month = new DateTime(2017, 6, 1);
  8219. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  8220. if (currentMonth != 1)
  8221. {
  8222. month = month.AddMonths(-1);
  8223. }
  8224. string goodsCode = data["GoodsCode"].ToString();
  8225. string detailDate = data["DetailDate"].ToString();
  8226. DateTime? date = null;
  8227. if (detailDate != "合计")
  8228. {
  8229. date = DateTime.Parse(detailDate);
  8230. }
  8231. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  8232. if (sre.Status == Constant.ServiceResultStatus.Success)
  8233. {
  8234. actionResult.Status = (int)Constant.PDAResult.Success;
  8235. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8236. }
  8237. else
  8238. {
  8239. actionResult.Status = (int)Constant.PDAResult.Fail;
  8240. actionResult.Message = sre.Message;
  8241. }
  8242. return actionResult;
  8243. }
  8244. // 产成品交接汇总
  8245. if (action == "GetFinishedProductHandoverSum")
  8246. {
  8247. DateTime date = DateTime.Parse(data["date"].ToString());
  8248. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  8249. data["goodscode"] as string, sUserInfo);
  8250. if (sre.Status == Constant.ServiceResultStatus.Success)
  8251. {
  8252. actionResult.Status = (int)Constant.PDAResult.Success;
  8253. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8254. }
  8255. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  8256. {
  8257. actionResult.Status = (int)Constant.PDAResult.Success;
  8258. }
  8259. else
  8260. {
  8261. actionResult.Status = (int)Constant.PDAResult.Fail;
  8262. actionResult.Message = sre.Message;
  8263. }
  8264. return actionResult;
  8265. }
  8266. //xuwei add 2019-10-21
  8267. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  8268. if (action == "GetSemiReworkDayCount")
  8269. {
  8270. //不指定参数查询当天
  8271. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  8272. //dateStr = "2019-10-17";
  8273. //指定参数查询特定日期
  8274. if (data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  8275. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  8276. if (sre.Status == Constant.ServiceResultStatus.Success)
  8277. {
  8278. actionResult.Status = (int)Constant.PDAResult.Success;
  8279. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8280. }
  8281. else
  8282. {
  8283. actionResult.Status = (int)Constant.PDAResult.Fail;
  8284. actionResult.Message = sre.Message;
  8285. }
  8286. return actionResult;
  8287. }
  8288. //xuwe end
  8289. return actionResult;
  8290. }
  8291. #endregion
  8292. #region 模具管理
  8293. if (module == "PC_Mould")
  8294. {
  8295. #region 模具新建画面数据初始化
  8296. if (action == "GetMouldAddInit")
  8297. {
  8298. ClientRequestEntity cre = new ClientRequestEntity();
  8299. cre.Properties["MouldID"] = 0;
  8300. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  8301. if (sre.Status == Constant.ServiceResultStatus.Success)
  8302. {
  8303. actionResult.Status = (int)Constant.PDAResult.Success;
  8304. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8305. }
  8306. else
  8307. {
  8308. actionResult.Status = (int)Constant.PDAResult.Fail;
  8309. actionResult.Message = sre.Message;
  8310. }
  8311. return actionResult;
  8312. }
  8313. #endregion
  8314. #region 验证模具产品型号
  8315. if (action == "CheckGoodsCodeOnMould")
  8316. {
  8317. ClientRequestEntity cre = new ClientRequestEntity();
  8318. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8319. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  8320. if (sre.Status == Constant.ServiceResultStatus.Success &&
  8321. sre.Data.Tables[0].Rows.Count > 0)
  8322. {
  8323. actionResult.Status = (int)Constant.PDAResult.Success;
  8324. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8325. }
  8326. else
  8327. {
  8328. actionResult.Status = (int)Constant.PDAResult.Fail;
  8329. actionResult.Message = "无效产品型号";
  8330. }
  8331. return actionResult;
  8332. }
  8333. #endregion
  8334. #region 验证模具生产工号
  8335. if (action == "CheckUserCodeOnMould")
  8336. {
  8337. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  8338. if (sre != null && sre.Rows.Count > 0)
  8339. {
  8340. actionResult.Status = (int)Constant.PDAResult.Success;
  8341. actionResult.Result = JsonHelper.ToJson(sre);
  8342. }
  8343. else
  8344. {
  8345. actionResult.Status = (int)Constant.PDAResult.Fail;
  8346. actionResult.Message = "无效生产工号";
  8347. }
  8348. return actionResult;
  8349. }
  8350. #endregion
  8351. #region 新建保存
  8352. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  8353. {
  8354. ClientRequestEntity cre = new ClientRequestEntity();
  8355. foreach (string item in data.Keys)
  8356. {
  8357. if (item == "ProductionDate")
  8358. {
  8359. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  8360. }
  8361. else
  8362. {
  8363. cre.Properties.Add(item, data[item]);
  8364. }
  8365. }
  8366. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  8367. if (sre.Status == Constant.ServiceResultStatus.Success)
  8368. {
  8369. actionResult.Status = (int)Constant.PDAResult.Success;
  8370. }
  8371. else
  8372. {
  8373. actionResult.Status = (int)Constant.PDAResult.Fail;
  8374. actionResult.Result = sre.OtherStatus;
  8375. actionResult.Message = sre.Message;
  8376. }
  8377. return actionResult;
  8378. }
  8379. #endregion
  8380. #region 模具编辑画面数据初始化
  8381. if (action == "GetMouldEditInfo")
  8382. {
  8383. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  8384. if (sre != null && sre.Rows.Count > 0)
  8385. {
  8386. actionResult.Status = (int)Constant.PDAResult.Success;
  8387. actionResult.Result = JsonHelper.ToJson(sre);
  8388. }
  8389. else
  8390. {
  8391. actionResult.Status = (int)Constant.PDAResult.Fail;
  8392. actionResult.Message = "无效模具条码";
  8393. }
  8394. return actionResult;
  8395. }
  8396. #endregion
  8397. #region 模具操作-画面初始化
  8398. if (action == "GetMouldOperationInit")
  8399. {
  8400. ClientRequestEntity cre = new ClientRequestEntity();
  8401. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8402. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8403. if (sre.Status == Constant.ServiceResultStatus.Success)
  8404. {
  8405. actionResult.Status = (int)Constant.PDAResult.Success;
  8406. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8407. }
  8408. else
  8409. {
  8410. actionResult.Status = (int)Constant.PDAResult.Fail;
  8411. actionResult.Result = sre.OtherStatus;
  8412. actionResult.Message = sre.Message;
  8413. }
  8414. return actionResult;
  8415. }
  8416. #endregion
  8417. #region 模具操作-验证模具条码
  8418. if (action == "CheckMouldBarcode")
  8419. {
  8420. ClientRequestEntity cre = new ClientRequestEntity();
  8421. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8422. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8423. if (sre.Status == Constant.ServiceResultStatus.Success)
  8424. {
  8425. if (sre.Data.Tables[0].Rows.Count == 0)
  8426. {
  8427. actionResult.Status = (int)Constant.PDAResult.Fail;
  8428. actionResult.Result = -1;
  8429. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8430. return actionResult;
  8431. }
  8432. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8433. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8434. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8435. #region 报损
  8436. if (mouldOperationType == 2)
  8437. {
  8438. if (mouldStatusID == 1 || mouldStatusID == 3)
  8439. {
  8440. actionResult.Status = (int)Constant.PDAResult.Success;
  8441. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8442. }
  8443. else
  8444. {
  8445. actionResult.Status = (int)Constant.PDAResult.Fail;
  8446. actionResult.Result = -2;
  8447. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8448. }
  8449. return actionResult;
  8450. }
  8451. #endregion
  8452. #region 撤销
  8453. if (mouldOperationType == 3)
  8454. {
  8455. if (mouldStatusID == 4)
  8456. {
  8457. actionResult.Status = (int)Constant.PDAResult.Success;
  8458. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8459. }
  8460. else
  8461. {
  8462. actionResult.Status = (int)Constant.PDAResult.Fail;
  8463. actionResult.Result = -2;
  8464. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  8465. }
  8466. return actionResult;
  8467. }
  8468. #endregion
  8469. #region 领用
  8470. if (mouldOperationType == 4)
  8471. {
  8472. if (mouldStatusID == 1)
  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 == 5)
  8488. {
  8489. if (mouldStatusID == 3)
  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 == -1)
  8505. {
  8506. if (mouldStatusID != 4)
  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 == -2)
  8522. {
  8523. actionResult.Status = (int)Constant.PDAResult.Success;
  8524. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8525. return actionResult;
  8526. }
  8527. #endregion
  8528. return actionResult;
  8529. }
  8530. }
  8531. #endregion
  8532. #region 模具操作-保存
  8533. if (action == "SetMouldOperation")
  8534. {
  8535. ClientRequestEntity cre = new ClientRequestEntity();
  8536. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8537. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8538. cre.Properties["Remarks"] = data["Remarks"];
  8539. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8540. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8541. {
  8542. cre.Properties["GoodsID"] = data["GoodsID"];
  8543. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8544. }
  8545. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8546. {
  8547. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8548. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8549. }
  8550. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8551. if (sre.Status == Constant.ServiceResultStatus.Success)
  8552. {
  8553. actionResult.Status = (int)Constant.PDAResult.Success;
  8554. }
  8555. else
  8556. {
  8557. actionResult.Status = (int)Constant.PDAResult.Fail;
  8558. }
  8559. return actionResult;
  8560. }
  8561. #endregion
  8562. #region 模具操作-替换条码
  8563. if (action == "ChangedMouldBarcode")
  8564. {
  8565. ClientRequestEntity cre = new ClientRequestEntity();
  8566. cre.Properties["MouldID"] = data["MouldID"];
  8567. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8568. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8569. cre.Properties["Remarks"] = data["Remarks"];
  8570. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8571. if (sre.Status == Constant.ServiceResultStatus.Success)
  8572. {
  8573. actionResult.Status = (int)Constant.PDAResult.Success;
  8574. }
  8575. else
  8576. {
  8577. actionResult.Status = (int)Constant.PDAResult.Fail;
  8578. actionResult.Result = sre.OtherStatus;
  8579. actionResult.Message = sre.Message;
  8580. }
  8581. return actionResult;
  8582. }
  8583. #endregion
  8584. #region 模具跟踪表
  8585. if (action == "GetMoldTracking")
  8586. {
  8587. ClientRequestEntity cre = new ClientRequestEntity();
  8588. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8589. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8590. if (sre.Status == Constant.ServiceResultStatus.Success)
  8591. {
  8592. actionResult.Status = (int)Constant.PDAResult.Success;
  8593. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8594. }
  8595. else
  8596. {
  8597. actionResult.Status = (int)Constant.PDAResult.Fail;
  8598. actionResult.Message = "此模具条码不存在";
  8599. }
  8600. return actionResult;
  8601. }
  8602. #endregion
  8603. return actionResult;
  8604. }
  8605. #endregion
  8606. #region 成型线模具管理
  8607. if (module == "PC_GroutingLineMould")
  8608. {
  8609. #region 获取当前用户成型线模具管理权限
  8610. if (action == "GetGMouldStatusRight")
  8611. {
  8612. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8613. actionResult.Status = (int)Constant.PDAResult.Success;
  8614. if (right != null && right.Rows.Count > 0)
  8615. {
  8616. actionResult.Result = JsonHelper.ToJson(right);
  8617. }
  8618. return actionResult;
  8619. }
  8620. #endregion
  8621. #region 获取成型线状态等信息,和成型模具信息
  8622. if (action == "GetGroutingLineMould")
  8623. {
  8624. int? groutingLineID = null;
  8625. string groutingLineCode = null;
  8626. if (data.ContainsKey("GroutingLineID"))
  8627. {
  8628. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8629. }
  8630. else
  8631. {
  8632. groutingLineCode = data["GroutingLineCode"] + "";
  8633. }
  8634. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8635. if (lineInfo == null)
  8636. {
  8637. actionResult.Status = (int)Constant.PDAResult.Fail;
  8638. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8639. }
  8640. else
  8641. {
  8642. actionResult.Status = (int)Constant.PDAResult.Success;
  8643. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8644. }
  8645. return actionResult;
  8646. }
  8647. #endregion
  8648. #region 模具操作-画面初始化
  8649. if (action == "GetMouldOperationInit")
  8650. {
  8651. ClientRequestEntity cre = new ClientRequestEntity();
  8652. cre.Properties["MouldOperationType"] = 2;
  8653. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8654. if (sre.Status == Constant.ServiceResultStatus.Success)
  8655. {
  8656. actionResult.Status = (int)Constant.PDAResult.Success;
  8657. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8658. }
  8659. else
  8660. {
  8661. actionResult.Status = (int)Constant.PDAResult.Fail;
  8662. actionResult.Result = sre.OtherStatus;
  8663. actionResult.Message = sre.Message;
  8664. }
  8665. return actionResult;
  8666. }
  8667. #endregion
  8668. #region 成型模具操作-画面初始化
  8669. if (action == "GetGroutingMouldOperationInit")
  8670. {
  8671. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8672. if (initData != null && initData.Rows.Count > 0)
  8673. {
  8674. actionResult.Status = (int)Constant.PDAResult.Success;
  8675. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8676. foreach (DataRow item in initData.Rows)
  8677. {
  8678. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8679. }
  8680. actionResult.Result = JsonHelper.ToJson(syssetting);
  8681. }
  8682. else
  8683. {
  8684. actionResult.Status = (int)Constant.PDAResult.Fail;
  8685. }
  8686. return actionResult;
  8687. }
  8688. #endregion
  8689. #region 模具操作-验证模具条码
  8690. if (action == "CheckMouldBarcode")
  8691. {
  8692. ClientRequestEntity cre = new ClientRequestEntity();
  8693. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8694. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8695. if (sre.Status == Constant.ServiceResultStatus.Success)
  8696. {
  8697. if (sre.Data.Tables[0].Rows.Count == 0)
  8698. {
  8699. actionResult.Status = (int)Constant.PDAResult.Fail;
  8700. actionResult.Result = -1;
  8701. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8702. return actionResult;
  8703. }
  8704. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8705. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8706. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8707. #region 上线
  8708. if (mouldOperationType == 6)
  8709. {
  8710. if (mouldStatusID == 1 || mouldStatusID == 3)
  8711. {
  8712. if (data.ContainsKey("GoodsID"))
  8713. {
  8714. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8715. {
  8716. actionResult.Status = (int)Constant.PDAResult.Fail;
  8717. actionResult.Result = -3;
  8718. actionResult.Message =
  8719. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8720. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8721. "】与当前不一致";
  8722. return actionResult;
  8723. }
  8724. }
  8725. actionResult.Status = (int)Constant.PDAResult.Success;
  8726. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8727. }
  8728. else
  8729. {
  8730. actionResult.Status = (int)Constant.PDAResult.Fail;
  8731. actionResult.Result = -2;
  8732. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8733. }
  8734. return actionResult;
  8735. }
  8736. #endregion
  8737. return actionResult;
  8738. }
  8739. }
  8740. #endregion
  8741. #region 停用
  8742. if (action == "StopGroutingLineDetail")
  8743. {
  8744. if (data == null || !data.ContainsKey("Details"))
  8745. {
  8746. actionResult.Status = (int)Constant.PDAResult.Fail;
  8747. actionResult.Message = "参数错误";
  8748. return actionResult;
  8749. }
  8750. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8751. DataTable gTable = new DataTable();
  8752. gTable.Columns.Add("GroutingLineID", typeof(int));
  8753. gTable.Columns.Add("GroutingLineCode");
  8754. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8755. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8756. gTable.Columns.Add("GroutingMouldCode");
  8757. gTable.Columns.Add("RecordRemarks");
  8758. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8759. gTable.Columns.Add("MouldID", typeof(int));
  8760. gTable.Columns.Add("MouldCode");
  8761. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8762. string groutingLineCode = data["GroutingLineCode"] + "";
  8763. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8764. foreach (Dictionary<string, object> item in details)
  8765. {
  8766. int? mouldID = null;
  8767. if (item.ContainsKey("MouldID"))
  8768. {
  8769. mouldID = Convert.ToInt32(item["MouldID"]);
  8770. if (mouldID == 0)
  8771. {
  8772. mouldID = null;
  8773. }
  8774. }
  8775. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8776. item["GLineDetailID"], item["GLineDetailCode"],
  8777. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8778. mouldID, item["MouldCode"]);
  8779. }
  8780. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8781. if (result > 0)
  8782. {
  8783. actionResult.Status = (int)Constant.PDAResult.Success;
  8784. }
  8785. else
  8786. {
  8787. actionResult.Status = (int)Constant.PDAResult.Fail;
  8788. actionResult.Result = result;
  8789. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8790. return actionResult;
  8791. }
  8792. return actionResult;
  8793. }
  8794. #endregion
  8795. #region 启用
  8796. if (action == "StartGroutingLineDetail")
  8797. {
  8798. if (data == null || !data.ContainsKey("Details"))
  8799. {
  8800. actionResult.Status = (int)Constant.PDAResult.Fail;
  8801. actionResult.Message = "参数错误";
  8802. return actionResult;
  8803. }
  8804. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8805. DataTable gTable = new DataTable();
  8806. gTable.Columns.Add("GroutingLineID", typeof(int));
  8807. gTable.Columns.Add("GroutingLineCode");
  8808. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8809. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8810. gTable.Columns.Add("GroutingMouldCode");
  8811. gTable.Columns.Add("RecordRemarks");
  8812. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8813. gTable.Columns.Add("MouldID", typeof(int));
  8814. gTable.Columns.Add("MouldCode");
  8815. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8816. string groutingLineCode = data["GroutingLineCode"] + "";
  8817. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8818. foreach (Dictionary<string, object> item in details)
  8819. {
  8820. int? mouldID = null;
  8821. if (item.ContainsKey("MouldID"))
  8822. {
  8823. mouldID = Convert.ToInt32(item["MouldID"]);
  8824. if (mouldID == 0)
  8825. {
  8826. mouldID = null;
  8827. }
  8828. }
  8829. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8830. item["GLineDetailID"], item["GLineDetailCode"],
  8831. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8832. mouldID, item["MouldCode"]);
  8833. }
  8834. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8835. if (result > 0)
  8836. {
  8837. actionResult.Status = (int)Constant.PDAResult.Success;
  8838. }
  8839. else
  8840. {
  8841. actionResult.Status = (int)Constant.PDAResult.Fail;
  8842. actionResult.Result = result;
  8843. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8844. return actionResult;
  8845. }
  8846. return actionResult;
  8847. }
  8848. #endregion
  8849. #region 维修
  8850. if (action == "RepairStartGroutingLineDetail")
  8851. {
  8852. if (data == null || !data.ContainsKey("Details"))
  8853. {
  8854. actionResult.Status = (int)Constant.PDAResult.Fail;
  8855. actionResult.Message = "参数错误";
  8856. return actionResult;
  8857. }
  8858. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8859. DataTable gTable = new DataTable();
  8860. gTable.Columns.Add("GroutingLineID", typeof(int));
  8861. gTable.Columns.Add("GroutingLineCode");
  8862. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8863. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8864. gTable.Columns.Add("GroutingMouldCode");
  8865. gTable.Columns.Add("RecordRemarks");
  8866. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8867. gTable.Columns.Add("MouldID", typeof(int));
  8868. gTable.Columns.Add("MouldCode");
  8869. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8870. string groutingLineCode = data["GroutingLineCode"] + "";
  8871. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8872. foreach (Dictionary<string, object> item in details)
  8873. {
  8874. int? mouldID = null;
  8875. if (item.ContainsKey("MouldID"))
  8876. {
  8877. mouldID = Convert.ToInt32(item["MouldID"]);
  8878. if (mouldID == 0)
  8879. {
  8880. mouldID = null;
  8881. }
  8882. }
  8883. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8884. item["GLineDetailID"], item["GLineDetailCode"],
  8885. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8886. mouldID, item["MouldCode"]);
  8887. }
  8888. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8889. if (result > 0)
  8890. {
  8891. actionResult.Status = (int)Constant.PDAResult.Success;
  8892. }
  8893. else
  8894. {
  8895. actionResult.Status = (int)Constant.PDAResult.Fail;
  8896. actionResult.Result = result;
  8897. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8898. return actionResult;
  8899. }
  8900. return actionResult;
  8901. }
  8902. #endregion
  8903. #region 结束维修
  8904. if (action == "RepairEndGroutingLineDetail")
  8905. {
  8906. if (data == null || !data.ContainsKey("Details"))
  8907. {
  8908. actionResult.Status = (int)Constant.PDAResult.Fail;
  8909. actionResult.Message = "参数错误";
  8910. return actionResult;
  8911. }
  8912. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8913. DataTable gTable = new DataTable();
  8914. gTable.Columns.Add("GroutingLineID", typeof(int));
  8915. gTable.Columns.Add("GroutingLineCode");
  8916. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8917. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8918. gTable.Columns.Add("GroutingMouldCode");
  8919. gTable.Columns.Add("RecordRemarks");
  8920. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8921. gTable.Columns.Add("MouldID", typeof(int));
  8922. gTable.Columns.Add("MouldCode");
  8923. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8924. string groutingLineCode = data["GroutingLineCode"] + "";
  8925. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8926. foreach (Dictionary<string, object> item in details)
  8927. {
  8928. int? mouldID = null;
  8929. if (item.ContainsKey("MouldID"))
  8930. {
  8931. mouldID = Convert.ToInt32(item["MouldID"]);
  8932. if (mouldID == 0)
  8933. {
  8934. mouldID = null;
  8935. }
  8936. }
  8937. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8938. item["GLineDetailID"], item["GLineDetailCode"],
  8939. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8940. mouldID, item["MouldCode"]);
  8941. }
  8942. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8943. if (result > 0)
  8944. {
  8945. actionResult.Status = (int)Constant.PDAResult.Success;
  8946. }
  8947. else
  8948. {
  8949. actionResult.Status = (int)Constant.PDAResult.Fail;
  8950. actionResult.Result = result;
  8951. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8952. return actionResult;
  8953. }
  8954. return actionResult;
  8955. }
  8956. #endregion
  8957. #region 换模
  8958. if (action == "ChangeGMouldStartGroutingLineDetail")
  8959. {
  8960. if (data == null || !data.ContainsKey("Details"))
  8961. {
  8962. actionResult.Status = (int)Constant.PDAResult.Fail;
  8963. actionResult.Message = "参数错误";
  8964. return actionResult;
  8965. }
  8966. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8967. DataTable gTable = new DataTable();
  8968. gTable.Columns.Add("GroutingLineID", typeof(int));
  8969. gTable.Columns.Add("GroutingLineCode");
  8970. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8971. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8972. gTable.Columns.Add("GroutingMouldCode");
  8973. gTable.Columns.Add("RecordRemarks");
  8974. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8975. gTable.Columns.Add("MouldID", typeof(int));
  8976. gTable.Columns.Add("MouldCode");
  8977. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8978. gTable.Columns.Add("MouldStatus", typeof(int));
  8979. gTable.Columns.Add("ScrapReason", typeof(int));
  8980. gTable.Columns.Add("ScrapResponsibility");
  8981. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8982. string groutingLineCode = data["GroutingLineCode"] + "";
  8983. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8984. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8985. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8986. string scrapResponsibility = data["ScrapRemarks"] + "";
  8987. foreach (Dictionary<string, object> item in details)
  8988. {
  8989. int? mouldID = null;
  8990. if (item.ContainsKey("MouldID"))
  8991. {
  8992. mouldID = Convert.ToInt32(item["MouldID"]);
  8993. if (mouldID == 0)
  8994. {
  8995. mouldID = null;
  8996. }
  8997. }
  8998. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8999. item["GLineDetailID"], item["GLineDetailCode"],
  9000. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9001. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9002. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9003. }
  9004. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  9005. if (result > 0)
  9006. {
  9007. actionResult.Status = (int)Constant.PDAResult.Success;
  9008. }
  9009. else
  9010. {
  9011. actionResult.Status = (int)Constant.PDAResult.Fail;
  9012. actionResult.Result = result;
  9013. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9014. return actionResult;
  9015. }
  9016. return actionResult;
  9017. }
  9018. #endregion
  9019. #region 变产
  9020. if (action == "UpdateLineStartGroutingLineDetail")
  9021. {
  9022. if (data == null || !data.ContainsKey("Details"))
  9023. {
  9024. actionResult.Status = (int)Constant.PDAResult.Fail;
  9025. actionResult.Message = "参数错误";
  9026. return actionResult;
  9027. }
  9028. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9029. DataTable gTable = new DataTable();
  9030. gTable.Columns.Add("GroutingLineID", typeof(int));
  9031. gTable.Columns.Add("GroutingLineCode");
  9032. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9033. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9034. gTable.Columns.Add("GroutingMouldCode");
  9035. gTable.Columns.Add("RecordRemarks");
  9036. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9037. gTable.Columns.Add("MouldID", typeof(int));
  9038. gTable.Columns.Add("MouldCode");
  9039. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9040. gTable.Columns.Add("MouldStatus", typeof(int));
  9041. gTable.Columns.Add("ScrapReason", typeof(int));
  9042. gTable.Columns.Add("ScrapResponsibility");
  9043. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9044. string groutingLineCode = data["GroutingLineCode"] + "";
  9045. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9046. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9047. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9048. string scrapResponsibility = data["ScrapRemarks"] + "";
  9049. foreach (Dictionary<string, object> item in details)
  9050. {
  9051. int? mouldID = null;
  9052. if (item.ContainsKey("MouldID"))
  9053. {
  9054. mouldID = Convert.ToInt32(item["MouldID"]);
  9055. if (mouldID == 0)
  9056. {
  9057. mouldID = null;
  9058. }
  9059. }
  9060. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9061. item["GLineDetailID"], item["GLineDetailCode"],
  9062. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9063. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9064. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9065. }
  9066. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  9067. if (result > 0)
  9068. {
  9069. actionResult.Status = (int)Constant.PDAResult.Success;
  9070. }
  9071. else
  9072. {
  9073. actionResult.Status = (int)Constant.PDAResult.Fail;
  9074. actionResult.Result = result;
  9075. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9076. return actionResult;
  9077. }
  9078. return actionResult;
  9079. }
  9080. #endregion
  9081. #region 整线变产
  9082. if (action == "UpdateAllLineStartGroutingLineDetail")
  9083. {
  9084. if (data == null || !data.ContainsKey("Details"))
  9085. {
  9086. actionResult.Status = (int)Constant.PDAResult.Fail;
  9087. actionResult.Message = "参数错误";
  9088. return actionResult;
  9089. }
  9090. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9091. DataTable gTable = new DataTable();
  9092. gTable.Columns.Add("GroutingLineID", typeof(int));
  9093. gTable.Columns.Add("GroutingLineCode");
  9094. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9095. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9096. gTable.Columns.Add("GroutingMouldCode");
  9097. gTable.Columns.Add("RecordRemarks");
  9098. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9099. gTable.Columns.Add("MouldID", typeof(int));
  9100. gTable.Columns.Add("MouldCode");
  9101. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9102. gTable.Columns.Add("MouldStatus", typeof(int));
  9103. gTable.Columns.Add("ScrapReason", typeof(int));
  9104. gTable.Columns.Add("ScrapResponsibility");
  9105. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9106. string groutingLineCode = data["GroutingLineCode"] + "";
  9107. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9108. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9109. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9110. string scrapResponsibility = data["ScrapRemarks"] + "";
  9111. foreach (Dictionary<string, object> item in details)
  9112. {
  9113. int? mouldID = null;
  9114. if (item.ContainsKey("MouldID"))
  9115. {
  9116. mouldID = Convert.ToInt32(item["MouldID"]);
  9117. if (mouldID == 0)
  9118. {
  9119. mouldID = null;
  9120. }
  9121. }
  9122. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9123. item["GLineDetailID"], item["GLineDetailCode"],
  9124. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9125. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9126. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9127. }
  9128. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  9129. if (result > 0)
  9130. {
  9131. actionResult.Status = (int)Constant.PDAResult.Success;
  9132. }
  9133. else
  9134. {
  9135. actionResult.Status = (int)Constant.PDAResult.Fail;
  9136. actionResult.Result = result;
  9137. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9138. return actionResult;
  9139. }
  9140. return actionResult;
  9141. }
  9142. #endregion
  9143. #region 卸模
  9144. if (action == "UnloadGroutingLineDetail")
  9145. {
  9146. if (data == null || !data.ContainsKey("Details"))
  9147. {
  9148. actionResult.Status = (int)Constant.PDAResult.Fail;
  9149. actionResult.Message = "参数错误";
  9150. return actionResult;
  9151. }
  9152. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9153. DataTable gTable = new DataTable();
  9154. gTable.Columns.Add("GroutingLineID", typeof(int));
  9155. gTable.Columns.Add("GroutingLineCode");
  9156. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9157. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9158. gTable.Columns.Add("GroutingMouldCode");
  9159. gTable.Columns.Add("RecordRemarks");
  9160. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9161. gTable.Columns.Add("MouldID", typeof(int));
  9162. gTable.Columns.Add("MouldCode");
  9163. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9164. gTable.Columns.Add("MouldStatus", typeof(int));
  9165. gTable.Columns.Add("ScrapReason", typeof(int));
  9166. gTable.Columns.Add("ScrapResponsibility");
  9167. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9168. string groutingLineCode = data["GroutingLineCode"] + "";
  9169. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9170. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9171. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9172. string scrapResponsibility = data["ScrapRemarks"] + "";
  9173. foreach (Dictionary<string, object> item in details)
  9174. {
  9175. int? mouldID = null;
  9176. if (item.ContainsKey("MouldID"))
  9177. {
  9178. mouldID = Convert.ToInt32(item["MouldID"]);
  9179. if (mouldID == 0)
  9180. {
  9181. mouldID = null;
  9182. }
  9183. }
  9184. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9185. item["GLineDetailID"], item["GLineDetailCode"],
  9186. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9187. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9188. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9189. }
  9190. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  9191. if (result > 0)
  9192. {
  9193. actionResult.Status = (int)Constant.PDAResult.Success;
  9194. }
  9195. else
  9196. {
  9197. actionResult.Status = (int)Constant.PDAResult.Fail;
  9198. actionResult.Result = result;
  9199. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9200. return actionResult;
  9201. }
  9202. return actionResult;
  9203. }
  9204. #endregion
  9205. #region 结束换模
  9206. if (action == "ChangeGMouldEndGroutingLineDetail")
  9207. {
  9208. if (data == null || !data.ContainsKey("Details"))
  9209. {
  9210. actionResult.Status = (int)Constant.PDAResult.Fail;
  9211. actionResult.Message = "参数错误";
  9212. return actionResult;
  9213. }
  9214. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9215. DataTable gTable = new DataTable();
  9216. gTable.Columns.Add("GroutingLineID", typeof(int));
  9217. gTable.Columns.Add("GroutingLineCode");
  9218. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9219. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9220. gTable.Columns.Add("GroutingMouldCode");
  9221. gTable.Columns.Add("RreasonRemarks");
  9222. gTable.Columns.Add("RecordRemarks");
  9223. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9224. gTable.Columns.Add("MouldID", typeof(int));
  9225. gTable.Columns.Add("MouldCode");
  9226. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9227. gTable.Columns.Add("GoodsID", typeof(int));
  9228. gTable.Columns.Add("GoodsCode");
  9229. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9230. gTable.Columns.Add("GroutingCount", typeof(int));
  9231. gTable.Columns.Add("MouldSource");
  9232. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9233. string groutingLineCode = data["GroutingLineCode"] + "";
  9234. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9235. foreach (Dictionary<string, object> item in details)
  9236. {
  9237. int? mouldID = null;
  9238. if (item.ContainsKey("MouldID"))
  9239. {
  9240. mouldID = Convert.ToInt32(item["MouldID"]);
  9241. if (mouldID == 0)
  9242. {
  9243. mouldID = null;
  9244. }
  9245. }
  9246. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9247. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9248. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9249. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9250. item["GoodsID"], item["GoodsCode"],
  9251. item["StandardGroutingCount"], item["GroutingCount"],
  9252. (mouldID == null ? "0" : "1"));
  9253. }
  9254. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  9255. if (result.Status == Constant.ServiceResultStatus.Success)
  9256. {
  9257. actionResult.Status = (int)Constant.PDAResult.Success;
  9258. }
  9259. else if (result.OtherStatus == -100)
  9260. {
  9261. actionResult.Status = (int)Constant.PDAResult.Fail;
  9262. actionResult.Result = -100;
  9263. actionResult.Message = result.Message;
  9264. return actionResult;
  9265. }
  9266. else
  9267. {
  9268. actionResult.Status = (int)Constant.PDAResult.Fail;
  9269. actionResult.Result = -500;
  9270. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9271. return actionResult;
  9272. }
  9273. return actionResult;
  9274. }
  9275. #endregion
  9276. #region 结束变产
  9277. if (action == "UpdateLineEndGroutingLineDetail")
  9278. {
  9279. if (data == null || !data.ContainsKey("Details"))
  9280. {
  9281. actionResult.Status = (int)Constant.PDAResult.Fail;
  9282. actionResult.Message = "参数错误";
  9283. return actionResult;
  9284. }
  9285. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9286. DataTable gTable = new DataTable();
  9287. gTable.Columns.Add("GroutingLineID", typeof(int));
  9288. gTable.Columns.Add("GroutingLineCode");
  9289. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9290. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9291. gTable.Columns.Add("GroutingMouldCode");
  9292. gTable.Columns.Add("RreasonRemarks");
  9293. gTable.Columns.Add("RecordRemarks");
  9294. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9295. gTable.Columns.Add("MouldID", typeof(int));
  9296. gTable.Columns.Add("MouldCode");
  9297. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9298. gTable.Columns.Add("GoodsID", typeof(int));
  9299. gTable.Columns.Add("GoodsCode");
  9300. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9301. gTable.Columns.Add("GroutingCount", typeof(int));
  9302. gTable.Columns.Add("MouldSource");
  9303. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9304. string groutingLineCode = data["GroutingLineCode"] + "";
  9305. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9306. foreach (Dictionary<string, object> item in details)
  9307. {
  9308. int? mouldID = null;
  9309. if (item.ContainsKey("MouldID"))
  9310. {
  9311. mouldID = Convert.ToInt32(item["MouldID"]);
  9312. if (mouldID == 0)
  9313. {
  9314. mouldID = null;
  9315. }
  9316. }
  9317. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9318. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9319. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9320. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9321. item["GoodsID"], item["GoodsCode"],
  9322. item["StandardGroutingCount"], item["GroutingCount"],
  9323. (mouldID == null ? "0" : "1"));
  9324. }
  9325. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  9326. if (result.Status == Constant.ServiceResultStatus.Success)
  9327. {
  9328. actionResult.Status = (int)Constant.PDAResult.Success;
  9329. }
  9330. else if (result.OtherStatus == -100)
  9331. {
  9332. actionResult.Status = (int)Constant.PDAResult.Fail;
  9333. actionResult.Result = -100;
  9334. actionResult.Message = result.Message;
  9335. return actionResult;
  9336. }
  9337. else
  9338. {
  9339. actionResult.Status = (int)Constant.PDAResult.Fail;
  9340. actionResult.Result = -500;
  9341. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9342. return actionResult;
  9343. }
  9344. return actionResult;
  9345. }
  9346. #endregion
  9347. #region 结束整线变产
  9348. if (action == "UpdateAllLineEndGroutingLineDetail")
  9349. {
  9350. if (data == null || !data.ContainsKey("Details"))
  9351. {
  9352. actionResult.Status = (int)Constant.PDAResult.Fail;
  9353. actionResult.Message = "参数错误";
  9354. return actionResult;
  9355. }
  9356. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9357. DataTable gTable = new DataTable();
  9358. gTable.Columns.Add("GroutingLineID", typeof(int));
  9359. gTable.Columns.Add("GroutingLineCode");
  9360. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9361. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9362. gTable.Columns.Add("GroutingMouldCode");
  9363. gTable.Columns.Add("Remarks");
  9364. gTable.Columns.Add("RecordRemarks");
  9365. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9366. gTable.Columns.Add("MouldID", typeof(int));
  9367. gTable.Columns.Add("MouldCode");
  9368. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9369. gTable.Columns.Add("GoodsID", typeof(int));
  9370. gTable.Columns.Add("GoodsCode");
  9371. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9372. gTable.Columns.Add("GroutingCount", typeof(int));
  9373. gTable.Columns.Add("MouldSource");
  9374. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9375. string groutingLineCode = data["GroutingLineCode"] + "";
  9376. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9377. foreach (Dictionary<string, object> item in details)
  9378. {
  9379. int? mouldID = null;
  9380. if (item.ContainsKey("MouldID"))
  9381. {
  9382. mouldID = Convert.ToInt32(item["MouldID"]);
  9383. if (mouldID == 0)
  9384. {
  9385. mouldID = null;
  9386. }
  9387. }
  9388. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9389. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9390. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  9391. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9392. item["GoodsID"], item["GoodsCode"],
  9393. item["StandardGroutingCount"], item["GroutingCount"],
  9394. (mouldID == null ? "0" : "1"));
  9395. }
  9396. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  9397. if (result.Status == Constant.ServiceResultStatus.Success)
  9398. {
  9399. actionResult.Status = (int)Constant.PDAResult.Success;
  9400. }
  9401. else if (result.OtherStatus == -100)
  9402. {
  9403. actionResult.Status = (int)Constant.PDAResult.Fail;
  9404. actionResult.Result = -100;
  9405. actionResult.Message = result.Message;
  9406. return actionResult;
  9407. }
  9408. else
  9409. {
  9410. actionResult.Status = (int)Constant.PDAResult.Fail;
  9411. actionResult.Result = -500;
  9412. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9413. return actionResult;
  9414. }
  9415. return actionResult;
  9416. }
  9417. #endregion
  9418. #region 上模
  9419. if (action == "UpdateGroutingLine_AddMould")
  9420. {
  9421. if (data == null || !data.ContainsKey("Details"))
  9422. {
  9423. actionResult.Status = (int)Constant.PDAResult.Fail;
  9424. actionResult.Message = "参数错误";
  9425. return actionResult;
  9426. }
  9427. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9428. DataTable gTable = new DataTable();
  9429. gTable.Columns.Add("GroutingLineID", typeof(int));
  9430. gTable.Columns.Add("GroutingLineCode");
  9431. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9432. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9433. gTable.Columns.Add("GroutingMouldCode");
  9434. gTable.Columns.Add("Remarks");
  9435. gTable.Columns.Add("RecordRemarks");
  9436. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9437. gTable.Columns.Add("MouldID", typeof(int));
  9438. gTable.Columns.Add("MouldCode");
  9439. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9440. gTable.Columns.Add("GoodsID", typeof(int));
  9441. gTable.Columns.Add("GoodsCode");
  9442. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9443. gTable.Columns.Add("GroutingCount", typeof(int));
  9444. gTable.Columns.Add("MouldSource");
  9445. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9446. string groutingLineCode = data["GroutingLineCode"] + "";
  9447. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9448. foreach (Dictionary<string, object> item in details)
  9449. {
  9450. int? mouldID = null;
  9451. if (item.ContainsKey("MouldID"))
  9452. {
  9453. mouldID = Convert.ToInt32(item["MouldID"]);
  9454. if (mouldID == 0)
  9455. {
  9456. mouldID = null;
  9457. }
  9458. }
  9459. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  9460. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9461. gldID, item["GLineDetailCode"],
  9462. item["DetailRemarks"], item["RecordRemarks"],
  9463. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  9464. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9465. item["GoodsID"], item["GoodsCode"],
  9466. item["StandardGroutingCount"], item["GroutingCount"],
  9467. (mouldID == null ? "0" : "1"));
  9468. }
  9469. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  9470. if (result.Status == Constant.ServiceResultStatus.Success)
  9471. {
  9472. actionResult.Status = (int)Constant.PDAResult.Success;
  9473. }
  9474. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  9475. {
  9476. actionResult.Status = (int)Constant.PDAResult.Fail;
  9477. actionResult.Result = result.OtherStatus;
  9478. actionResult.Message = result.Message;
  9479. return actionResult;
  9480. }
  9481. else if (result.OtherStatus == -10001 || result.OtherStatus == -10002)
  9482. {
  9483. actionResult.Status = -99;
  9484. actionResult.Result = result.OtherStatus;
  9485. actionResult.Message = result.Message;
  9486. return actionResult;
  9487. }
  9488. else
  9489. {
  9490. actionResult.Status = (int)Constant.PDAResult.Fail;
  9491. actionResult.Result = -500;
  9492. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9493. return actionResult;
  9494. }
  9495. return actionResult;
  9496. }
  9497. #endregion
  9498. return actionResult;
  9499. }
  9500. #endregion
  9501. #region 包装装板限制
  9502. if (module == "FinishedLoadingCar")
  9503. {
  9504. if (action == "GetSetting")
  9505. {
  9506. ClientRequestEntity cre = new ClientRequestEntity();
  9507. cre.Properties["GoodsID"] = data["GoodsID"];
  9508. if (data.ContainsKey("logoID"))
  9509. {
  9510. cre.Properties["logoID"] = data["logoID"] + "";
  9511. }
  9512. else
  9513. {
  9514. cre.Properties["logoID"] = "";
  9515. }
  9516. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9517. if (sre.Status == Constant.ServiceResultStatus.Success)
  9518. {
  9519. actionResult.Status = (int)Constant.PDAResult.Success;
  9520. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9521. {
  9522. if (item["settingcode"].ToString() == "S_PM_011")
  9523. {
  9524. cre.Properties["S_PM_011"] = item["settingvalue"];
  9525. }
  9526. else if (item["settingcode"].ToString() == "S_PM_012")
  9527. {
  9528. cre.Properties["S_PM_012"] = item["settingvalue"];
  9529. }
  9530. else if (item["settingcode"].ToString() == "S_PM_013")
  9531. {
  9532. cre.Properties["S_PM_013"] = item["settingvalue"];
  9533. }
  9534. }
  9535. DataTable dt = sre.Result as DataTable;
  9536. cre.Properties["PlatelitNum"] = dt.Rows[0]["PLATELIMITNUM"];
  9537. cre.Properties["PlatelitNumNew"] = dt.Rows[0]["PLATELIMITNUMNEW"];
  9538. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9539. }
  9540. else
  9541. {
  9542. actionResult.Status = (int)Constant.PDAResult.Fail;
  9543. actionResult.Message = "";
  9544. }
  9545. return actionResult;
  9546. }
  9547. }
  9548. #endregion
  9549. #region 成型报损
  9550. if (module == "GroutingScrapProduct")
  9551. {
  9552. // 查询注浆日报明细表
  9553. if ("GetGroutingDailyDetail" == action)
  9554. {
  9555. ClientRequestEntity cre = new ClientRequestEntity();
  9556. cre.NameSpace = module;
  9557. cre.Name = action;
  9558. if (!string.IsNullOrEmpty(jsonData))
  9559. {
  9560. cre.Properties["BarCode"] = data["BarCode"];
  9561. }
  9562. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9563. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9564. actionResult.Status = (int)Constant.PDAResult.Success;
  9565. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9566. || sre.Data.Tables[0].Rows.Count == 0)
  9567. {
  9568. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9569. actionResult.Status = (int)Constant.PDAResult.Fail;
  9570. }
  9571. else
  9572. {
  9573. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9574. // 判断是否进行了注浆
  9575. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9576. {
  9577. actionResult.Message = "该产品还未进行注浆!";
  9578. actionResult.Status = (int)Constant.PDAResult.Fail;
  9579. }
  9580. // 判断是否进行了交坯
  9581. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9582. {
  9583. actionResult.Message = "该产品已经交坯!";
  9584. actionResult.Status = (int)Constant.PDAResult.Fail;
  9585. }
  9586. // 判断是否已经报损
  9587. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9588. {
  9589. actionResult.Message = "该产品已经报损!";
  9590. actionResult.Status = (int)Constant.PDAResult.Fail;
  9591. }
  9592. // 该产品已进入生产工序
  9593. if ("1".Equals(_barCodeRow["beginningflag"]))
  9594. {
  9595. actionResult.Message = "该产品已进入生产工序!";
  9596. actionResult.Status = (int)Constant.PDAResult.Fail;
  9597. }
  9598. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9599. }
  9600. }
  9601. // 获取成型报损原因
  9602. else if ("GetScrapReasonData" == action)
  9603. {
  9604. ClientRequestEntity cre = new ClientRequestEntity();
  9605. cre.NameSpace = module;
  9606. cre.Name = action;
  9607. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo, "1");
  9608. actionResult.Status = (int)Constant.PDAResult.Success;
  9609. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9610. }
  9611. // 保存成型报损
  9612. else if ("SaveGroutingScrapProduct" == action)
  9613. {
  9614. ClientRequestEntity cre = new ClientRequestEntity();
  9615. cre.NameSpace = module;
  9616. cre.Name = action;
  9617. if (!string.IsNullOrEmpty(jsonData))
  9618. {
  9619. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9620. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9621. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9622. if (dt != null && dt.Rows.Count > 0)
  9623. {
  9624. // 总单信息
  9625. DataRow properties = dt.Rows[0];
  9626. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9627. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9628. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9629. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9630. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9631. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9632. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9633. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9634. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9635. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9636. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9637. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9638. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9639. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9640. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9641. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9642. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9643. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9644. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9645. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9646. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9647. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9648. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9649. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9650. // 责任员工
  9651. cre.Data = new DataSet();
  9652. //DataTable returnTable = returnData.Tables[1].Copy();
  9653. cre.Data.Tables.Add(dtResponsible);
  9654. }
  9655. }
  9656. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9657. if (sre.Status == Constant.ServiceResultStatus.Success)
  9658. {
  9659. actionResult.Status = (int)Constant.PDAResult.Success;
  9660. actionResult.Result = sre.Result;
  9661. }
  9662. else
  9663. {
  9664. actionResult.Status = (int)Constant.PDAResult.Fail;
  9665. actionResult.Result = sre.OtherStatus;
  9666. actionResult.Message = sre.Message;
  9667. }
  9668. }
  9669. // 获取成型报损信息 用于撤销使用
  9670. else if ("GetGroutingScrapProduct" == action)
  9671. {
  9672. ClientRequestEntity cre = new ClientRequestEntity();
  9673. cre.NameSpace = module;
  9674. cre.Name = action;
  9675. if (!string.IsNullOrEmpty(jsonData))
  9676. {
  9677. cre.Properties["BarCode"] = data["BarCode"];
  9678. }
  9679. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9680. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9681. actionResult.Status = (int)Constant.PDAResult.Success;
  9682. }
  9683. //xuwei add 2020-03-23
  9684. //获取成型报损信息 用于撤销使用 支持 浆日报直接报损
  9685. else if ("GetGroutingScrap" == action)
  9686. {
  9687. ClientRequestEntity cre = new ClientRequestEntity();
  9688. cre.NameSpace = module;
  9689. cre.Name = action;
  9690. if (!string.IsNullOrEmpty(jsonData))
  9691. {
  9692. cre.Properties["BarCode"] = data["BarCode"];
  9693. }
  9694. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrap(cre, sUserInfo);
  9695. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9696. actionResult.Status = (int)Constant.PDAResult.Success;
  9697. }
  9698. // 撤销成型报损
  9699. else if ("ReverseGroutingScrapProduct" == action)
  9700. {
  9701. ClientRequestEntity cre = new ClientRequestEntity();
  9702. cre.NameSpace = module;
  9703. cre.Name = action;
  9704. if (!string.IsNullOrEmpty(jsonData))
  9705. {
  9706. cre.Properties["BarCode"] = data["BarCode"];
  9707. }
  9708. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9709. if (sre.Status == Constant.ServiceResultStatus.Success)
  9710. {
  9711. actionResult.Status = (int)Constant.PDAResult.Success;
  9712. actionResult.Result = sre.Result;
  9713. }
  9714. else
  9715. {
  9716. actionResult.Status = (int)Constant.PDAResult.Fail;
  9717. actionResult.Result = sre.OtherStatus;
  9718. actionResult.Message = sre.Message;
  9719. }
  9720. }
  9721. }
  9722. #endregion
  9723. #region 产品挂起
  9724. if (module == "ProductSuspend")
  9725. {
  9726. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9727. if (action == "GetSuspendProcedure")
  9728. {
  9729. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9730. if (sre.Status == Constant.ServiceResultStatus.Success)
  9731. {
  9732. actionResult.Status = (int)Constant.PDAResult.Success;
  9733. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9734. }
  9735. else
  9736. {
  9737. actionResult.Status = (int)Constant.PDAResult.Fail;
  9738. actionResult.Message = sre.Message;
  9739. }
  9740. return actionResult;
  9741. }
  9742. // 验证挂起条码
  9743. if (action == "CheckSuspendBarcode")
  9744. {
  9745. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9746. if (sre.Status == Constant.ServiceResultStatus.Success)
  9747. {
  9748. actionResult.Status = (int)Constant.PDAResult.Success;
  9749. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9750. }
  9751. else
  9752. {
  9753. actionResult.Status = (int)Constant.PDAResult.Fail;
  9754. actionResult.Message = sre.Message;
  9755. }
  9756. return actionResult;
  9757. }
  9758. // 挂起条码
  9759. if (action == "SaveSuspendProduct")
  9760. {
  9761. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9762. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9763. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9764. if (sre.Status == Constant.ServiceResultStatus.Success)
  9765. {
  9766. actionResult.Status = (int)Constant.PDAResult.Success;
  9767. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9768. }
  9769. else
  9770. {
  9771. actionResult.Status = (int)Constant.PDAResult.Fail;
  9772. actionResult.Message = sre.Message;
  9773. }
  9774. return actionResult;
  9775. }
  9776. // 撤销挂起条码
  9777. if (action == "DeleteSuspendProduct")
  9778. {
  9779. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9780. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9781. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9782. if (sre.Status == Constant.ServiceResultStatus.Success)
  9783. {
  9784. actionResult.Status = (int)Constant.PDAResult.Success;
  9785. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9786. }
  9787. else
  9788. {
  9789. actionResult.Status = (int)Constant.PDAResult.Fail;
  9790. actionResult.Message = sre.Message;
  9791. }
  9792. return actionResult;
  9793. }
  9794. // 查询挂起条码
  9795. if (action == "GetSuspendProduct")
  9796. {
  9797. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9798. if (sre.Status == Constant.ServiceResultStatus.Success)
  9799. {
  9800. if (sre.Data.Tables[0].Rows.Count == 0)
  9801. {
  9802. actionResult.Status = (int)Constant.PDAResult.Fail;
  9803. actionResult.Message = "此条码没有可撤销的挂起信息";
  9804. }
  9805. else
  9806. {
  9807. actionResult.Status = (int)Constant.PDAResult.Success;
  9808. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9809. }
  9810. }
  9811. else
  9812. {
  9813. actionResult.Status = (int)Constant.PDAResult.Fail;
  9814. actionResult.Message = sre.Message;
  9815. }
  9816. return actionResult;
  9817. }
  9818. }
  9819. #endregion
  9820. #region 品保抽查
  9821. if (module == "QASpotCheck")
  9822. {
  9823. if (action == "GetAllQASpotCheck")
  9824. {
  9825. ClientRequestEntity cre = new ClientRequestEntity();
  9826. cre.NameSpace = module;
  9827. cre.Name = action;
  9828. if (data != null && data.Count > 0)
  9829. {
  9830. foreach (string item in data.Keys)
  9831. {
  9832. if (item.StartsWith("checktime"))
  9833. {
  9834. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9835. }
  9836. else
  9837. {
  9838. cre.Properties.Add(item, data[item]);
  9839. }
  9840. }
  9841. }
  9842. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9843. if (sre.Status == Constant.ServiceResultStatus.Success)
  9844. {
  9845. actionResult.Status = (int)Constant.PDAResult.Success;
  9846. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9847. }
  9848. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9849. {
  9850. actionResult.Status = (int)Constant.PDAResult.Success;
  9851. }
  9852. else
  9853. {
  9854. actionResult.Status = (int)Constant.PDAResult.Fail;
  9855. actionResult.Message = sre.Message;
  9856. }
  9857. return actionResult;
  9858. }
  9859. if (action == "AutoSaveQASpotCheck")
  9860. {
  9861. string barcode = data["barcode"] + "";
  9862. string remarks = data["remarks"] + "";
  9863. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9864. if (sre.Status == Constant.ServiceResultStatus.Success)
  9865. {
  9866. actionResult.Status = (int)Constant.PDAResult.Success;
  9867. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9868. }
  9869. else
  9870. {
  9871. actionResult.Status = (int)Constant.PDAResult.Fail;
  9872. actionResult.Message = sre.Message;
  9873. }
  9874. return actionResult;
  9875. }
  9876. if (action == "CheckQASpotCheck")
  9877. {
  9878. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9879. if (sre.Status == Constant.ServiceResultStatus.Success)
  9880. {
  9881. actionResult.Status = (int)Constant.PDAResult.Success;
  9882. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9883. }
  9884. else
  9885. {
  9886. actionResult.Status = (int)Constant.PDAResult.Fail;
  9887. actionResult.Message = sre.Message;
  9888. }
  9889. return actionResult;
  9890. }
  9891. if (action == "SaveQASpotCheck")
  9892. {
  9893. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9894. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9895. if (sre.Status == Constant.ServiceResultStatus.Success)
  9896. {
  9897. actionResult.Status = (int)Constant.PDAResult.Success;
  9898. }
  9899. else
  9900. {
  9901. actionResult.Status = (int)Constant.PDAResult.Fail;
  9902. actionResult.Message = sre.Message;
  9903. }
  9904. return actionResult;
  9905. }
  9906. return null;
  9907. }
  9908. #endregion
  9909. #region 产成品交接
  9910. if (module == "FinishedProduct")
  9911. {
  9912. #region 产成品交接、整板撤销 by fubin 20200824
  9913. // 交接验证
  9914. if (action == "FinishedHandoverBarcode")
  9915. {
  9916. string barcode = data["Barcode"] + "";
  9917. ServiceResultEntity sre = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo);
  9918. if (sre.Data != null && sre.Data.Tables.Count > 0)
  9919. {
  9920. actionResult.Status = (int)Constant.PDAResult.Success;
  9921. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9922. actionResult.Message = sre.Message;
  9923. }
  9924. else
  9925. {
  9926. actionResult.Status = (int)Constant.PDAResult.Fail;
  9927. actionResult.Message = sre.Message;
  9928. }
  9929. return actionResult;
  9930. }
  9931. // 交接操作
  9932. if (action == "SaveFinishedHandover")
  9933. {
  9934. int orderID = Convert.ToInt32(data["OrderID"]);
  9935. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9936. //切换sap地址 by fy 2022年7月5日09:15:23 开始
  9937. //ServiceResultEntity sre = PMModuleLogicDAL.SaveFinishedHandover(orderID, dt, sUserInfo);
  9938. string sapName = "";
  9939. if (data.ContainsKey("SPANAME") && data["SPANAME"] is object &&
  9940. (data["SPANAME"].Equals("APP1") || data["SPANAME"].Equals("APP2") || data["SPANAME"].Equals("APP3")))
  9941. {
  9942. sapName = "_" + data["SPANAME"].ToString();
  9943. }
  9944. else
  9945. {
  9946. sapName = "";
  9947. }
  9948. ServiceResultEntity sre = PMModuleLogicDAL.SaveFinishedHandover(orderID, dt, sUserInfo, sapName);
  9949. //结束
  9950. if (Convert.ToInt32(sre.Result) > 0)
  9951. {
  9952. actionResult.Status = (int)Constant.PDAResult.Success;
  9953. actionResult.Message = "产成品交接成功";
  9954. }
  9955. else
  9956. {
  9957. actionResult.Status = (int)Constant.PDAResult.Fail;
  9958. actionResult.Message = sre.Message;
  9959. }
  9960. return actionResult;
  9961. }
  9962. // 撤销交接验证
  9963. if (action == "BackFinishedHandoverCheck")
  9964. {
  9965. string barcode = data["Barcode"] + "";
  9966. ServiceResultEntity sre = PMModuleLogic.BackFinishedHandoverCheck(barcode, sUserInfo);
  9967. if (sre.Data != null && sre.Data.Tables.Count > 0)
  9968. {
  9969. actionResult.Status = (int)Constant.PDAResult.Success;
  9970. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9971. actionResult.Message = sre.Message;
  9972. }
  9973. else
  9974. {
  9975. actionResult.Status = (int)Constant.PDAResult.Fail;
  9976. actionResult.Message = sre.Message;
  9977. }
  9978. return actionResult;
  9979. }
  9980. // 撤销交接操作
  9981. if (action == "BackFinishedHandover")
  9982. {
  9983. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9984. ServiceResultEntity sre = PMModuleLogicDAL.BackFinishedHandover(dt, sUserInfo);
  9985. if (Convert.ToInt32(sre.Result) > 0)
  9986. {
  9987. actionResult.Status = (int)Constant.PDAResult.Success;
  9988. actionResult.Message = "产成品撤销交接成功";
  9989. }
  9990. else
  9991. {
  9992. actionResult.Status = (int)Constant.PDAResult.Fail;
  9993. actionResult.Message = sre.Message;
  9994. }
  9995. return actionResult;
  9996. }
  9997. #endregion
  9998. // 设定商标
  9999. if (action == "GetFinishedBarcode")
  10000. {
  10001. string barcode = data["barcode"].ToString();
  10002. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  10003. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10004. if (Convert.ToInt32(resultEntity.Result) < 0)
  10005. {
  10006. actionResult.Status = (int)Constant.PDAResult.Fail;
  10007. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  10008. actionResult.Message = resultEntity.Message;
  10009. }
  10010. else
  10011. {
  10012. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10013. actionResult.Status = (int)Constant.PDAResult.Success;
  10014. actionResult.Message = resultEntity.Message;
  10015. }
  10016. return actionResult;
  10017. }
  10018. if (action == "GetHandoveredBarcode")
  10019. {
  10020. string barcode = data["barcode"].ToString();
  10021. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  10022. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10023. if (Convert.ToInt32(resultEntity.Result) < 0)
  10024. {
  10025. actionResult.Status = (int)Constant.PDAResult.Fail;
  10026. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  10027. actionResult.Message = resultEntity.Message;
  10028. }
  10029. else
  10030. {
  10031. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10032. actionResult.Status = (int)Constant.PDAResult.Success;
  10033. actionResult.Message = resultEntity.Message;
  10034. }
  10035. return actionResult;
  10036. }
  10037. if (action == "SetFinishedLogo")
  10038. {
  10039. int logoid = Convert.ToInt32(data["logoid"]);
  10040. string[] barcodes = data["barcodes"].ToString().Split(',');
  10041. string returnMessage = "";
  10042. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo, out returnMessage);
  10043. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10044. if (result < 0)
  10045. {
  10046. actionResult.Status = (int)Constant.PDAResult.Fail;
  10047. actionResult.Message = returnMessage;
  10048. }
  10049. else
  10050. {
  10051. actionResult.Status = (int)Constant.PDAResult.Success;
  10052. }
  10053. return actionResult;
  10054. }
  10055. if (action == "SetHandoveredOrder")
  10056. {
  10057. int orderID = Convert.ToInt32(data["orderID"]);
  10058. string[] barcodes = data["barcodes"].ToString().Split(',');
  10059. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  10060. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10061. if (result < 0)
  10062. {
  10063. actionResult.Status = (int)Constant.PDAResult.Fail;
  10064. }
  10065. else
  10066. {
  10067. actionResult.Status = (int)Constant.PDAResult.Success;
  10068. }
  10069. return actionResult;
  10070. }
  10071. }
  10072. #endregion
  10073. #region 产成品装车
  10074. /*
  10075. if (module == "FinishedLoading")
  10076. {
  10077. // 设定商标
  10078. if (action == "GetMaxLoadingNo")
  10079. {
  10080. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  10081. actionResult.Status = (int)Constant.PDAResult.Success;
  10082. actionResult.Result = no;
  10083. return actionResult;
  10084. }
  10085. if (action == "CheckFinishedLaodingBarcode")
  10086. {
  10087. string barcode = data["barcode"].ToString();
  10088. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  10089. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  10090. {
  10091. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10092. actionResult.Status = (int)Constant.PDAResult.Success;
  10093. actionResult.Message = resultEntity.Message;
  10094. }
  10095. else
  10096. {
  10097. actionResult.Status = (int)Constant.PDAResult.Fail;
  10098. actionResult.Result = resultEntity.OtherStatus;
  10099. actionResult.Message = resultEntity.Message;
  10100. }
  10101. return actionResult;
  10102. }
  10103. if (action == "SaveFinishedLoading")
  10104. {
  10105. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  10106. string carLicense = data["carLicense"] + "";
  10107. int palletNum = Convert.ToInt32(data["palletNum"]);
  10108. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  10109. string remarks = data["remarks"] + "";
  10110. Dictionary<string, object>[] details =
  10111. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  10112. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  10113. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  10114. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  10115. if (result.Status == Constant.ServiceResultStatus.Success)
  10116. {
  10117. actionResult.Status = (int)Constant.PDAResult.Success;
  10118. actionResult.Message = result.Message;
  10119. }
  10120. else
  10121. {
  10122. actionResult.Status = (int)Constant.PDAResult.Fail;
  10123. actionResult.Result = result.OtherStatus;
  10124. actionResult.Message = result.Message;
  10125. }
  10126. return actionResult;
  10127. }
  10128. }
  10129. */
  10130. #endregion
  10131. #region 产成品质量改判
  10132. if (module == "FinishedProductTamper")
  10133. {
  10134. // 获取产成品信息及缺陷数据
  10135. if (action == "GetDefectData")
  10136. {
  10137. string barcode = data["barcode"].ToString();
  10138. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  10139. if (sre.Status == Constant.ServiceResultStatus.Success)
  10140. {
  10141. actionResult.Status = (int)Constant.PDAResult.Success;
  10142. actionResult.Result = JsonHelper.ToJson(sre.Result);
  10143. actionResult.Message = sre.Message;
  10144. }
  10145. else
  10146. {
  10147. actionResult.Status = (int)Constant.PDAResult.Fail;
  10148. actionResult.Result = sre.OtherStatus;
  10149. actionResult.Message = sre.Message;
  10150. }
  10151. return actionResult;
  10152. }
  10153. // 获取产成品信息及缺陷数据
  10154. if (action == "SaveDefectData")
  10155. {
  10156. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  10157. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  10158. if (sre.Status == Constant.ServiceResultStatus.Success)
  10159. {
  10160. actionResult.Status = (int)Constant.PDAResult.Success;
  10161. actionResult.Message = sre.Message;
  10162. }
  10163. else
  10164. {
  10165. actionResult.Status = (int)Constant.PDAResult.Fail;
  10166. actionResult.Message = sre.Message;
  10167. }
  10168. return actionResult;
  10169. }
  10170. // 通过条码查出责任工序(成品改判用)
  10171. if (action == "GetDutyProcedureByBarCodeForTamper")
  10172. {
  10173. string barcode = data["barcode"] + "";
  10174. int defectid = int.Parse(data["defectid"] + "");
  10175. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  10176. if (sre.Status == Constant.ServiceResultStatus.Success)
  10177. {
  10178. actionResult.Status = (int)Constant.PDAResult.Success;
  10179. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10180. actionResult.Message = sre.Message;
  10181. }
  10182. else
  10183. {
  10184. actionResult.Status = (int)Constant.PDAResult.Fail;
  10185. actionResult.Result = sre.OtherStatus;
  10186. actionResult.Message = sre.Message;
  10187. }
  10188. return actionResult;
  10189. }
  10190. }
  10191. #endregion
  10192. #region PDA独立功能
  10193. #region 水效标识
  10194. if (module == "WaterEffect")
  10195. {
  10196. // 获取产成品信息及水效标识
  10197. if (action == "GetGoodsByBarCode")
  10198. {
  10199. string barcode = data["barcode"].ToString();
  10200. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  10201. if (sre.Status == Constant.ServiceResultStatus.Success)
  10202. {
  10203. actionResult.Status = (int)Constant.PDAResult.Success;
  10204. actionResult.Result = JsonHelper.ToJson(sre.Result);
  10205. actionResult.Message = sre.Message;
  10206. }
  10207. else
  10208. {
  10209. actionResult.Status = (int)Constant.PDAResult.Fail;
  10210. actionResult.Result = sre.OtherStatus;
  10211. actionResult.Message = sre.Message;
  10212. }
  10213. return actionResult;
  10214. }
  10215. }
  10216. #endregion
  10217. #region 盖板型号
  10218. if (module == "SeatCoverType")
  10219. {
  10220. // 获取产成品信息及水效标识
  10221. if (action == "SendGoodsCodeToPLC")
  10222. {
  10223. string barcode = data["barcode"].ToString();
  10224. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  10225. if (sre == 0)
  10226. {
  10227. actionResult.Status = (int)Constant.PDAResult.Success;
  10228. }
  10229. else
  10230. {
  10231. actionResult.Status = (int)Constant.PDAResult.Fail;
  10232. actionResult.Result = sre;
  10233. switch (sre)
  10234. {
  10235. case 1:
  10236. case 2:
  10237. actionResult.Message = "无效条码";
  10238. break;
  10239. case 3:
  10240. actionResult.Message = "此产品型号没有设置盖板标识码";
  10241. break;
  10242. case 4:
  10243. actionResult.Message = "当前用户没有设置PLC参数";
  10244. break;
  10245. case 5:
  10246. actionResult.Message = "PLC参数设置不全";
  10247. break;
  10248. default:
  10249. actionResult.Message = "PLC通信异常";
  10250. break;
  10251. }
  10252. }
  10253. return actionResult;
  10254. }
  10255. }
  10256. #endregion
  10257. #region PDA PLC 相关功能
  10258. if (module == "PDA_FUN_PLC")
  10259. {
  10260. // PDA扫码发送到PLCServer
  10261. if (action == "SendBarcodeToPLCServer")
  10262. {
  10263. string barcode = data["barcode"].ToString();
  10264. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  10265. if (sre == 0)
  10266. {
  10267. actionResult.Status = (int)Constant.PDAResult.Success;
  10268. }
  10269. else
  10270. {
  10271. actionResult.Status = (int)Constant.PDAResult.Fail;
  10272. actionResult.Result = sre;
  10273. switch (sre)
  10274. {
  10275. case 1:
  10276. case 2:
  10277. actionResult.Message = "无效条码";
  10278. break;
  10279. case 3:
  10280. actionResult.Message = "PLC通信异常";
  10281. break;
  10282. case 4:
  10283. actionResult.Message = "当前用户没有设置PLC参数";
  10284. break;
  10285. case 5:
  10286. actionResult.Message = "PLC参数设置不全";
  10287. break;
  10288. default:
  10289. actionResult.Message = "PLC通信异常";
  10290. break;
  10291. }
  10292. }
  10293. return actionResult;
  10294. }
  10295. }
  10296. #endregion
  10297. #endregion
  10298. #region 半检返修
  10299. if (module == "SemiRework")
  10300. {
  10301. // 验证半检返修条码
  10302. if (action == "CheckSemiReworkBarcode")
  10303. {
  10304. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10305. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  10306. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10307. if (Convert.ToInt32(resultEntity.Result) < 0)
  10308. {
  10309. actionResult.Status = (int)Constant.PDAResult.Fail;
  10310. }
  10311. else
  10312. {
  10313. actionResult.Status = (int)Constant.PDAResult.Success;
  10314. }
  10315. actionResult.Message = resultEntity.Message;
  10316. return actionResult;
  10317. }
  10318. // 可以返修的工序
  10319. if (action == "GetSemiReworkProcedure")
  10320. {
  10321. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10322. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  10323. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10324. actionResult.Status = (int)Constant.PDAResult.Success;
  10325. return actionResult;
  10326. }
  10327. // 根据条码获取经过的工序,用于责任工序
  10328. if (action == "GetSemiReworkPassProcedure")
  10329. {
  10330. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10331. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  10332. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10333. actionResult.Status = (int)Constant.PDAResult.Success;
  10334. return actionResult;
  10335. }
  10336. // 根据所选生产工序(生产数据ID)查询责任员工
  10337. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  10338. {
  10339. int productionDataID = Convert.ToInt32(jsonData);
  10340. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10341. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  10342. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10343. actionResult.Status = (int)Constant.PDAResult.Success;
  10344. return actionResult;
  10345. }
  10346. // 根据所选工号,查出缺陷责任员工
  10347. if (action == "GetSemiReworkDefectStaffByUserID")
  10348. {
  10349. int userID = Convert.ToInt32(jsonData);
  10350. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10351. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  10352. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10353. actionResult.Status = (int)Constant.PDAResult.Success;
  10354. return actionResult;
  10355. }
  10356. // 新建半检返修
  10357. if (action == "AddSemiRework")
  10358. {
  10359. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10360. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10361. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  10362. actionResult.Result = resultEntity.Result;
  10363. actionResult.Message = resultEntity.Message;
  10364. if (Convert.ToInt32(resultEntity.Result) > 0)
  10365. {
  10366. actionResult.Status = (int)Constant.PDAResult.Success;
  10367. }
  10368. else
  10369. {
  10370. actionResult.Status = (int)Constant.PDAResult.Fail;
  10371. }
  10372. return actionResult;
  10373. }
  10374. // 编辑半检返修
  10375. if (action == "EditSemiRework")
  10376. {
  10377. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10378. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10379. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  10380. actionResult.Result = resultEntity.Result;
  10381. actionResult.Message = resultEntity.Message;
  10382. if (Convert.ToInt32(resultEntity.Result) > 0)
  10383. {
  10384. actionResult.Status = (int)Constant.PDAResult.Success;
  10385. }
  10386. else
  10387. {
  10388. actionResult.Status = (int)Constant.PDAResult.Fail;
  10389. }
  10390. return actionResult;
  10391. }
  10392. // 撤销半检返修
  10393. if (action == "CancelSemiRework")
  10394. {
  10395. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10396. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10397. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  10398. actionResult.Result = resultEntity.Result;
  10399. actionResult.Message = resultEntity.Message;
  10400. if (Convert.ToInt32(resultEntity.Result) > 0)
  10401. {
  10402. actionResult.Status = (int)Constant.PDAResult.Success;
  10403. }
  10404. else
  10405. {
  10406. actionResult.Status = (int)Constant.PDAResult.Fail;
  10407. }
  10408. return actionResult;
  10409. }
  10410. // 获取半检返修数据(PDA编辑用)
  10411. if (action == "GetSemiReworkByID")
  10412. {
  10413. int id = Convert.ToInt32(jsonData);
  10414. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10415. PMModuleLogic.GetSemiReworkByID(id, sUserInfo.UserCode);
  10416. DataTable data1 = resultEntity.Data.Tables[0];
  10417. DataTable data2 = resultEntity.Data.Tables[1];
  10418. DataTable data3 = resultEntity.Data.Tables[2];
  10419. if (data1.Rows.Count == 0)
  10420. {
  10421. actionResult.Status = (int)Constant.PDAResult.Fail;
  10422. actionResult.Message = "半检返修信息不存在";
  10423. return actionResult;
  10424. }
  10425. SemiReworkEntity srEntity = new SemiReworkEntity();
  10426. srEntity.SemiReworkID = id;
  10427. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  10428. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  10429. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  10430. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  10431. foreach (DataRow row2 in data2.Rows)
  10432. {
  10433. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  10434. srEntity.SemiReworkDefects.Add(defectEntity);
  10435. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  10436. defectEntity.SemiReworkID = id;
  10437. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  10438. defectEntity.DefectCode = row2["DefectCode"] + "";
  10439. defectEntity.DefectName = row2["DefectName"] + "";
  10440. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  10441. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  10442. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  10443. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  10444. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  10445. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  10446. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  10447. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  10448. defectEntity.Remarks = row2["Remarks"] + "";
  10449. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  10450. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  10451. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  10452. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  10453. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  10454. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  10455. if (row3s.Length == 0)
  10456. {
  10457. continue;
  10458. }
  10459. foreach (DataRow row3 in row3s)
  10460. {
  10461. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  10462. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  10463. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  10464. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  10465. semiReworkRPS.StaffName = row3["StaffName"] + "";
  10466. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  10467. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  10468. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  10469. semiReworkRPS.UserCode = row3["UserCode"] + "";
  10470. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  10471. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  10472. }
  10473. }
  10474. //xuwei note 总单用于显示,信息较全
  10475. actionResult.Message = JsonHelper.ToJson(data1);
  10476. //xuwei note 总单信息不全,但有明细,用于回传保存
  10477. actionResult.Result = JsonHelper.ToJson(srEntity);
  10478. actionResult.Status = (int)Constant.PDAResult.Success;
  10479. }
  10480. }
  10481. #endregion
  10482. #region 窑车漏扫补件
  10483. if (module == "F_PM_0504")
  10484. {
  10485. // 验证窑车编码是否存在
  10486. if (action == "CheckKilnCar")
  10487. {
  10488. ClientRequestEntity cre = new ClientRequestEntity();
  10489. cre.Properties["kilncarcode"] = data["KilnCarCode"];
  10490. cre.Properties["procedureID"] = data["ProcedureID"];
  10491. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo);
  10492. if (sre.Status == Constant.ServiceResultStatus.Success)
  10493. {
  10494. actionResult.Status = (int)Constant.PDAResult.Success;
  10495. actionResult.Result = sre.Result;
  10496. }
  10497. else
  10498. {
  10499. actionResult.Status = (int)Constant.PDAResult.Fail;
  10500. actionResult.Message = sre.Message;
  10501. }
  10502. return actionResult;
  10503. }
  10504. // 验证窑车烧成批次号是否存在 和 是否能补漏扫
  10505. if (action == "CheckKilnCarBatchNo")
  10506. {
  10507. ClientRequestEntity cre = new ClientRequestEntity();
  10508. cre.Properties["KilnID"] = data["KilnID"];
  10509. cre.Properties["KilnCarID"] = data["KilnCarID"];
  10510. cre.Properties["ProcedureID"] = data["ProcedureID"];
  10511. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10512. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo);
  10513. if (sre.Status == Constant.ServiceResultStatus.Success)
  10514. {
  10515. actionResult.Status = (int)Constant.PDAResult.Success;
  10516. }
  10517. else
  10518. {
  10519. actionResult.Status = (int)Constant.PDAResult.Fail;
  10520. actionResult.Message = sre.Message;
  10521. }
  10522. return actionResult;
  10523. }
  10524. // 窑车漏扫补件
  10525. if (action == "SetKilnCarMissing")
  10526. {
  10527. ClientRequestEntity cre = new ClientRequestEntity();
  10528. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10529. string carData = data["CarData"] + "";
  10530. DataTable dataTable = JsonHelper.FromJson<DataTable>(carData);
  10531. cre.Data = new DataSet();
  10532. cre.Data.Tables.Add(dataTable);
  10533. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo);
  10534. if (sre.Status == Constant.ServiceResultStatus.Success)
  10535. {
  10536. actionResult.Status = (int)Constant.PDAResult.Success;
  10537. }
  10538. else
  10539. {
  10540. actionResult.Status = (int)Constant.PDAResult.Fail;
  10541. actionResult.Message = sre.Message;
  10542. }
  10543. return actionResult;
  10544. }
  10545. }
  10546. #endregion
  10547. #region 梭式窑入窑
  10548. else if (module == "F_PM_0505")
  10549. {
  10550. // 验证窑车编码是否存在
  10551. if (action == "GetAllKilntInfo")
  10552. {
  10553. DataSet dsKilntInfo = SystemModuleLogic.GetAllKilntInfo(sUserInfo);
  10554. if (dsKilntInfo != null && dsKilntInfo.Tables.Count > 0)
  10555. {
  10556. actionResult.Status = (int)Constant.PDAResult.Success;
  10557. actionResult.Result = JsonHelper.ToJson(dsKilntInfo.Tables[0]);
  10558. }
  10559. else
  10560. {
  10561. actionResult.Status = (int)Constant.PDAResult.Fail;
  10562. }
  10563. return actionResult;
  10564. }
  10565. // 保存梭式窑入窑计数
  10566. if (action == "SaveSKBatchNo")
  10567. {
  10568. ClientRequestEntity cre = new ClientRequestEntity();
  10569. cre.Properties["KilnCode"] = data["KilnCode"];
  10570. cre.Properties["Remarks"] = data["Remarks"];
  10571. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SaveSKBatchNo(cre, sUserInfo);
  10572. if (sre.Status == Constant.ServiceResultStatus.Success)
  10573. {
  10574. if (sre.OtherStatus > 0)
  10575. {
  10576. actionResult.Status = (int)Constant.PDAResult.Success;
  10577. }
  10578. else
  10579. {
  10580. actionResult.Status = (int)Constant.PDAResult.Fail;
  10581. actionResult.Message = sre.Message;
  10582. }
  10583. }
  10584. else
  10585. {
  10586. actionResult.Status = (int)Constant.PDAResult.Fail;
  10587. actionResult.Message = sre.Message;
  10588. }
  10589. return actionResult;
  10590. }
  10591. }
  10592. #endregion
  10593. #region 重启3#高压注浆
  10594. else if (module == "F_PM_0107")
  10595. {
  10596. // 查询3#高压注浆线
  10597. if (action == "GetGroutingLine3")
  10598. {
  10599. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.GetGroutingLine3(sUserInfo);
  10600. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10601. {
  10602. actionResult.Status = (int)Constant.PDAResult.Success;
  10603. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  10604. }
  10605. else
  10606. {
  10607. actionResult.Status = (int)Constant.PDAResult.Fail;
  10608. }
  10609. return actionResult;
  10610. }
  10611. // 重置注浆批次
  10612. if (action == "SaveGroutingLine3")
  10613. {
  10614. ClientRequestEntity cre = new ClientRequestEntity();
  10615. cre.Properties["GroutingLineID"] = data["GroutingLineID"];
  10616. cre.Properties["H_BatchNo"] = data["H_BatchNo"];
  10617. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SaveGroutingLine3(cre, sUserInfo);
  10618. if (sre.Status == Constant.ServiceResultStatus.Success)
  10619. {
  10620. if (sre.OtherStatus > 0)
  10621. {
  10622. actionResult.Status = (int)Constant.PDAResult.Success;
  10623. }
  10624. else
  10625. {
  10626. actionResult.Status = (int)Constant.PDAResult.Fail;
  10627. actionResult.Message = sre.Message;
  10628. }
  10629. }
  10630. else
  10631. {
  10632. actionResult.Status = (int)Constant.PDAResult.Fail;
  10633. actionResult.Message = sre.Message;
  10634. }
  10635. return actionResult;
  10636. }
  10637. }
  10638. #endregion
  10639. #region 3#条码打印机(PDA用)
  10640. // 3#配置工位打印机
  10641. else if (module == "01070804")
  10642. {
  10643. // 获取3#条码打印机配置(PDA用)
  10644. if (action == "GetWorkStationPrinter3")
  10645. {
  10646. ServiceResultEntity sre = SystemModuleLogic.GetWorkStationPrinter3(sUserInfo);
  10647. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10648. {
  10649. actionResult.Status = (int)Constant.PDAResult.Success;
  10650. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10651. }
  10652. else
  10653. {
  10654. actionResult.Status = (int)Constant.PDAResult.Fail;
  10655. }
  10656. return actionResult;
  10657. }
  10658. // 保存3#条码打印机配置(PDA用)
  10659. else if (action == "SaveWorkStationPrinter3")
  10660. {
  10661. ClientRequestEntity cre = new ClientRequestEntity();
  10662. cre.Properties["WorkStationID"] = data["WorkStationID"];
  10663. cre.Properties["PrinterID1"] = data["PrinterID1"];
  10664. cre.Properties["PrinterID2"] = data["PrinterID2"];
  10665. cre.Properties["PrinterID3"] = data["PrinterID3"];
  10666. ServiceResultEntity sre = SystemModuleLogic.SaveWorkStationPrinter3(cre, sUserInfo);
  10667. if (sre.Status == Constant.ServiceResultStatus.Success)
  10668. {
  10669. if (sre.OtherStatus > 0)
  10670. {
  10671. actionResult.Status = (int)Constant.PDAResult.Success;
  10672. }
  10673. else
  10674. {
  10675. actionResult.Status = (int)Constant.PDAResult.Fail;
  10676. actionResult.Message = sre.Message;
  10677. }
  10678. }
  10679. else
  10680. {
  10681. actionResult.Status = (int)Constant.PDAResult.Fail;
  10682. actionResult.Message = sre.Message;
  10683. }
  10684. return actionResult;
  10685. }
  10686. }
  10687. // 3#条码打印
  10688. else if (module == "01070805")
  10689. {
  10690. // 获取3#条码打印机配置(PDA用)
  10691. if (action == "GetWorkStationPrinter3")
  10692. {
  10693. ServiceResultEntity sre = SystemModuleLogic.GetWorkStationPrinter3(sUserInfo);
  10694. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10695. {
  10696. actionResult.Status = (int)Constant.PDAResult.Success;
  10697. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10698. }
  10699. else
  10700. {
  10701. actionResult.Status = (int)Constant.PDAResult.Fail;
  10702. }
  10703. return actionResult;
  10704. }
  10705. // 条码打印(PDA用)
  10706. else if (action == "PrintBarcode_3BL")
  10707. {
  10708. ClientRequestEntity cre = new ClientRequestEntity();
  10709. cre.Properties["Barcode"] = data["Barcode"];
  10710. cre.Properties["WorkStationID"] = data["WorkStationID"];
  10711. ServiceResultEntity sre = SystemModuleLogic.PrintBarcode_3BL(cre, sUserInfo);
  10712. if (sre.Status == Constant.ServiceResultStatus.Success)
  10713. {
  10714. if (sre.Result != null)
  10715. {
  10716. actionResult.Status = (int)Constant.PDAResult.Success;
  10717. }
  10718. else
  10719. {
  10720. actionResult.Status = (int)Constant.PDAResult.Fail;
  10721. actionResult.Message = sre.Message;
  10722. }
  10723. }
  10724. else
  10725. {
  10726. actionResult.Status = (int)Constant.PDAResult.Fail;
  10727. actionResult.Message = sre.Message;
  10728. }
  10729. return actionResult;
  10730. }
  10731. }
  10732. // 3#条码补打
  10733. else if (module == "01070806")
  10734. {
  10735. // 获取3#条码打印机配置(PDA用)
  10736. if (action == "GetWorkStationPrinter3")
  10737. {
  10738. ServiceResultEntity sre = SystemModuleLogic.GetWorkStationPrinter3(sUserInfo);
  10739. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10740. {
  10741. actionResult.Status = (int)Constant.PDAResult.Success;
  10742. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10743. }
  10744. else
  10745. {
  10746. actionResult.Status = (int)Constant.PDAResult.Fail;
  10747. }
  10748. return actionResult;
  10749. }
  10750. // 补打3#条码(PDA用)
  10751. else if (action == "PrintBarcode_3BL_B")
  10752. {
  10753. ClientRequestEntity cre = new ClientRequestEntity();
  10754. cre.Properties["Barcode"] = data["Barcode"];
  10755. if (data.ContainsKey("PrinterID1"))
  10756. cre.Properties["PrinterID1"] = data["PrinterID1"];
  10757. if (data.ContainsKey("PrinterID2"))
  10758. cre.Properties["PrinterID2"] = data["PrinterID2"];
  10759. if (data.ContainsKey("PrinterID3"))
  10760. cre.Properties["PrinterID3"] = data["PrinterID3"];
  10761. ServiceResultEntity sre = SystemModuleLogic.PrintBarcode_3BL_B(cre, sUserInfo);
  10762. if (sre.Status == Constant.ServiceResultStatus.Success)
  10763. {
  10764. if (sre.Result != null)
  10765. {
  10766. actionResult.Status = (int)Constant.PDAResult.Success;
  10767. }
  10768. else
  10769. {
  10770. actionResult.Status = (int)Constant.PDAResult.Fail;
  10771. actionResult.Message = sre.Message;
  10772. }
  10773. }
  10774. else
  10775. {
  10776. actionResult.Status = (int)Constant.PDAResult.Fail;
  10777. actionResult.Message = sre.Message;
  10778. }
  10779. return actionResult;
  10780. }
  10781. }
  10782. #endregion
  10783. #region 获取3#成检二检PLC重量
  10784. else if (module == "GetPLCWeight")
  10785. {
  10786. // 获取3#条码打印机配置(PDA用)
  10787. if (action == "GetPLCWeight")
  10788. {
  10789. actionResult.Result = PMModuleLogic.Get3PLCWeight(sUserInfo);
  10790. actionResult.Status = (int)Constant.PDAResult.Success;
  10791. return actionResult;
  10792. }
  10793. }
  10794. #endregion
  10795. #region 注浆绑码时,验证成型线是否能绑码
  10796. else if (module == "CheckGroutingLine")
  10797. {
  10798. if (action == "CheckGroutingLine")
  10799. {
  10800. ServiceResultEntity sre = PDAModuleLogic.CheckGroutingLine(data["GroutingLineCode"] + "");
  10801. if (sre.OtherStatus < 0)
  10802. {
  10803. actionResult.Status = (int)Constant.PDAResult.Fail;
  10804. actionResult.Message = sre.Message;
  10805. }
  10806. else
  10807. {
  10808. actionResult.Status = (int)Constant.PDAResult.Success;
  10809. }
  10810. return actionResult;
  10811. }
  10812. }
  10813. #endregion
  10814. #region 注浆绑码选批次查询最小启用的模具编码
  10815. else if (module == "GetGroutingMouldByBatchNo")
  10816. {
  10817. if (action == "GetGroutingMouldByBatchNo")
  10818. {
  10819. string groutingLineCode = data["groutingLineCode"] + "";
  10820. string groutingDay = data["groutingDay"] + "";
  10821. string groutingBatchNo = data["groutingBatchNo"] + "";
  10822. string groutingMouldCode = data["groutingMouldCode"] + "";
  10823. ServiceResultEntity sre = PDAModuleLogic.GetGroutingMouldByBatchNo(groutingMouldCode, groutingLineCode, groutingDay, groutingBatchNo);
  10824. if (sre.Status == Constant.ServiceResultStatus.Success)
  10825. {
  10826. actionResult.Status = (int)Constant.PDAResult.Success;
  10827. actionResult.Result = JsonHelper.ToJson(sre.Result);
  10828. actionResult.Message = sre.Message;
  10829. }
  10830. else
  10831. {
  10832. actionResult.Status = (int)Constant.PDAResult.Fail;
  10833. actionResult.Result = sre.OtherStatus;
  10834. actionResult.Message = sre.Message;
  10835. }
  10836. return actionResult;
  10837. }
  10838. }
  10839. #endregion
  10840. #region 3#半检一检交坯
  10841. else if (module == "SemiQualityStatistics")
  10842. {
  10843. if (action == "SemiQualityStatisticsDeliver3")
  10844. {
  10845. ServiceResultEntity sre = PMModuleLogicDAL.SemiQualityStatisticsDeliver3(data, sUserInfo);
  10846. if (sre.OtherStatus < 0)
  10847. {
  10848. actionResult.Status = (int)Constant.PDAResult.Fail;
  10849. actionResult.Message = sre.Message;
  10850. }
  10851. else
  10852. {
  10853. actionResult.Status = (int)Constant.PDAResult.Success;
  10854. }
  10855. return actionResult;
  10856. }
  10857. }
  10858. #endregion
  10859. #region 产品分级(3车间)
  10860. else if (module == "0628")
  10861. {
  10862. if (action == "CheckOneLevelType")
  10863. {
  10864. string barcode = data["Barcode"] + "";
  10865. ServiceResultEntity sre = PDAModuleLogic.CheckOneLevelType(barcode);
  10866. if (sre.OtherStatus < 0)
  10867. {
  10868. actionResult.Status = (int)Constant.PDAResult.Fail;
  10869. actionResult.Message = sre.Message;
  10870. }
  10871. else
  10872. {
  10873. actionResult.Status = (int)Constant.PDAResult.Success;
  10874. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  10875. }
  10876. return actionResult;
  10877. }
  10878. if (action == "SaveOneLevelType")
  10879. {
  10880. int? levelTypeID = data["LevelTypeID"].ToNullableInt32();
  10881. string barcode = data["Barcode"] + "";
  10882. ServiceResultEntity sre = PDAModuleLogic.SaveOneLevelType(levelTypeID, barcode);
  10883. if (sre.OtherStatus < 0)
  10884. {
  10885. actionResult.Status = (int)Constant.PDAResult.Fail;
  10886. actionResult.Message = sre.Message;
  10887. }
  10888. else
  10889. {
  10890. actionResult.Status = (int)Constant.PDAResult.Success;
  10891. }
  10892. return actionResult;
  10893. }
  10894. }
  10895. #endregion
  10896. #region 半检查询责任工序(3车间)
  10897. else if (module == "GetDutyProcedureByBarCode3")
  10898. {
  10899. if (action == "GetDutyProcedureByBarCode3")
  10900. {
  10901. string barcode = data["barcode"] + "";
  10902. int defectid = Convert.ToInt32(data["defectid"] + "");
  10903. int procedureid = Convert.ToInt32(data["procedureid"] + "");
  10904. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  10905. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID, procedureid));
  10906. if (dutyProcedureDs != null)
  10907. {
  10908. actionResult.Status = (int)Constant.PDAResult.Success;
  10909. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  10910. }
  10911. else
  10912. {
  10913. actionResult.Status = (int)Constant.PDAResult.Fail;
  10914. }
  10915. return actionResult;
  10916. }
  10917. }
  10918. #endregion
  10919. #region 成品检验
  10920. if (module == "ProductionData")
  10921. {
  10922. //扫码查询
  10923. if (action == "CheckBarcode")
  10924. {
  10925. string barcode = data["barcode"] + "";
  10926. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.GetProductionID(barcode);
  10927. int procedureID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["finishedcheckprocedureid"]);
  10928. sre = Service.PCModuleService.FinishedCheckLogic.CheckBarcode(procedureID, barcode, sUserInfo);
  10929. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10930. if (Convert.ToInt32(sre.Result) < 0)
  10931. {
  10932. actionResult.Status = (int)Constant.PDAResult.Fail;
  10933. actionResult.Result = sre.OtherStatus; //漏扫1,反之0
  10934. actionResult.Message = sre.Message;
  10935. }
  10936. else
  10937. {
  10938. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10939. actionResult.Status = (int)Constant.PDAResult.Success;
  10940. actionResult.Message = sre.Message;
  10941. }
  10942. return actionResult;
  10943. }
  10944. //撤销查询
  10945. if (action == "GetFinishedCancleData")
  10946. {
  10947. string barcode = data["barcode"] + "";
  10948. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.GetFinishedCancleData(barcode, sUserInfo);
  10949. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10950. if (Convert.ToInt32(sre.Result) < 0)
  10951. {
  10952. actionResult.Status = (int)Constant.PDAResult.Fail;
  10953. actionResult.Result = sre.OtherStatus; //漏扫1,反之0
  10954. actionResult.Message = sre.Message;
  10955. }
  10956. else
  10957. {
  10958. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10959. actionResult.Status = (int)Constant.PDAResult.Success;
  10960. actionResult.Message = sre.Message;
  10961. }
  10962. return actionResult;
  10963. }
  10964. //保存成品检验
  10965. if (action == "AddCheckBarcode")
  10966. {
  10967. int procedureID = Convert.ToInt32(data["procedureID"]);
  10968. //DataTable TableProductionData = JsonHelper.FromJson<DataTable>(data["productionData"] + "");
  10969. //缺陷
  10970. //DataTable productionDefectTable = JsonHelper.FromJson<DataTable>(data["productionDefectTable"] + "");
  10971. //责任员工
  10972. //DataTable DSTableStaff = JsonHelper.FromJson<DataTable>(data["dSTableStaff"] + "");
  10973. //漏检员工
  10974. //DataTable DSTableMissedStaff = JsonHelper.FromJson<DataTable>(data["dSTableMissedStaff"] + "");
  10975. //图片
  10976. //DataTable DSTableImage = JsonHelper.FromJson<DataTable>(data["dSTableImage"] + "");
  10977. //ProductionDataEntity[] productionDataEntitys = new ProductionDataEntity[TableProductionData.Rows.Count];
  10978. #region 转换实体
  10979. //for (int i = 0; i < TableProductionData.Rows.Count; i++)
  10980. //{
  10981. // if (TableProductionData.Rows[i]["ReadOnly"].ToString() == "1") //只读数据不进行保存
  10982. // {
  10983. // continue;
  10984. // }
  10985. // ProductionDataEntity productionDataEntity = new ProductionDataEntity();
  10986. // if (TableProductionData.Rows[i]["ProductionDataID"].ToString() != "")
  10987. // {
  10988. // productionDataEntity.ProductionDataID = Convert.ToInt32(TableProductionData.Rows[i]["ProductionDataID"]);
  10989. // }
  10990. // productionDataEntity.Barcode = TableProductionData.Rows[i]["BarCode"].ToString();
  10991. // productionDataEntity.UserID = sUserInfo.UserID;
  10992. // productionDataEntity.UserCode = sUserInfo.UserCode;
  10993. // productionDataEntity.UserName = sUserInfo.UserName; ;
  10994. // productionDataEntity.DefectFlag = Convert.ToInt32(TableProductionData.Rows[i]["GoodsLevelTypeID"]) == 4 ? 1 : 2;
  10995. // productionDataEntity.GoodsLevelID = Convert.ToInt32(TableProductionData.Rows[i]["DefectFlagID"]);
  10996. // productionDataEntity.GoodsLevelTypeID = Convert.ToInt32(TableProductionData.Rows[i]["GoodsLevelTypeID"]);
  10997. // productionDataEntity.Remarks = TableProductionData.Rows[i]["Remarks"].ToString();
  10998. // if (TableProductionData.Rows[i]["LogoID"].ToString() != "")
  10999. // {
  11000. // productionDataEntity.LogoID = Convert.ToInt32(TableProductionData.Rows[i]["LogoID"]);
  11001. // }
  11002. // if (TableProductionData.Rows[i]["OPTimeStamp"].ToString() != "")
  11003. // {
  11004. // productionDataEntity.OPTimeStamp = Convert.ToDateTime(TableProductionData.Rows[i]["OPTimeStamp"]);
  11005. // }
  11006. // if (TableProductionData.Rows[i]["CheckTime"].ToString() != "")
  11007. // {
  11008. // productionDataEntity.CheckTime = Convert.ToDateTime(TableProductionData.Rows[i]["CheckTime"]);
  11009. // }
  11010. // if (TableProductionData.Rows[i]["OrgGoodsLevelTypeID"].ToString() != "-1")
  11011. // {
  11012. // productionDataEntity.OrgGoodsLevelTypeID = Convert.ToInt32(TableProductionData.Rows[i]["OrgGoodsLevelTypeID"]);
  11013. // }
  11014. // if (!string.IsNullOrEmpty(TableProductionData.Rows[i]["ReworkProcedureID"].ToString()))
  11015. // {
  11016. // productionDataEntity.ReworkProcedureID = int.Parse(TableProductionData.Rows[i]["ReworkProcedureID"].ToString());
  11017. // productionDataEntity.IsReworked = 1;
  11018. // }
  11019. // productionDataEntitys[i] = productionDataEntity;
  11020. // List<ProductionDefectEntity> productionDefectEntitys = new List<ProductionDefectEntity>();
  11021. // ProductionDefectEntity productionDefectEntity = null;
  11022. // for (int j = 0; j < productionDefectTable.Rows.Count; j++) //缺陷列表
  11023. // {
  11024. // productionDefectEntity = new ProductionDefectEntity();
  11025. // productionDefectEntity.SpecialDefect = productionDefectTable.Rows[j]["IsOtherDefect"].ToString();
  11026. // //if (productionDefectTable.Rows[j]["DefectDeductionID"].ToString() != "-1"
  11027. // // && productionDefectTable.Rows[j]["DefectDeductionID"].ToString() != string.Empty)
  11028. // //{
  11029. // // productionDefectEntity.DefectDeductionNum = Convert.ToDecimal(productionDefectTable.Rows[j]["DefectDeductionNum"]);
  11030. // //}
  11031. // if (!string.IsNullOrEmpty(productionDefectTable.Rows[j]["DefectDeductionNum"] + ""))
  11032. // {
  11033. // productionDefectEntity.DefectDeductionNum = Convert.ToDecimal(productionDefectTable.Rows[j]["DefectDeductionNum"]);
  11034. // }
  11035. // productionDefectEntity.ScrapResponFlag = "0";
  11036. // productionDefectEntity.DefectID =
  11037. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectID"]);
  11038. // productionDefectEntity.DefectCode =
  11039. // productionDefectTable.Rows[j]["DefectCode"].ToString();
  11040. // productionDefectEntity.DefectName =
  11041. // productionDefectTable.Rows[j]["DefectName"].ToString().Replace(productionDefectEntity.DefectCode + "->", "");
  11042. // productionDefectEntity.DefectPositionID =
  11043. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectPositionID"]);
  11044. // productionDefectEntity.DefectPositionCode =
  11045. // productionDefectTable.Rows[j]["DefectPositionCode"].ToString();
  11046. // productionDefectEntity.DefectPositionName =
  11047. // productionDefectTable.Rows[j]["DefectPositionName"].ToString().Replace(productionDefectEntity.DefectPositionCode + "->", "");
  11048. // productionDefectEntity.DefectProductionDataID =
  11049. // Convert.ToInt32(productionDefectTable.Rows[j]["ProductionDataID"] + "");
  11050. // if (productionDefectEntity.DefectProductionDataID == 0)
  11051. // {
  11052. // productionDefectEntity.DefectProductionDataID = null;
  11053. // }
  11054. // if (productionDefectTable.Rows[j]["DefectProcedureID"].ToString() != string.Empty &&
  11055. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectProcedureID"] + "") > Constant.INT_IS_ZERO)
  11056. // {
  11057. // productionDefectEntity.DefectProcedureID =
  11058. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectProcedureID"]);
  11059. // }
  11060. // productionDefectEntity.DefectProcedureCode =
  11061. // productionDefectTable.Rows[j]["DefectProcedureCode"].ToString();
  11062. // productionDefectEntity.DefectProcedureName =
  11063. // productionDefectTable.Rows[j]["DefectProcedureName"].ToString();
  11064. // productionDefectEntity.DefectUserID =
  11065. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectUserID"]);
  11066. // productionDefectEntity.DefectUserCode =
  11067. // productionDefectTable.Rows[j]["DefectUserCode"].ToString();
  11068. // productionDefectEntity.DefectUserName =
  11069. // productionDefectTable.Rows[j]["DefectUserName"].ToString();
  11070. // productionDefectEntity.DefectJobs =
  11071. // Convert.ToInt32(productionDefectTable.Rows[j]["Jobs"].ToString());
  11072. // productionDefectEntity.Remarks =
  11073. // productionDefectTable.Rows[j]["DefectRemarks"].ToString();
  11074. // productionDefectEntity.Remarks =
  11075. // productionDefectTable.Rows[j]["DefectRemarks"].ToString();
  11076. // if (productionDefectTable.Rows[j]["DefectFineID"].ToString() != "-1"
  11077. // && productionDefectTable.Rows[j]["DefectFineID"].ToString() != string.Empty)
  11078. // {
  11079. // productionDefectEntity.DefectFine = Convert.ToInt32(productionDefectTable.Rows[j]["DefectFineID"]);
  11080. // }
  11081. // if (productionDefectTable.Rows[j]["CheckTime"].ToString() != string.Empty)
  11082. // {
  11083. // //if (Convert.ToInt32(this.TableProductionData.Rows[i]["OrgGoodsLevelTypeID"]) == Convert.ToInt32(this.TableProductionData.Rows[i]["GoodsLevelTypeID"]))
  11084. // //{
  11085. // productionDefectEntity.CheckTime = Convert.ToDateTime(productionDefectTable.Rows[j]["CheckTime"]);
  11086. // //}
  11087. // }
  11088. // if (productionDefectTable.Rows[j]["MissedUserID"].ToString() != "-1"
  11089. // && productionDefectTable.Rows[j]["MissedUserID"].ToString() != string.Empty)
  11090. // {
  11091. // productionDefectEntity.MissedUserID = Convert.ToInt32(productionDefectTable.Rows[j]["MissedUserID"]);
  11092. // productionDefectEntity.MissedUserCode = productionDefectTable.Rows[j]["MissedUserCode"].ToString();
  11093. // productionDefectEntity.MissedUserName = productionDefectTable.Rows[j]["MissedUserName"].ToString();
  11094. // }
  11095. // // 遍历责任员工
  11096. // List<DefectResponsibleEntity> DefectResponsibles = new List<DefectResponsibleEntity>();
  11097. // if (DSTableStaff != null && DSTableStaff.Rows.Count > 0)
  11098. // {
  11099. // DefectResponsibleEntity defectResponsibleEntity = null;
  11100. // foreach (DataRow drStaff in DSTableStaff.Rows)
  11101. // {
  11102. // if (Convert.ToInt32(drStaff["IsSelected"]) == Constant.INT_IS_ONE)
  11103. // {
  11104. // defectResponsibleEntity = new DefectResponsibleEntity();
  11105. // defectResponsibleEntity.StaffID = Convert.ToInt32(drStaff["StaffID"]);
  11106. // defectResponsibleEntity.UserID = Convert.ToInt32(productionDefectEntity.DefectUserID);
  11107. // defectResponsibleEntity.UserCode = productionDefectEntity.DefectUserCode;
  11108. // defectResponsibleEntity.UJobsID =
  11109. // Convert.ToInt32(productionDefectTable.Rows[j]["Jobs"].ToString());
  11110. // defectResponsibleEntity.SJobsID =
  11111. // Convert.ToInt32(productionDefectTable.Rows[j]["Jobs"].ToString());
  11112. // defectResponsibleEntity.StaffStatus = Convert.ToInt32(drStaff["StaffStatus"]);
  11113. // DefectResponsibles.Add(defectResponsibleEntity);
  11114. // }
  11115. // }
  11116. // //productionDefectEntity.DefectResponsibles = DefectResponsibles.ToArray();//每个缺陷对应的责任员工
  11117. // productionDefectEntity.DefectResponsibles = DefectResponsibles;//每个缺陷对应的责任员工
  11118. // }
  11119. // // 遍历漏检责任员工
  11120. // List<DefectMissedResponsibleEntity> DefectMissedResponsibles = new List<DefectMissedResponsibleEntity>();
  11121. // if (DSTableMissedStaff != null && DSTableMissedStaff.Rows.Count > 0)
  11122. // {
  11123. // DefectMissedResponsibleEntity defectMissedResponsibleEntity = null;
  11124. // foreach (DataRow drStaff in DSTableMissedStaff.Rows)
  11125. // {
  11126. // if (Convert.ToInt32(drStaff["IsSelected"]) == Constant.INT_IS_ONE)
  11127. // {
  11128. // defectMissedResponsibleEntity = new DefectMissedResponsibleEntity();
  11129. // defectMissedResponsibleEntity.StaffID = Convert.ToInt32(drStaff["StaffID"]);
  11130. // defectMissedResponsibleEntity.UserID = Convert.ToInt32(productionDefectEntity.DefectUserID);
  11131. // defectMissedResponsibleEntity.UserCode = productionDefectEntity.DefectUserCode;
  11132. // defectMissedResponsibleEntity.UJobsID = Convert.ToInt32(drStaff["UJobsID"]);
  11133. // defectMissedResponsibleEntity.SJobsID = Convert.ToInt32(drStaff["SJobsID"]);
  11134. // defectMissedResponsibleEntity.StaffStatus = Convert.ToInt32(drStaff["StaffStatus"]);
  11135. // DefectMissedResponsibles.Add(defectMissedResponsibleEntity);
  11136. // }
  11137. // }
  11138. // //productionDefectEntity.DefectMissedResponsibles = DefectMissedResponsibles.ToArray();
  11139. // productionDefectEntity.DefectMissedResponsibles = DefectMissedResponsibles;
  11140. // }
  11141. // // 遍历缺陷图片
  11142. // if (DSTableImage != null && DSTableImage.Rows.Count > 0)
  11143. // {
  11144. // List<DefectImageEntity> defectImageEntitys = new List<DefectImageEntity>();
  11145. // DefectImageEntity defectImageEntity = null;
  11146. // foreach (DataRow drImage in DSTableImage.Rows)
  11147. // {
  11148. // defectImageEntity = new DefectImageEntity();
  11149. // defectImageEntity.Thumbnail = (byte[])drImage["ImageByte"];
  11150. // defectImageEntity.Image = (byte[])drImage["orgImageByte"];
  11151. // defectImageEntitys.Add(defectImageEntity);
  11152. // }
  11153. // productionDefectEntity.DefectImages = defectImageEntitys;
  11154. // }
  11155. // productionDefectEntitys.Add(productionDefectEntity);
  11156. // }
  11157. // productionDataEntitys[i].ProductionDefects = productionDefectEntitys;
  11158. // }
  11159. #endregion
  11160. ProductionDataEntity[] productionDataEntitys = JsonHelper.FromJson<ProductionDataEntity[]>(data["productionDataEntitys"] + "");
  11161. DataTable bomDetailTable = new DataTable();
  11162. if (data["bomDetailTable"] != null)
  11163. {
  11164. bomDetailTable = JsonHelper.FromJson<DataTable>(data["bomDetailTable"] + "");
  11165. }
  11166. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.AddCheckBarcode(procedureID, productionDataEntitys, bomDetailTable, sUserInfo);
  11167. if (Convert.ToInt32(sre.Result) > 0)
  11168. {
  11169. actionResult.Status = (int)Constant.PDAResult.Success;
  11170. actionResult.Message = "保存成功";
  11171. }
  11172. else
  11173. {
  11174. actionResult.Status = (int)Constant.PDAResult.Fail;
  11175. actionResult.Message = sre.Message;
  11176. }
  11177. return actionResult;
  11178. }
  11179. //撤销
  11180. if (action == "FinishedCancleData")
  11181. {
  11182. int productionDataID = Convert.ToInt32(data["productionDataID"]);
  11183. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.FinishedCancleData(productionDataID, sUserInfo);
  11184. if (Convert.ToInt32(sre.OtherStatus) > 0)
  11185. {
  11186. actionResult.Status = (int)Constant.PDAResult.Success;
  11187. actionResult.Message = "撤销成功";
  11188. }
  11189. else
  11190. {
  11191. actionResult.Status = (int)Constant.PDAResult.Fail;
  11192. actionResult.Message = sre.Message;
  11193. }
  11194. return actionResult;
  11195. }
  11196. //查询用户
  11197. if (action == "CheckProcedureUser")
  11198. {
  11199. string userCode1 = data["UserCode"] + "";
  11200. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.CheckProcedureUser(userCode1, sUserInfo);
  11201. if (Convert.ToInt32(sre.Result) < 0)
  11202. {
  11203. actionResult.Status = (int)Constant.PDAResult.Fail;
  11204. actionResult.Result = sre.OtherStatus;
  11205. actionResult.Message = sre.Message;
  11206. }
  11207. else
  11208. {
  11209. actionResult.Result = JsonHelper.ToJson(sre.Data);
  11210. actionResult.Status = (int)Constant.PDAResult.Success;
  11211. actionResult.Message = sre.Message;
  11212. }
  11213. return actionResult;
  11214. }
  11215. }
  11216. #endregion
  11217. #region BPM同步日志 add xiacm 2022-11-17
  11218. else if (module == "BARCODEIDNRKSCRAP")
  11219. {
  11220. if (action == "GetBarcodeIdnrkScrap")
  11221. {
  11222. //组件唯一编码
  11223. string IdnrkOnlyCode = data["IdnrkOnlyCode"].ToString();
  11224. // 确认日期
  11225. DateTime createTime = DateTime.Now.Date;
  11226. if (data.ContainsKey("CreateTime") && !string.IsNullOrEmpty(data["CreateTime"] + ""))
  11227. {
  11228. createTime = Convert.ToDateTime(data["CreateTime"].ToString());
  11229. }
  11230. // 确认标识(1:确认;2:撤销)
  11231. string confirmFlag = data["ConfirmFlag"].ToString();
  11232. string message = string.Empty;
  11233. DataSet IdnrkOnlyCodeDs = ServiceInvoker.Invoke(this,
  11234. () => PMModuleLogic.GetIdnrkOnlyCode(IdnrkOnlyCode, createTime, confirmFlag, sUserInfo, out message));
  11235. if (IdnrkOnlyCodeDs != null)
  11236. {
  11237. if (string.IsNullOrEmpty(message))
  11238. {
  11239. actionResult.Status = (int)Constant.PDAResult.Success;
  11240. actionResult.Result = JsonHelper.ToJson(IdnrkOnlyCodeDs);
  11241. }
  11242. else
  11243. {
  11244. actionResult.Status = (int)Constant.PDAResult.Fail;
  11245. actionResult.Message = message;
  11246. }
  11247. }
  11248. else
  11249. {
  11250. actionResult.Status = (int)Constant.PDAResult.Fail;
  11251. actionResult.Message = message;
  11252. }
  11253. return actionResult;
  11254. }
  11255. if (action == "ConfirmBarcodeIdnrkScrap")
  11256. {
  11257. ClientRequestEntity cre = new ClientRequestEntity();
  11258. DataTable dtBarcodeIdnrkScrap = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  11259. DateTime createTime = DateTime.Now.Date;
  11260. if (data.ContainsKey("CreateTime") && !string.IsNullOrEmpty(data["CreateTime"] + ""))
  11261. {
  11262. createTime = Convert.ToDateTime(data["CreateTime"].ToString());
  11263. }
  11264. cre.Data = new DataSet();
  11265. cre.Data.Tables.Add(dtBarcodeIdnrkScrap);
  11266. // 确认日期
  11267. cre.Properties["CreateTime"] = createTime;
  11268. // 确认标识(1:确认;2:撤销)
  11269. cre.Properties["ConfirmFlag"] = data["ConfirmFlag"].ToString();
  11270. if (dtBarcodeIdnrkScrap != null && dtBarcodeIdnrkScrap.Rows.Count > 0)
  11271. {
  11272. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11273. () => PMModuleLogic.ConfirmBarcodeIdnrkScrap(cre, sUserInfo));
  11274. if (Convert.ToInt32(sre.Result) <= 0)
  11275. {
  11276. actionResult.Status = (int)Constant.PDAResult.Fail;
  11277. actionResult.Message = sre.Message;
  11278. }
  11279. else
  11280. {
  11281. actionResult.Status = (int)Constant.PDAResult.Success;
  11282. actionResult.Message = "保存成功";
  11283. }
  11284. }
  11285. else
  11286. {
  11287. actionResult.Status = (int)Constant.PDAResult.Fail;
  11288. }
  11289. return actionResult;
  11290. }
  11291. }
  11292. #endregion
  11293. #region 次品扫描功能 20230406 by qq
  11294. if (module == "Recycling")
  11295. {
  11296. //扫码查询
  11297. if (action == "RecyclingAddBarcode")
  11298. {
  11299. string barcode = data["barcode"] + "";
  11300. string type = data["type"] + "";
  11301. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11302. () => PMModuleLogic.RecyclingAddBarcode(barcode, type, sUserInfo));
  11303. if (Convert.ToInt32(sre.Result) <= 0)
  11304. {
  11305. actionResult.Status = (int)Constant.PDAResult.Fail;
  11306. actionResult.Message = sre.Message;
  11307. }
  11308. else
  11309. {
  11310. actionResult.Status = (int)Constant.PDAResult.Success;
  11311. actionResult.Message = "保存成功";
  11312. }
  11313. return actionResult;
  11314. }
  11315. }
  11316. #endregion
  11317. return actionResult;
  11318. }
  11319. catch (Exception ex)
  11320. {
  11321. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11322. OutputLog.TraceLog(LogPriority.Error,
  11323. this.ToString(),
  11324. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  11325. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  11326. " module:" + module + " action:" + action + " json:" + jsonData,
  11327. ex.ToString(),
  11328. LocalPath.LogExePath);
  11329. actionResult.Status = (int)Constant.PDAResult.Exception;
  11330. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11331. }
  11332. return actionResult;
  11333. }
  11334. #endregion
  11335. }
  11336. }