PDAModuleService.cs 596 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817
  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.Linq;
  15. using System.ServiceModel;
  16. using System.ServiceModel.Activation;
  17. using Dongke.IBOSS.PRD.Basics.BaseResources;
  18. using Dongke.IBOSS.PRD.Basics.Library;
  19. using Dongke.IBOSS.PRD.Service.BarcodePrintService;
  20. using Dongke.IBOSS.PRD.Service.CommonModuleLogic;
  21. using Dongke.IBOSS.PRD.Service.DataModels;
  22. using Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic;
  23. using Dongke.IBOSS.PRD.Service.PCModuleLogic;
  24. using Dongke.IBOSS.PRD.Service.PDAModuleLogic;
  25. using Dongke.IBOSS.PRD.Service.PMModuleLogic;
  26. using Dongke.IBOSS.PRD.Service.PublicModuleService;
  27. using Dongke.IBOSS.PRD.Service.ReportModuleLogic;
  28. using Dongke.IBOSS.PRD.Service.SmartDeviceService;
  29. using Dongke.IBOSS.PRD.Service.SystemModuleLogic;
  30. using Dongke.IBOSS.PRD.WCF.Contracts;
  31. using Dongke.IBOSS.PRD.WCF.DataModels;
  32. using Dongke.IBOSS.PRD.WCF.DataModels.ConfigModule;
  33. using Dongke.IBOSS.PRD.WCF.DataModels.HRModule;
  34. using Dongke.IBOSS.PRD.WCF.DataModels.PCModule;
  35. using Dongke.IBOSS.PRD.WCF.DataModels.PDAModule;
  36. using Dongke.IBOSS.PRD.WCF.DataModels.PMModule;
  37. namespace Dongke.IBOSS.PRD.WCF.Services
  38. {
  39. // 服务实现类,继承服务声明接口
  40. // 该标签声明该服务可以在ASP.NET下运行
  41. [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
  42. [ServiceBehavior(ConfigurationName = "PDAModuleService",
  43. InstanceContextMode = InstanceContextMode.PerCall,
  44. ConcurrencyMode = ConcurrencyMode.Multiple,
  45. UseSynchronizationContext = false)]
  46. public partial class PDAModuleService : IPDAModule
  47. {
  48. #region 属性
  49. /// <summary>
  50. /// 用户登陆的信息
  51. /// </summary>
  52. SUserInfo sUserInfo
  53. {
  54. get;
  55. set;
  56. }
  57. #endregion
  58. #region 构造函数
  59. /// <summary>
  60. /// 构造函数
  61. /// </summary>
  62. public PDAModuleService()
  63. : base()
  64. {
  65. }
  66. #endregion
  67. #region 验证
  68. /// <summary>
  69. /// 验证访问头
  70. /// </summary>
  71. /// <param name="accountCode">帐套编码</param>
  72. /// <param name="userCode">用户编码</param>
  73. /// <param name="userPassword">用户密码</param>
  74. /// <param name="sessionKey">访问密钥</param>
  75. /// <returns></returns>
  76. private ActionResult DoPDACheck(string accountCode, string userCode, string userPassword, string sessionKey)
  77. {
  78. try
  79. {
  80. ActionResult actionResult = new ActionResult();
  81. LoginRequestEntity requestEntity = new LoginRequestEntity();
  82. requestEntity.AccountCode = accountCode;
  83. requestEntity.UserCode = userCode;
  84. requestEntity.Password = userPassword;
  85. requestEntity.SessionKey = sessionKey;
  86. SUserInfo userInfo = null;
  87. string loginStatus = DKIBOSSPRDLogic.AuthenticateRepeatLogin(requestEntity, out userInfo);
  88. // 用户登录信息错误
  89. if (Constant.INT_IS_ONE.ToString().Equals(loginStatus))
  90. {
  91. actionResult.Status = (int)Constant.PDAResult.LoginInfoError;
  92. actionResult.Message = Constant.PDA_RESULT_LOGININFOERROR;
  93. }
  94. // 用户在其它终端登陆
  95. else if (Constant.INT_IS_TWO.ToString().Equals(loginStatus))
  96. {
  97. actionResult.Status = (int)Constant.PDAResult.RepeatLogin;
  98. actionResult.Message = Constant.PDA_RESULT_REPEATLOGIN;
  99. }
  100. // Lic错误
  101. else if ("3".Equals(loginStatus))
  102. {
  103. actionResult.Status = (int)Constant.PDAResult.LicInfoError;
  104. actionResult.Message = "授权信息错误,请联系管理员。";
  105. }
  106. else
  107. {
  108. actionResult.Status = (int)Constant.PDAResult.Success;
  109. }
  110. sUserInfo = userInfo;
  111. return actionResult;
  112. }
  113. catch (Exception ex)
  114. {
  115. throw ex;
  116. }
  117. }
  118. #endregion
  119. #region WCF服务
  120. /// <summary>
  121. /// 测试PDA连接WCF服务
  122. /// </summary>
  123. /// <param name="value">测试文本</param>
  124. /// <returns>返回文本</returns>
  125. public string TestConnectionEx(string value)
  126. {
  127. return "连接成功!" + value;
  128. }
  129. public string TestConnection()
  130. {
  131. return "连接成功!";
  132. }
  133. #endregion
  134. #region 系统登录
  135. /// <summary>
  136. /// 系统登录
  137. /// </summary>
  138. /// <param name="accountCode"></param>
  139. /// <param name="userCode"></param>
  140. /// <param name="userPassword"></param>
  141. /// <param name="macAddress"></param>
  142. /// <param name="ipAddress"></param>
  143. /// <param name="phoneCode"></param>
  144. /// <param name="phoneType"></param>
  145. /// <param name="appVersion"></param>
  146. /// <param name="systemType"></param>
  147. /// <param name="systemVersion"></param>
  148. /// <returns></returns>
  149. public PDALoginResult DoPDALogin(string accountCode, string userCode, string userPassword,
  150. string macAddress, string ipAddress, string phoneCode, string phoneType,
  151. string appVersion, string systemType, string systemVersion)
  152. {
  153. try
  154. {
  155. LoginRequestEntity requestEntity = new LoginRequestEntity();
  156. requestEntity.AccountCode = accountCode;
  157. requestEntity.UserCode = userCode;
  158. requestEntity.Password = userPassword;
  159. requestEntity.ComputerName = phoneCode;
  160. requestEntity.IPAddress = ipAddress;
  161. requestEntity.MACAddress = macAddress;
  162. PDALoginResult result = ServiceInvoker.Invoke<PDALoginResult>(this,
  163. () => PDAModuleLogic.DoPDALogin(requestEntity));
  164. return result;
  165. }
  166. catch (Exception ex)
  167. {
  168. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  169. OutputLog.TraceLog(LogPriority.Error,
  170. this.ToString(),
  171. System.Reflection.MethodBase.GetCurrentMethod().Name,
  172. ex.ToString(),
  173. LocalPath.LogExePath);
  174. PDALoginResult result = new PDALoginResult();
  175. result.Status = (int)Constant.PDAResult.Exception;
  176. result.Message = Constant.PDA_RESULT_EXCEPTION;
  177. return result;
  178. }
  179. }
  180. /// <summary>
  181. /// 退出
  182. /// </summary>
  183. /// <param name="accountCode">帐套code</param>
  184. /// <param name="userCode">用户code</param>
  185. /// <param name="userPassword">用户密码</param>
  186. /// <param name="sessionKey">本次登陆密钥</param>
  187. /// <returns></returns>
  188. public ActionResult DoPDAOut(string accountCode, string userCode, string userPassword, string sessionKey)
  189. {
  190. ActionResult actionResult = new ActionResult();
  191. try
  192. {
  193. // 验证请求头信息
  194. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  195. // 验证失败
  196. if (actionResult.Status != (int)Constant.PDAResult.Success)
  197. {
  198. return actionResult;
  199. }
  200. bool result = DKIBOSSPRDLogic.Logout(sUserInfo.UserID, "3", sUserInfo);
  201. actionResult.Result = JsonHelper.ToJson(result);
  202. actionResult.Status = (int)Constant.PDAResult.Success;
  203. }
  204. catch (Exception ex)
  205. {
  206. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  207. OutputLog.TraceLog(LogPriority.Error,
  208. this.ToString(),
  209. System.Reflection.MethodBase.GetCurrentMethod().Name,
  210. ex.ToString(),
  211. LocalPath.LogExePath);
  212. actionResult.Status = (int)Constant.PDAResult.Exception;
  213. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  214. }
  215. return actionResult;
  216. }
  217. /// <summary>
  218. /// 修改密码
  219. /// </summary>
  220. /// <param name="accountCode"></param>
  221. /// <param name="userCode"></param>
  222. /// <param name="userPassword"></param>
  223. /// <param name="sessionKey"></param>
  224. /// <returns></returns>
  225. public ActionResult ChangeUserPassword(string accountCode, string userCode, string userPassword, string sessionKey,
  226. string newPassWord)
  227. {
  228. ActionResult actionResult = new ActionResult();
  229. try
  230. {
  231. // 验证请求头信息
  232. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  233. // 验证失败
  234. if (actionResult.Status != (int)Constant.PDAResult.Success)
  235. {
  236. return actionResult;
  237. }
  238. string result = ServiceInvoker.Invoke<string>(this,
  239. () => SystemModuleDAL.SaveUserPassWord(newPassWord, userCode, null, sUserInfo));
  240. actionResult.Status = (int)Constant.PDAResult.Success;
  241. }
  242. catch (Exception ex)
  243. {
  244. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  245. OutputLog.TraceLog(LogPriority.Error,
  246. this.ToString(),
  247. System.Reflection.MethodBase.GetCurrentMethod().Name,
  248. ex.ToString(),
  249. LocalPath.LogExePath);
  250. actionResult.Status = (int)Constant.PDAResult.Exception;
  251. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  252. }
  253. return actionResult;
  254. }
  255. /// <summary>
  256. /// 获取Apk信息
  257. /// </summary>
  258. /// <returns></returns>
  259. public string GetApkInfoNew(int sdk)
  260. {
  261. try
  262. {
  263. ServiceResultEntity sre = PDAModuleLogic.GetApkInfo(sdk);
  264. return JsonHelper.ToJson(sre);
  265. }
  266. catch (Exception ex)
  267. {
  268. OutputLog.TraceLog(LogPriority.Error,
  269. this.ToString(),
  270. System.Reflection.MethodBase.GetCurrentMethod().Name,
  271. ex.ToString(),
  272. LocalPath.LogExePath);
  273. return null;
  274. }
  275. }
  276. /// <summary>
  277. /// 获取Apk信息
  278. /// </summary>
  279. /// <returns></returns>
  280. public string GetApkInfo()
  281. {
  282. try
  283. {
  284. ServiceResultEntity sre = PDAModuleLogic.GetApkInfo();
  285. return JsonHelper.ToJson(sre);
  286. }
  287. catch (Exception ex)
  288. {
  289. OutputLog.TraceLog(LogPriority.Error,
  290. this.ToString(),
  291. System.Reflection.MethodBase.GetCurrentMethod().Name,
  292. ex.ToString(),
  293. LocalPath.LogExePath);
  294. return null;
  295. }
  296. }
  297. #endregion
  298. #region 取得展示数据
  299. /// <summary>
  300. /// 获得生产线菜单
  301. /// </summary>
  302. /// <param name="accountCode">帐套code</param>
  303. /// <param name="userCode">用户code</param>
  304. /// <param name="userPassword">用户密码</param>
  305. /// <param name="sessionKey">本次登陆密钥</param>
  306. /// <returns></returns>
  307. /// <remarks>
  308. /// 陈冰 2014.09.18 新建
  309. /// </remarks>
  310. public ActionResult GetProductionLineMenu(string accountCode, string userCode, string userPassword, string sessionKey)
  311. {
  312. ActionResult actionResult = new ActionResult();
  313. try
  314. {
  315. // 验证请求头信息
  316. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  317. // 验证失败
  318. if (actionResult.Status != (int)Constant.PDAResult.Success)
  319. {
  320. return actionResult;
  321. }
  322. // 查询菜单
  323. DataTable dtPLM = ServiceInvoker.Invoke<DataTable>(this,
  324. () => PDAModuleLogic.GetProductionLineMenu(sUserInfo));
  325. PDAFunctionResult pdaFunction = new PDAFunctionResult();
  326. pdaFunction.MenuCode = "Root";
  327. DataRow[] navigationRows = dtPLM.Select("LEN(MenuCode) = " + Constant.INT_IS_TWO.ToString(), "MenuCode ASC"); // 编号2为一级菜单
  328. foreach (DataRow newRow in navigationRows)
  329. {
  330. #region 插入子节点数据
  331. int? intProcedureID = null;
  332. int? intModelType = null;
  333. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  334. {
  335. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  336. }
  337. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  338. {
  339. intModelType = Convert.ToInt32(newRow["ModelType"]);
  340. }
  341. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  342. //xuwei add 2020-01-02
  343. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  344. //pdaFunctionChild.IsGlazeChange = 0;
  345. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  346. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  347. pdaFunctionChild.ProcedureID = intProcedureID;
  348. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  349. pdaFunctionChild.ModelType = intModelType;
  350. pdaFunction.PDAFunctions.Add(pdaFunctionChild);
  351. #endregion
  352. InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild);
  353. }
  354. //actionResult.Result = JsonHelper.ToJson(dtPLM);
  355. actionResult.Result = JsonHelper.ToJson(pdaFunction);
  356. actionResult.Status = (int)Constant.PDAResult.Success;
  357. }
  358. catch (Exception ex)
  359. {
  360. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  361. OutputLog.TraceLog(LogPriority.Error,
  362. this.ToString(),
  363. System.Reflection.MethodBase.GetCurrentMethod().Name,
  364. ex.ToString(),
  365. LocalPath.LogExePath);
  366. actionResult.Status = (int)Constant.PDAResult.Exception;
  367. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  368. }
  369. return actionResult;
  370. }
  371. /// <summary>
  372. /// 初始化树形控件
  373. /// </summary>
  374. /// <param name="treeTable">菜单数据表</param>
  375. /// <param name="rows">待处理的菜单集合</param>
  376. /// <param name="node">当前树节点</param>
  377. private void InitTreeView(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions)
  378. {
  379. string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = "
  380. + (pFuncCode.Length + Constant.INT_IS_TWO);
  381. DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC");
  382. //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC");
  383. foreach (DataRow newRow in subRows)
  384. {
  385. #region 插入子节点数据
  386. int? intProcedureID = null;
  387. int? intModelType = null;
  388. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  389. {
  390. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  391. }
  392. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  393. {
  394. intModelType = Convert.ToInt32(newRow["ModelType"]);
  395. }
  396. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  397. //xuwei add 2020-01-02
  398. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  399. //pdaFunctionChild.IsGlazeChange = 0;
  400. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  401. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  402. pdaFunctionChild.ProcedureID = intProcedureID;
  403. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  404. pdaFunctionChild.ModelType = intModelType;
  405. pFunctions.PDAFunctions.Add(pdaFunctionChild);
  406. #endregion
  407. // 递归方法
  408. InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild);
  409. }
  410. }
  411. #endregion
  412. #region 获得工序信息
  413. /// <summary>
  414. /// 获得工序信息
  415. /// </summary>
  416. /// <param name="accountCode">帐套code</param>
  417. /// <param name="userCode">用户code</param>
  418. /// <param name="userPassword">用户密码</param>
  419. /// <param name="sessionKey">本次登陆密钥</param>
  420. /// <param name="procedureID">工序ID</param>
  421. /// <returns></returns>
  422. /// <remarks>
  423. /// 陈冰 2014.09.18 新建
  424. /// </remarks>
  425. public ActionResult GetProcedureByID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  426. {
  427. ActionResult actionResult = new ActionResult();
  428. try
  429. {
  430. // 验证请求头信息
  431. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  432. // 验证失败
  433. if (actionResult.Status != (int)Constant.PDAResult.Success)
  434. {
  435. return actionResult;
  436. }
  437. ProcedureEntity procedureEntity = ServiceInvoker.Invoke<ProcedureEntity>(this,
  438. () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo));
  439. actionResult.Result = JsonHelper.ToJson(procedureEntity);
  440. actionResult.Status = (int)Constant.PDAResult.Success;
  441. }
  442. catch (Exception ex)
  443. {
  444. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  445. OutputLog.TraceLog(LogPriority.Error,
  446. this.ToString(),
  447. System.Reflection.MethodBase.GetCurrentMethod().Name,
  448. ex.ToString(),
  449. LocalPath.LogExePath);
  450. actionResult.Status = (int)Constant.PDAResult.Exception;
  451. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  452. }
  453. return actionResult;
  454. }
  455. #endregion
  456. #region 校验
  457. /// <summary>
  458. /// 校验产品条码是否可以走到该工序
  459. /// </summary>
  460. /// <param name="accountCode">帐套code</param>
  461. /// <param name="userCode">用户code</param>
  462. /// <param name="userPassword">用户密码</param>
  463. /// <param name="sessionKey">本次登陆密钥</param>
  464. /// <param name="procedureID">工序ID</param>
  465. /// <param name="barcode">条码</param>
  466. /// <returns></returns>
  467. /// <remarks>
  468. /// 陈冰 2014.09.18 新建
  469. /// </remarks>
  470. public ActionResult CheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode, bool isNewCheck)
  471. {
  472. ActionResult actionResult = new ActionResult();
  473. try
  474. {
  475. // 验证请求头信息
  476. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  477. // 验证失败
  478. if (actionResult.Status != (int)Constant.PDAResult.Success)
  479. {
  480. return actionResult;
  481. }
  482. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  483. () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo));
  484. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  485. {
  486. if (isNewCheck)
  487. {
  488. actionResult.Result = JsonHelper.ToJson(barcodeDataSet);
  489. }
  490. else
  491. {
  492. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  493. }
  494. actionResult.Status = (int)Constant.PDAResult.Success;
  495. }
  496. else
  497. {
  498. actionResult.Status = (int)Constant.PDAResult.Fail;
  499. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  500. }
  501. }
  502. catch (Exception ex)
  503. {
  504. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  505. OutputLog.TraceLog(LogPriority.Error,
  506. this.ToString(),
  507. System.Reflection.MethodBase.GetCurrentMethod().Name,
  508. ex.ToString(),
  509. LocalPath.LogExePath);
  510. actionResult.Status = (int)Constant.PDAResult.Exception;
  511. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  512. }
  513. return actionResult;
  514. }
  515. /// <summary>
  516. /// 校验产品条码是否可以进行干补
  517. /// </summary>
  518. /// <param name="accountCode">帐套code</param>
  519. /// <param name="userCode">用户code</param>
  520. /// <param name="userPassword">用户密码</param>
  521. /// <param name="sessionKey">本次登陆密钥</param>
  522. /// <param name="procedureID">工序ID</param>
  523. /// <param name="barcode">条码</param>
  524. /// <returns></returns>
  525. /// <remarks>
  526. /// 袁新成 2015.4.1 新建
  527. /// </remarks>
  528. public ActionResult CheckDryRepairBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  529. {
  530. ActionResult actionResult = new ActionResult();
  531. try
  532. {
  533. // 验证请求头信息
  534. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  535. // 验证失败
  536. if (actionResult.Status != (int)Constant.PDAResult.Success)
  537. {
  538. return actionResult;
  539. }
  540. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  541. () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
  542. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  543. {
  544. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  545. actionResult.Status = (int)Constant.PDAResult.Success;
  546. }
  547. else
  548. {
  549. actionResult.Status = (int)Constant.PDAResult.Fail;
  550. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  551. }
  552. }
  553. catch (Exception ex)
  554. {
  555. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  556. OutputLog.TraceLog(LogPriority.Error,
  557. this.ToString(),
  558. System.Reflection.MethodBase.GetCurrentMethod().Name,
  559. ex.ToString(),
  560. LocalPath.LogExePath);
  561. actionResult.Status = (int)Constant.PDAResult.Exception;
  562. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  563. }
  564. return actionResult;
  565. }
  566. /// <summary>
  567. /// 检验生产工号
  568. /// </summary>
  569. /// <param name="accountCode">帐套code</param>
  570. /// <param name="userCode">用户code</param>
  571. /// <param name="userPassword">用户密码</param>
  572. /// <param name="sessionKey">本次登陆密钥</param>
  573. /// <param name="procedureID">工序ID</param>
  574. /// <param name="procedureUserCode">生产工号</param>
  575. /// <remarks>
  576. /// 陈冰 2014.09.18 新建
  577. /// </remarks>
  578. public ActionResult CheckProcedureUser(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
  579. {
  580. ActionResult actionResult = new ActionResult();
  581. try
  582. {
  583. // 验证请求头信息
  584. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  585. // 验证失败
  586. if (actionResult.Status != (int)Constant.PDAResult.Success)
  587. {
  588. return actionResult;
  589. }
  590. CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
  591. () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
  592. actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
  593. actionResult.Status = (int)Constant.PDAResult.Success;
  594. }
  595. catch (Exception ex)
  596. {
  597. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  598. OutputLog.TraceLog(LogPriority.Error,
  599. this.ToString(),
  600. System.Reflection.MethodBase.GetCurrentMethod().Name,
  601. ex.ToString(),
  602. LocalPath.LogExePath);
  603. actionResult.Status = (int)Constant.PDAResult.Exception;
  604. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  605. }
  606. return actionResult;
  607. }
  608. /// <summary>
  609. /// 校验窑车是否可装车并返回窑车信息
  610. /// </summary>
  611. /// <param name="accountCode">帐套code</param>
  612. /// <param name="userCode">用户code</param>
  613. /// <param name="userPassword">用户密码</param>
  614. /// <param name="sessionKey">本次登陆密钥</param>
  615. /// <param name="kilnCarCode">窑车号</param>
  616. /// <param name="modelType">工序类别</param>
  617. /// <returns></returns>
  618. /// <remarks>
  619. /// 陈冰 2014.10.04 新建
  620. /// </remarks>
  621. public ActionResult CheckKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
  622. {
  623. ActionResult actionResult = new ActionResult();
  624. try
  625. {
  626. // 验证请求头信息
  627. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  628. // 验证失败
  629. if (actionResult.Status != (int)Constant.PDAResult.Success)
  630. {
  631. return actionResult;
  632. }
  633. CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
  634. () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
  635. actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
  636. actionResult.Status = (int)Constant.PDAResult.Success;
  637. }
  638. catch (Exception ex)
  639. {
  640. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  641. OutputLog.TraceLog(LogPriority.Error,
  642. this.ToString(),
  643. System.Reflection.MethodBase.GetCurrentMethod().Name,
  644. ex.ToString(),
  645. LocalPath.LogExePath);
  646. actionResult.Status = (int)Constant.PDAResult.Exception;
  647. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  648. }
  649. return actionResult;
  650. }
  651. #endregion
  652. #region 保存条码信息
  653. /// <summary>
  654. /// 保存条码信息
  655. /// </summary>
  656. /// <param name="accountCode">帐套code</param>
  657. /// <param name="userCode">用户code</param>
  658. /// <param name="userPassword">用户密码</param>
  659. /// <param name="sessionKey">本次登陆密钥</param>
  660. /// <param name="procedureID">工序ID</param>
  661. /// <param name="productionDataEntitys">条码信息</param>
  662. public ActionResult AddWorkPiece(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID,
  663. ProductionDataEntity[] productionDataEntitys)
  664. {
  665. ActionResult actionResult = new ActionResult();
  666. try
  667. {
  668. // 验证请求头信息
  669. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  670. // 验证失败
  671. if (actionResult.Status != (int)Constant.PDAResult.Success)
  672. {
  673. return actionResult;
  674. }
  675. DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
  676. if (!dtProductionData.Columns.Contains("IsPDA"))
  677. {
  678. dtProductionData.Columns.Add("IsPDA");
  679. }
  680. ProcedureEntity procedureInfo = null;
  681. DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
  682. () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
  683. actionResult.Result = JsonHelper.ToJson(resultDT);
  684. actionResult.Status = (int)Constant.PDAResult.Success;
  685. if (resultDT != null)
  686. {
  687. DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
  688. if (drs != null && drs.Length > 0)
  689. {
  690. return actionResult;
  691. }
  692. }
  693. #region PDA条码打印
  694. if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
  695. procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
  696. {
  697. try
  698. {
  699. if (procedureInfo.CollectType == 1)
  700. {
  701. //foreach (DataRow item in dtProductionData.Rows)
  702. //{
  703. // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
  704. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  705. // if (sre.Status != Constant.ServiceResultStatus.Success)
  706. // {
  707. // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  708. // actionResult.Message = sre.Message;
  709. // return actionResult;
  710. // }
  711. //}
  712. //裸瓷包装集中采集可以进行条码打印 add by qq 20250530
  713. if (procedureInfo.ProcedureID == 159)
  714. {
  715. ServiceResultEntity sre = BarcodePrintLogic.LCPrintBarcode_3C(dtProductionData,dtProductionData.Rows.Count, dtProductionData.Rows[0]["barcode"].ToString(),
  716. procedureInfo.BarCodePrintCopies, null, sUserInfo, 0);
  717. if (sre.Status != Constant.ServiceResultStatus.Success)
  718. {
  719. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  720. actionResult.Message = sre.Message;
  721. return actionResult;
  722. }
  723. }
  724. }
  725. else
  726. {
  727. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
  728. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  729. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(dtProductionData.Rows[0]["barcode"].ToString(),
  730. procedureInfo.BarCodePrintCopies, null, sUserInfo, 0);
  731. if (sre.Status != Constant.ServiceResultStatus.Success)
  732. {
  733. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  734. actionResult.Message = sre.Message;
  735. return actionResult;
  736. }
  737. }
  738. }
  739. catch (Exception ex)
  740. {
  741. OutputLog.TraceLog(LogPriority.Error,
  742. this.ToString(),
  743. System.Reflection.MethodBase.GetCurrentMethod().Name,
  744. ex.ToString(),
  745. LocalPath.LogExePath);
  746. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  747. actionResult.Message = "条码打印异常";
  748. return actionResult;
  749. }
  750. }
  751. #endregion PDA条码打印
  752. }
  753. catch (Exception ex)
  754. {
  755. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  756. OutputLog.TraceLog(LogPriority.Error,
  757. this.ToString(),
  758. System.Reflection.MethodBase.GetCurrentMethod().Name,
  759. ex.ToString(),
  760. LocalPath.LogExePath);
  761. try
  762. {
  763. string ss = JsonHelper.ToJson(productionDataEntitys);
  764. OutputLog.TraceLog(LogPriority.Error,
  765. this.ToString(),
  766. System.Reflection.MethodBase.GetCurrentMethod().Name,
  767. $" userCode:{userCode} procedureID:{procedureID} " + ss,
  768. LocalPath.LogExePath);
  769. }
  770. catch
  771. {
  772. }
  773. actionResult.Status = (int)Constant.PDAResult.Exception;
  774. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  775. }
  776. return actionResult;
  777. }
  778. #endregion
  779. #region 获得系统/基数数据
  780. /// <summary>
  781. /// 获得数据字典
  782. /// </summary>
  783. /// <param name="accountCode">帐套code</param>
  784. /// <param name="userCode">用户code</param>
  785. /// <param name="userPassword">用户密码</param>
  786. /// <param name="sessionKey">本次登陆密钥</param>
  787. /// <param name="dicType">字典类型</param>
  788. /// <returns></returns>
  789. public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  790. {
  791. ActionResult actionResult = new ActionResult();
  792. try
  793. {
  794. // 验证请求头信息
  795. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  796. // 验证失败
  797. if (actionResult.Status != (int)Constant.PDAResult.Success)
  798. {
  799. return actionResult;
  800. }
  801. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  802. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  803. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  804. actionResult.Status = (int)Constant.PDAResult.Success;
  805. }
  806. catch (Exception ex)
  807. {
  808. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  809. OutputLog.TraceLog(LogPriority.Error,
  810. this.ToString(),
  811. System.Reflection.MethodBase.GetCurrentMethod().Name,
  812. ex.ToString(),
  813. LocalPath.LogExePath);
  814. actionResult.Status = (int)Constant.PDAResult.Exception;
  815. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  816. }
  817. return actionResult;
  818. }
  819. #endregion
  820. #region 检验工序接口
  821. /// <summary>
  822. /// 获得检验标识
  823. /// </summary>
  824. /// <param name="accountCode">帐套code</param>
  825. /// <param name="userCode">用户code</param>
  826. /// <param name="userPassword">用户密码</param>
  827. /// <param name="sessionKey">本次登陆密钥</param>
  828. /// <returns></returns>
  829. /// <remarks>
  830. /// 陈冰 2014.10.04 新建
  831. /// </remarks>
  832. public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey)
  833. {
  834. ActionResult actionResult = new ActionResult();
  835. try
  836. {
  837. // 验证请求头信息
  838. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  839. // 验证失败
  840. if (actionResult.Status != (int)Constant.PDAResult.Success)
  841. {
  842. return actionResult;
  843. }
  844. #region 构造缺陷标识的数据源
  845. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  846. #endregion
  847. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  848. actionResult.Status = (int)Constant.PDAResult.Success;
  849. }
  850. catch (Exception ex)
  851. {
  852. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  853. OutputLog.TraceLog(LogPriority.Error,
  854. this.ToString(),
  855. System.Reflection.MethodBase.GetCurrentMethod().Name,
  856. ex.ToString(),
  857. LocalPath.LogExePath);
  858. actionResult.Status = (int)Constant.PDAResult.Exception;
  859. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  860. }
  861. return actionResult;
  862. }
  863. /// <summary>
  864. /// 由条码和当前检验工序获取返工工序
  865. /// </summary>
  866. /// <param name="accountCode">帐套code</param>
  867. /// <param name="userCode">用户code</param>
  868. /// <param name="userPassword">用户密码</param>
  869. /// <param name="sessionKey">本次登陆密钥</param>
  870. /// <param name="procedureID">当前检验工序ID</param>
  871. /// <param name="barcode">条码</param>
  872. /// <returns></returns>
  873. /// <remarks>
  874. /// 陈冰 2014.10.04 新建
  875. /// </remarks>
  876. public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  877. {
  878. ActionResult actionResult = new ActionResult();
  879. try
  880. {
  881. // 验证请求头信息
  882. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  883. // 验证失败
  884. if (actionResult.Status != (int)Constant.PDAResult.Success)
  885. {
  886. return actionResult;
  887. }
  888. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  889. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  890. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  891. {
  892. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  893. actionResult.Status = (int)Constant.PDAResult.Success;
  894. }
  895. else
  896. {
  897. actionResult.Status = (int)Constant.PDAResult.Fail;
  898. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  899. }
  900. }
  901. catch (Exception ex)
  902. {
  903. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  904. OutputLog.TraceLog(LogPriority.Error,
  905. this.ToString(),
  906. System.Reflection.MethodBase.GetCurrentMethod().Name,
  907. ex.ToString(),
  908. LocalPath.LogExePath);
  909. actionResult.Status = (int)Constant.PDAResult.Exception;
  910. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  911. }
  912. return actionResult;
  913. }
  914. /// <summary>
  915. /// 由当前检验工序获取缺陷列表
  916. /// </summary>
  917. /// <param name="accountCode">帐套code</param>
  918. /// <param name="userCode">用户code</param>
  919. /// <param name="userPassword">用户密码</param>
  920. /// <param name="sessionKey">本次登陆密钥</param>
  921. /// <param name="procedureID">当前检验工序ID</param>
  922. /// <param name="defectCode">缺陷编码</param>
  923. /// <returns></returns>
  924. /// <remarks>
  925. /// 陈冰 2014.10.04 新建
  926. /// </remarks>
  927. public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  928. {
  929. ActionResult actionResult = new ActionResult();
  930. try
  931. {
  932. // 验证请求头信息
  933. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  934. // 验证失败
  935. if (actionResult.Status != (int)Constant.PDAResult.Success)
  936. {
  937. return actionResult;
  938. }
  939. object defectDs = ServiceInvoker.Invoke<object>(this,
  940. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  941. if (defectDs != null)
  942. {
  943. actionResult.Result = JsonHelper.ToJson(defectDs);
  944. actionResult.Status = (int)Constant.PDAResult.Success;
  945. }
  946. else
  947. {
  948. actionResult.Status = (int)Constant.PDAResult.Fail;
  949. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  950. }
  951. }
  952. catch (Exception ex)
  953. {
  954. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  955. OutputLog.TraceLog(LogPriority.Error,
  956. this.ToString(),
  957. System.Reflection.MethodBase.GetCurrentMethod().Name,
  958. ex.ToString(),
  959. LocalPath.LogExePath);
  960. actionResult.Status = (int)Constant.PDAResult.Exception;
  961. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  962. }
  963. return actionResult;
  964. }
  965. /// <summary>
  966. /// 根据产品ID查出缺陷位置
  967. /// </summary>
  968. /// <param name="accountCode">帐套code</param>
  969. /// <param name="userCode">用户code</param>
  970. /// <param name="userPassword">用户密码</param>
  971. /// <param name="sessionKey">本次登陆密钥</param>
  972. /// <param name="goodsID">产品ID</param>
  973. /// <param name="positionCode">位置编码</param>
  974. /// <returns></returns>
  975. /// <remarks>
  976. /// 陈冰 2014.10.04 新建
  977. /// </remarks>
  978. public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  979. {
  980. ActionResult actionResult = new ActionResult();
  981. try
  982. {
  983. // 验证请求头信息
  984. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  985. // 验证失败
  986. if (actionResult.Status != (int)Constant.PDAResult.Success)
  987. {
  988. return actionResult;
  989. }
  990. // 缺陷位置已经不用在关联产品
  991. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  992. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  993. if (defectDs != null)
  994. {
  995. actionResult.Result = JsonHelper.ToJson(defectDs);
  996. actionResult.Status = (int)Constant.PDAResult.Success;
  997. }
  998. else
  999. {
  1000. actionResult.Status = (int)Constant.PDAResult.Fail;
  1001. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1002. }
  1003. }
  1004. catch (Exception ex)
  1005. {
  1006. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1007. OutputLog.TraceLog(LogPriority.Error,
  1008. this.ToString(),
  1009. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1010. ex.ToString(),
  1011. LocalPath.LogExePath);
  1012. actionResult.Status = (int)Constant.PDAResult.Exception;
  1013. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1014. }
  1015. return actionResult;
  1016. }
  1017. /// <summary>
  1018. /// 通过条码和缺陷查出责任工序
  1019. /// </summary>
  1020. /// <param name="accountCode">帐套code</param>
  1021. /// <param name="userCode">用户code</param>
  1022. /// <param name="userPassword">用户密码</param>
  1023. /// <param name="sessionKey">本次登陆密钥</param>
  1024. /// <param name="barcode">条码</param>
  1025. /// <param name="defectid">缺陷ID</param>
  1026. /// <returns></returns>
  1027. /// <remarks>
  1028. /// 陈冰 2014.10.04 新建
  1029. /// </remarks>
  1030. public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  1031. {
  1032. ActionResult actionResult = new ActionResult();
  1033. try
  1034. {
  1035. // 验证请求头信息
  1036. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1037. // 验证失败
  1038. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1039. {
  1040. return actionResult;
  1041. }
  1042. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1043. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  1044. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1045. {
  1046. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  1047. actionResult.Status = (int)Constant.PDAResult.Success;
  1048. }
  1049. else
  1050. {
  1051. actionResult.Status = (int)Constant.PDAResult.Fail;
  1052. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1053. }
  1054. }
  1055. catch (Exception ex)
  1056. {
  1057. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1058. OutputLog.TraceLog(LogPriority.Error,
  1059. this.ToString(),
  1060. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1061. ex.ToString(),
  1062. LocalPath.LogExePath);
  1063. actionResult.Status = (int)Constant.PDAResult.Exception;
  1064. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1065. }
  1066. return actionResult;
  1067. }
  1068. /// <summary>
  1069. /// 通过条码与工序查出责任工号(己废)
  1070. /// </summary>
  1071. /// <param name="accountCode">帐套code</param>
  1072. /// <param name="userCode">用户code</param>
  1073. /// <param name="userPassword">用户密码</param>
  1074. /// <param name="sessionKey">本次登陆密钥</param>
  1075. /// <param name="barcode">条码</param>
  1076. /// <param name="dutyProcedureID">责任工序</param>
  1077. /// <returns></returns>
  1078. /// <remarks>
  1079. /// 陈冰 2014.10.04 新建
  1080. /// </remarks>
  1081. public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  1082. {
  1083. ActionResult actionResult = new ActionResult();
  1084. try
  1085. {
  1086. // 验证请求头信息
  1087. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1088. // 验证失败
  1089. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1090. {
  1091. return actionResult;
  1092. }
  1093. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1094. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  1095. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1096. {
  1097. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1098. actionResult.Status = (int)Constant.PDAResult.Success;
  1099. }
  1100. else
  1101. {
  1102. actionResult.Status = (int)Constant.PDAResult.Fail;
  1103. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1104. }
  1105. }
  1106. catch (Exception ex)
  1107. {
  1108. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1109. OutputLog.TraceLog(LogPriority.Error,
  1110. this.ToString(),
  1111. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1112. ex.ToString(),
  1113. LocalPath.LogExePath);
  1114. actionResult.Status = (int)Constant.PDAResult.Exception;
  1115. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1116. }
  1117. return actionResult;
  1118. }
  1119. /// <summary>
  1120. /// 通过条码与工序查出责任工号
  1121. /// </summary>
  1122. /// <param name="accountCode"></param>
  1123. /// <param name="userCode"></param>
  1124. /// <param name="userPassword"></param>
  1125. /// <param name="sessionKey"></param>
  1126. /// <param name="ProductionDataID">生产数据ID</param>
  1127. /// <returns></returns>
  1128. public ActionResult GetDutyProcedureCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1129. {
  1130. ActionResult actionResult = new ActionResult();
  1131. try
  1132. {
  1133. // 验证请求头信息
  1134. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1135. // 验证失败
  1136. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1137. {
  1138. return actionResult;
  1139. }
  1140. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1141. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1142. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1143. {
  1144. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1145. actionResult.Status = (int)Constant.PDAResult.Success;
  1146. }
  1147. else
  1148. {
  1149. actionResult.Status = (int)Constant.PDAResult.Fail;
  1150. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1151. }
  1152. }
  1153. catch (Exception ex)
  1154. {
  1155. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1156. OutputLog.TraceLog(LogPriority.Error,
  1157. this.ToString(),
  1158. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1159. ex.ToString(),
  1160. LocalPath.LogExePath);
  1161. actionResult.Status = (int)Constant.PDAResult.Exception;
  1162. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1163. }
  1164. return actionResult;
  1165. }
  1166. /// <summary>
  1167. /// 通过生产数据与工号ID查询工种
  1168. /// </summary>
  1169. /// <param name="accountCode">帐套code</param>
  1170. /// <param name="userCode">用户code</param>
  1171. /// <param name="userPassword">用户密码</param>
  1172. /// <param name="sessionKey">本次登陆密钥</param>
  1173. /// <param name="productionDataID">生产数据ID</param>
  1174. /// <param name="userID">工号ID</param>
  1175. /// <returns></returns>
  1176. /// <remarks>
  1177. /// 陈冰 2014.10.08 新建
  1178. /// </remarks>
  1179. public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey,
  1180. //int productionDataID, int userID)
  1181. int classesSettingID, int defectid, int procedureID)
  1182. {
  1183. ActionResult actionResult = new ActionResult();
  1184. try
  1185. {
  1186. // 验证请求头信息
  1187. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1188. // 验证失败
  1189. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1190. {
  1191. return actionResult;
  1192. }
  1193. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1194. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1195. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  1196. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1197. {
  1198. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1199. actionResult.Status = (int)Constant.PDAResult.Success;
  1200. }
  1201. else
  1202. {
  1203. actionResult.Status = (int)Constant.PDAResult.Fail;
  1204. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1205. }
  1206. }
  1207. catch (Exception ex)
  1208. {
  1209. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1210. OutputLog.TraceLog(LogPriority.Error,
  1211. this.ToString(),
  1212. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1213. ex.ToString(),
  1214. LocalPath.LogExePath);
  1215. actionResult.Status = (int)Constant.PDAResult.Exception;
  1216. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1217. }
  1218. return actionResult;
  1219. }
  1220. /// <summary>
  1221. /// 根据生产数据ID,用户ID及工种选出责任员工
  1222. /// </summary>
  1223. /// <param name="accountCode">帐套code</param>
  1224. /// <param name="userCode">用户code</param>
  1225. /// <param name="userPassword">用户密码</param>
  1226. /// <param name="sessionKey">本次登陆密钥</param>
  1227. /// <param name="productionDataID">生产数据ID</param>
  1228. /// <param name="userID">工号ID</param>
  1229. /// <param name="jobsID">工种ID</param>
  1230. /// <returns></returns>
  1231. /// <remarks>
  1232. /// 陈冰 2014.10.08 新建
  1233. /// </remarks>
  1234. public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey,
  1235. //int productionDataID, int userID, int jobsID)
  1236. int classesSettingID, int jobsID)
  1237. {
  1238. ActionResult actionResult = new ActionResult();
  1239. try
  1240. {
  1241. // 验证请求头信息
  1242. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1243. // 验证失败
  1244. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1245. {
  1246. return actionResult;
  1247. }
  1248. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1249. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1250. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1251. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1252. {
  1253. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1254. actionResult.Status = (int)Constant.PDAResult.Success;
  1255. }
  1256. else
  1257. {
  1258. actionResult.Status = (int)Constant.PDAResult.Fail;
  1259. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1260. }
  1261. }
  1262. catch (Exception ex)
  1263. {
  1264. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1265. OutputLog.TraceLog(LogPriority.Error,
  1266. this.ToString(),
  1267. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1268. ex.ToString(),
  1269. LocalPath.LogExePath);
  1270. actionResult.Status = (int)Constant.PDAResult.Exception;
  1271. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1272. }
  1273. return actionResult;
  1274. }
  1275. /// <summary>
  1276. /// 获得产品分级
  1277. /// </summary>
  1278. /// <param name="accountCode">帐套code</param>
  1279. /// <param name="userCode">用户code</param>
  1280. /// <param name="userPassword">用户密码</param>
  1281. /// <param name="sessionKey">本次登陆密钥</param>
  1282. /// <returns></returns>
  1283. /// <remarks>
  1284. /// 陈冰 2014.10.08 新建
  1285. /// xuwei 2019-12-4 添加参数type 默认为2成检 为1时 半检
  1286. /// </remarks>
  1287. public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey, int type = 2)
  1288. {
  1289. ActionResult actionResult = new ActionResult();
  1290. try
  1291. {
  1292. // 验证请求头信息
  1293. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1294. // 验证失败
  1295. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1296. {
  1297. return actionResult;
  1298. }
  1299. #region 构造产品分级的数据源
  1300. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1301. //xuwei modify 2019-12-04 支持半检 没传参数 type=0
  1302. //DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2 , sUserInfo);
  1303. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(type == 0 ? 2 : type, sUserInfo);
  1304. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1305. {
  1306. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1307. actionResult.Status = (int)Constant.PDAResult.Success;
  1308. }
  1309. else
  1310. {
  1311. actionResult.Status = (int)Constant.PDAResult.Fail;
  1312. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1313. }
  1314. #endregion
  1315. }
  1316. catch (Exception ex)
  1317. {
  1318. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1319. OutputLog.TraceLog(LogPriority.Error,
  1320. this.ToString(),
  1321. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1322. ex.ToString(),
  1323. LocalPath.LogExePath);
  1324. OutputLog.TraceLog(LogPriority.Error,
  1325. this.ToString(),
  1326. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1327. ex.ToString(),
  1328. LocalPath.LogExePath);
  1329. actionResult.Status = (int)Constant.PDAResult.Exception;
  1330. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1331. }
  1332. return actionResult;
  1333. }
  1334. #endregion
  1335. #region 保存检验条码
  1336. /// <summary>
  1337. /// 保存检验条码
  1338. /// </summary>
  1339. /// <param name="accountCode">帐套code</param>
  1340. /// <param name="userCode">用户code</param>
  1341. /// <param name="userPassword">用户密码</param>
  1342. /// <param name="sessionKey">本次登陆密钥</param>
  1343. /// <param name="procedureID">工序ID</param>
  1344. /// <param name="productionDataEntitys">条码信息</param>
  1345. /// <returns></returns>
  1346. public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1347. {
  1348. ActionResult actionResult = new ActionResult();
  1349. if (productionDataEntitys == null || productionDataEntitys.Length == 0 ||
  1350. string.IsNullOrWhiteSpace(productionDataEntitys[0].Barcode))
  1351. {
  1352. actionResult.Status = (int)Constant.PDAResult.Fail;
  1353. actionResult.Message = "无效条码";
  1354. return actionResult;
  1355. }
  1356. try
  1357. {
  1358. // 验证请求头信息
  1359. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1360. // 验证失败
  1361. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1362. {
  1363. return actionResult;
  1364. }
  1365. //if(productionDataEntitys.Length>0)
  1366. //{
  1367. // if(productionDataEntitys[0].ProductionDataID>0)
  1368. // {
  1369. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1370. // }
  1371. //}
  1372. string err = ServiceInvoker.Invoke<string>(this,
  1373. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1374. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1375. if (err == null)
  1376. {
  1377. err = "";
  1378. }
  1379. if (err == "DataDouble")
  1380. {
  1381. actionResult.Result = string.Format(Messages.MSG_HR_W006, "成检", "保存");
  1382. actionResult.Status = 2;
  1383. return actionResult;
  1384. }
  1385. else if (!string.IsNullOrEmpty(err))
  1386. {
  1387. actionResult.Result = err;
  1388. actionResult.Message = err;
  1389. actionResult.Status = 666;
  1390. return actionResult;
  1391. }
  1392. //actionResult.Result = JsonHelper.ToJson(err);
  1393. actionResult.Result = err;// JsonHelper.ToJson(err);
  1394. actionResult.Status = (int)Constant.PDAResult.Success;
  1395. }
  1396. catch (Exception ex)
  1397. {
  1398. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1399. OutputLog.TraceLog(LogPriority.Error,
  1400. this.ToString(),
  1401. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1402. ex.ToString(),
  1403. LocalPath.LogExePath);
  1404. actionResult.Status = (int)Constant.PDAResult.Exception;
  1405. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1406. }
  1407. return actionResult;
  1408. }
  1409. /// <summary>
  1410. /// 保存检验条码
  1411. /// </summary>
  1412. /// <param name="accountCode">帐套code</param>
  1413. /// <param name="userCode">用户code</param>
  1414. /// <param name="userPassword">用户密码</param>
  1415. /// <param name="sessionKey">本次登陆密钥</param>
  1416. /// <param name="procedureID">工序ID</param>
  1417. /// <param name="productionDataEntitys">条码信息</param>
  1418. /// <returns></returns>
  1419. public ActionResult AddBarcodeIdnrkScrap(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1420. {
  1421. ActionResult actionResult = new ActionResult();
  1422. if (productionDataEntitys == null || productionDataEntitys.Length == 0 ||
  1423. string.IsNullOrWhiteSpace(productionDataEntitys[0].Barcode))
  1424. {
  1425. actionResult.Status = (int)Constant.PDAResult.Fail;
  1426. actionResult.Message = "无效条码";
  1427. return actionResult;
  1428. }
  1429. try
  1430. {
  1431. // 验证请求头信息
  1432. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1433. // 验证失败
  1434. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1435. {
  1436. return actionResult;
  1437. }
  1438. string err = ServiceInvoker.Invoke<string>(this,
  1439. () => PMModuleLogicDAL.AddBarcodeIdnrkScrapPDA(procedureID, productionDataEntitys, sUserInfo));
  1440. if (err == null)
  1441. {
  1442. err = "";
  1443. }
  1444. actionResult.Result = err;
  1445. actionResult.Status = (int)Constant.PDAResult.Success;
  1446. }
  1447. catch (Exception ex)
  1448. {
  1449. OutputLog.TraceLog(LogPriority.Error,
  1450. this.ToString(),
  1451. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1452. ex.ToString(),
  1453. LocalPath.LogExePath);
  1454. actionResult.Status = (int)Constant.PDAResult.Exception;
  1455. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1456. }
  1457. return actionResult;
  1458. }
  1459. #endregion
  1460. #region 文件上传下载
  1461. /// <summary>
  1462. /// 软件更新
  1463. /// </summary>
  1464. /// <param name="accountCode">帐套code</param>
  1465. /// <param name="userCode">用户code</param>
  1466. /// <param name="userPassword">用户密码</param>
  1467. /// <param name="sessionKey">本次登陆密钥</param>
  1468. /// <returns></returns>
  1469. public Stream AutoUpgradeNew(string accountCode, string userCode, string userPassword, string sessionKey,int sdk)
  1470. {
  1471. try
  1472. {
  1473. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade(sdk));
  1474. }
  1475. catch (Exception ex)
  1476. {
  1477. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1478. OutputLog.TraceLog(LogPriority.Error,
  1479. this.ToString(),
  1480. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1481. ex.ToString(),
  1482. LocalPath.LogExePath);
  1483. return null;
  1484. }
  1485. }
  1486. /// <summary>
  1487. /// 软件更新
  1488. /// </summary>
  1489. /// <param name="accountCode">帐套code</param>
  1490. /// <param name="userCode">用户code</param>
  1491. /// <param name="userPassword">用户密码</param>
  1492. /// <param name="sessionKey">本次登陆密钥</param>
  1493. /// <returns></returns>
  1494. public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey)
  1495. {
  1496. try
  1497. {
  1498. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1499. }
  1500. catch (Exception ex)
  1501. {
  1502. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1503. OutputLog.TraceLog(LogPriority.Error,
  1504. this.ToString(),
  1505. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1506. ex.ToString(),
  1507. LocalPath.LogExePath);
  1508. return null;
  1509. }
  1510. }
  1511. /// <summary>
  1512. /// 上传临时文件
  1513. /// </summary>
  1514. /// <param name="imgStream"></param>
  1515. /// <returns></returns>
  1516. public ActionResult SaveImg(Stream mageStream)
  1517. {
  1518. ActionResult actionResult = new ActionResult();
  1519. try
  1520. {
  1521. string err = PDAModuleLogic.SaveImg(mageStream);
  1522. if (err == null)
  1523. {
  1524. err = "";
  1525. }
  1526. actionResult.Result = err;
  1527. actionResult.Status = (int)Constant.PDAResult.Success;
  1528. }
  1529. catch (Exception ex)
  1530. {
  1531. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1532. OutputLog.TraceLog(LogPriority.Error,
  1533. this.ToString(),
  1534. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1535. ex.ToString(),
  1536. LocalPath.LogExePath);
  1537. actionResult.Status = (int)Constant.PDAResult.Exception;
  1538. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1539. }
  1540. return actionResult;
  1541. }
  1542. public Stream GetFileTest(string path)
  1543. {
  1544. return PDAModuleLogic.GetImg(path);
  1545. }
  1546. public Stream GetFileStream()
  1547. {
  1548. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1549. long l = fs.Length;
  1550. return fs;
  1551. }
  1552. public byte[] GetFileTestByte(string path)
  1553. {
  1554. FileStream stream = new FileInfo(path).OpenRead();
  1555. Byte[] buffer = new Byte[stream.Length];
  1556. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1557. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1558. return buffer;
  1559. }
  1560. public string GetFile(string path)
  1561. {
  1562. string imgFilePath = path;
  1563. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1564. int i = (int)fs.Length;
  1565. byte[] content = new byte[i];
  1566. fs.Read(content, 0, i);
  1567. string result = Convert.ToBase64String(content);
  1568. fs.Close();
  1569. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1570. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1571. sw.Write(result);
  1572. sw.Close();
  1573. fsTxt.Close();
  1574. return result;
  1575. }
  1576. #endregion
  1577. /// <summary>
  1578. /// 获得产品分级
  1579. /// </summary>
  1580. /// <param name="accountCode">帐套code</param>
  1581. /// <param name="userCode">用户code</param>
  1582. /// <param name="userPassword">用户密码</param>
  1583. /// <param name="sessionKey">本次登陆密钥</param>
  1584. /// <param name="procedureID">当前工序ID</param>
  1585. /// <returns></returns>
  1586. /// <remarks>
  1587. /// 陈冰 2014.10.22 新建
  1588. /// </remarks>
  1589. public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1590. {
  1591. ActionResult actionResult = new ActionResult();
  1592. try
  1593. {
  1594. // 验证请求头信息
  1595. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1596. // 验证失败
  1597. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1598. {
  1599. return actionResult;
  1600. }
  1601. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1602. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1603. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1604. {
  1605. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1606. actionResult.Status = (int)Constant.PDAResult.Success;
  1607. }
  1608. else
  1609. {
  1610. actionResult.Status = (int)Constant.PDAResult.Fail;
  1611. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1612. }
  1613. }
  1614. catch (Exception ex)
  1615. {
  1616. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1617. OutputLog.TraceLog(LogPriority.Error,
  1618. this.ToString(),
  1619. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1620. ex.ToString(),
  1621. LocalPath.LogExePath);
  1622. actionResult.Status = (int)Constant.PDAResult.Exception;
  1623. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1624. }
  1625. return actionResult;
  1626. }
  1627. /// <summary>
  1628. /// 获得产品分级
  1629. /// </summary>
  1630. /// <param name="accountCode">帐套code</param>
  1631. /// <param name="userCode">用户code</param>
  1632. /// <param name="userPassword">用户密码</param>
  1633. /// <param name="sessionKey">本次登陆密钥</param>
  1634. /// <param name="barcode">条码</param>
  1635. /// <returns></returns>
  1636. public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1637. {
  1638. ActionResult actionResult = new ActionResult();
  1639. try
  1640. {
  1641. // 验证请求头信息
  1642. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1643. // 验证失败
  1644. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1645. {
  1646. return actionResult;
  1647. }
  1648. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1649. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1650. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1651. {
  1652. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1653. actionResult.Status = (int)Constant.PDAResult.Success;
  1654. }
  1655. else
  1656. {
  1657. actionResult.Status = (int)Constant.PDAResult.Fail;
  1658. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1659. }
  1660. }
  1661. catch (Exception ex)
  1662. {
  1663. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1664. OutputLog.TraceLog(LogPriority.Error,
  1665. this.ToString(),
  1666. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1667. ex.ToString(),
  1668. LocalPath.LogExePath);
  1669. actionResult.Status = (int)Constant.PDAResult.Exception;
  1670. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1671. }
  1672. return actionResult;
  1673. }
  1674. #region 统计
  1675. /// <summary>
  1676. /// 统计当日计数数量
  1677. /// </summary>
  1678. /// <param name="accountCode">帐套code</param>
  1679. /// <param name="userCode">用户code</param>
  1680. /// <param name="userPassword">用户密码</param>
  1681. /// <param name="sessionKey">本次登陆密钥</param>
  1682. /// <param name="procedureID">工序ID</param>
  1683. /// <returns></returns>
  1684. public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1685. {
  1686. ActionResult actionResult = new ActionResult();
  1687. try
  1688. {
  1689. // 验证请求头信息
  1690. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1691. // 验证失败
  1692. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1693. {
  1694. return actionResult;
  1695. }
  1696. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1697. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1698. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1699. {
  1700. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1701. actionResult.Status = (int)Constant.PDAResult.Success;
  1702. }
  1703. else
  1704. {
  1705. actionResult.Status = (int)Constant.PDAResult.Fail;
  1706. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1707. }
  1708. }
  1709. catch (Exception ex)
  1710. {
  1711. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1712. OutputLog.TraceLog(LogPriority.Error,
  1713. this.ToString(),
  1714. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1715. ex.ToString(),
  1716. LocalPath.LogExePath);
  1717. actionResult.Status = (int)Constant.PDAResult.Exception;
  1718. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1719. }
  1720. return actionResult;
  1721. }
  1722. /// <summary>
  1723. /// 统计当日计数数量
  1724. /// </summary>
  1725. /// <param name="accountCode">帐套code</param>
  1726. /// <param name="userCode">用户code</param>
  1727. /// <param name="userPassword">用户密码</param>
  1728. /// <param name="sessionKey">本次登陆密钥</param>
  1729. /// <param name="procedureID">工序ID</param>
  1730. /// <returns></returns>
  1731. public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1732. {
  1733. ActionResult actionResult = new ActionResult();
  1734. try
  1735. {
  1736. // 验证请求头信息
  1737. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1738. // 验证失败
  1739. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1740. {
  1741. return actionResult;
  1742. }
  1743. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1744. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1745. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1746. {
  1747. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1748. actionResult.Status = (int)Constant.PDAResult.Success;
  1749. }
  1750. else
  1751. {
  1752. actionResult.Status = (int)Constant.PDAResult.Fail;
  1753. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1754. }
  1755. }
  1756. catch (Exception ex)
  1757. {
  1758. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1759. OutputLog.TraceLog(LogPriority.Error,
  1760. this.ToString(),
  1761. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1762. ex.ToString(),
  1763. LocalPath.LogExePath);
  1764. actionResult.Status = (int)Constant.PDAResult.Exception;
  1765. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1766. }
  1767. return actionResult;
  1768. }
  1769. /// <summary>
  1770. /// 统计产品跟踪
  1771. /// </summary>
  1772. /// <param name="accountCode">帐套code</param>
  1773. /// <param name="userCode">用户code</param>
  1774. /// <param name="userPassword">用户密码</param>
  1775. /// <param name="sessionKey">本次登陆密钥</param>
  1776. /// <param name="procedureID">工序ID</param>
  1777. /// <returns></returns>
  1778. public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1779. {
  1780. ActionResult actionResult = new ActionResult();
  1781. try
  1782. {
  1783. // 验证请求头信息
  1784. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1785. // 验证失败
  1786. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1787. {
  1788. return actionResult;
  1789. }
  1790. RPT020101_SE se = new RPT020101_SE();
  1791. se.Barcode = barcode;
  1792. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1793. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1794. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1795. {
  1796. actionResult.Status = (int)Constant.PDAResult.Fail;
  1797. actionResult.Message = Messages.MSG_CMN_I002;
  1798. }
  1799. else
  1800. {
  1801. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1802. actionResult.Status = (int)Constant.PDAResult.Success;
  1803. }
  1804. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1805. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1806. //if (productionDataEntity != null)
  1807. //{
  1808. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1809. // actionResult.Status = (int)Constant.PDAResult.Success;
  1810. //}
  1811. //else
  1812. //{
  1813. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1814. // actionResult.Message = Messages.MSG_CMN_I002;
  1815. //}
  1816. }
  1817. catch (Exception ex)
  1818. {
  1819. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1820. OutputLog.TraceLog(LogPriority.Error,
  1821. this.ToString(),
  1822. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1823. ex.ToString() + ex.HelpLink,
  1824. LocalPath.LogExePath);
  1825. actionResult.Status = (int)Constant.PDAResult.Exception;
  1826. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1827. }
  1828. return actionResult;
  1829. }
  1830. #endregion
  1831. #region 撤销装车及成检
  1832. /// <summary>
  1833. /// 检验条码是否可以撤销装车
  1834. /// </summary>
  1835. /// <param name="accountCode">帐套code</param>
  1836. /// <param name="userCode">用户code</param>
  1837. /// <param name="userPassword">用户密码</param>
  1838. /// <param name="sessionKey">本次登陆密钥</param>
  1839. /// <param name="procedureID">当前工序ID</param>
  1840. /// <param name="barcode">条码</param>
  1841. /// <returns></returns>
  1842. public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1843. {
  1844. ActionResult actionResult = new ActionResult();
  1845. try
  1846. {
  1847. // 验证请求头信息
  1848. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1849. // 验证失败
  1850. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1851. {
  1852. return actionResult;
  1853. }
  1854. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1855. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1856. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1857. actionResult.Status = (int)Constant.PDAResult.Success;
  1858. }
  1859. catch (Exception ex)
  1860. {
  1861. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1862. OutputLog.TraceLog(LogPriority.Error,
  1863. this.ToString(),
  1864. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1865. ex.ToString(),
  1866. LocalPath.LogExePath);
  1867. actionResult.Status = (int)Constant.PDAResult.Exception;
  1868. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1869. }
  1870. return actionResult;
  1871. }
  1872. /// <summary>
  1873. /// 保存撤销装车的条码
  1874. /// </summary>
  1875. /// <param name="accountCode">帐套code</param>
  1876. /// <param name="userCode">用户code</param>
  1877. /// <param name="userPassword">用户密码</param>
  1878. /// <param name="sessionKey">本次登陆密钥</param>
  1879. /// <param name="procedureID">当前工序ID</param>
  1880. /// <param name="barcode">条码</param>
  1881. /// <returns></returns>
  1882. public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1883. {
  1884. ActionResult actionResult = new ActionResult();
  1885. try
  1886. {
  1887. // 验证请求头信息
  1888. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1889. // 验证失败
  1890. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1891. {
  1892. return actionResult;
  1893. }
  1894. string err = ServiceInvoker.Invoke<string>(this,
  1895. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1896. if (err == null)
  1897. {
  1898. err = "";
  1899. }
  1900. actionResult.Result = JsonHelper.ToJson(err);
  1901. actionResult.Status = (int)Constant.PDAResult.Success;
  1902. }
  1903. catch (Exception ex)
  1904. {
  1905. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1906. OutputLog.TraceLog(LogPriority.Error,
  1907. this.ToString(),
  1908. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1909. ex.ToString(),
  1910. LocalPath.LogExePath);
  1911. actionResult.Status = (int)Constant.PDAResult.Exception;
  1912. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1913. }
  1914. return actionResult;
  1915. }
  1916. /// <summary>
  1917. /// 由产品条码获取注浆信息
  1918. /// </summary>
  1919. /// <param name="barcode"></param>
  1920. /// <returns></returns>
  1921. public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1922. {
  1923. ActionResult actionResult = new ActionResult();
  1924. try
  1925. {
  1926. // 验证请求头信息
  1927. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1928. // 验证失败
  1929. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1930. {
  1931. return actionResult;
  1932. }
  1933. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1934. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1935. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1936. {
  1937. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1938. actionResult.Status = (int)Constant.PDAResult.Success;
  1939. }
  1940. else
  1941. {
  1942. actionResult.Status = (int)Constant.PDAResult.Fail;
  1943. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1944. }
  1945. }
  1946. catch (Exception ex)
  1947. {
  1948. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1949. OutputLog.TraceLog(LogPriority.Error,
  1950. this.ToString(),
  1951. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1952. ex.ToString(),
  1953. LocalPath.LogExePath);
  1954. actionResult.Status = (int)Constant.PDAResult.Exception;
  1955. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1956. }
  1957. return actionResult;
  1958. }
  1959. /// <summary>
  1960. /// 获取工号下的所有工种信息
  1961. /// </summary>
  1962. /// <param name="UserID">工号ID</param>
  1963. /// <returns></returns>
  1964. public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1965. {
  1966. ActionResult actionResult = new ActionResult();
  1967. try
  1968. {
  1969. // 验证请求头信息
  1970. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1971. // 验证失败
  1972. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1973. {
  1974. return actionResult;
  1975. }
  1976. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1977. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1978. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1979. {
  1980. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1981. actionResult.Status = (int)Constant.PDAResult.Success;
  1982. }
  1983. else
  1984. {
  1985. actionResult.Status = (int)Constant.PDAResult.Fail;
  1986. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1987. }
  1988. }
  1989. catch (Exception ex)
  1990. {
  1991. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1992. OutputLog.TraceLog(LogPriority.Error,
  1993. this.ToString(),
  1994. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1995. ex.ToString(),
  1996. LocalPath.LogExePath);
  1997. actionResult.Status = (int)Constant.PDAResult.Exception;
  1998. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1999. }
  2000. return actionResult;
  2001. }
  2002. /// <summary>
  2003. /// 根据所选工号对应的工种,查出缺陷责任员工
  2004. /// </summary>
  2005. /// <param name="jobs">工种ID</param>
  2006. /// <returns></returns>
  2007. public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  2008. {
  2009. ActionResult actionResult = new ActionResult();
  2010. try
  2011. {
  2012. // 验证请求头信息
  2013. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2014. // 验证失败
  2015. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2016. {
  2017. return actionResult;
  2018. }
  2019. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2020. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  2021. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2022. {
  2023. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2024. actionResult.Status = (int)Constant.PDAResult.Success;
  2025. }
  2026. else
  2027. {
  2028. actionResult.Status = (int)Constant.PDAResult.Fail;
  2029. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2030. }
  2031. }
  2032. catch (Exception ex)
  2033. {
  2034. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2035. OutputLog.TraceLog(LogPriority.Error,
  2036. this.ToString(),
  2037. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2038. ex.ToString(),
  2039. LocalPath.LogExePath);
  2040. actionResult.Status = (int)Constant.PDAResult.Exception;
  2041. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2042. }
  2043. return actionResult;
  2044. }
  2045. /// <summary>
  2046. /// 根据所选工号,查出漏检责任员工
  2047. /// </summary>
  2048. /// <param name="userid">工号</param>
  2049. /// <returns></returns>
  2050. public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  2051. {
  2052. ActionResult actionResult = new ActionResult();
  2053. try
  2054. {
  2055. // 验证请求头信息
  2056. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2057. // 验证失败
  2058. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2059. {
  2060. return actionResult;
  2061. }
  2062. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2063. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  2064. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2065. {
  2066. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2067. actionResult.Status = (int)Constant.PDAResult.Success;
  2068. }
  2069. else
  2070. {
  2071. actionResult.Status = (int)Constant.PDAResult.Fail;
  2072. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2073. }
  2074. }
  2075. catch (Exception ex)
  2076. {
  2077. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2078. OutputLog.TraceLog(LogPriority.Error,
  2079. this.ToString(),
  2080. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2081. ex.ToString(),
  2082. LocalPath.LogExePath);
  2083. actionResult.Status = (int)Constant.PDAResult.Exception;
  2084. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2085. }
  2086. return actionResult;
  2087. }
  2088. /// <summary>
  2089. /// 获取用户列表
  2090. /// </summary>
  2091. /// <param name="requestEntity">用户实体</param>
  2092. /// <returns></returns>
  2093. public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  2094. {
  2095. ActionResult actionResult = new ActionResult();
  2096. try
  2097. {
  2098. // 验证请求头信息
  2099. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2100. // 验证失败
  2101. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2102. {
  2103. return actionResult;
  2104. }
  2105. SUserEntity requestEntity = new SUserEntity();
  2106. requestEntity.IsWorker = IsWorker;
  2107. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2108. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  2109. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2110. {
  2111. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2112. actionResult.Status = (int)Constant.PDAResult.Success;
  2113. }
  2114. else
  2115. {
  2116. actionResult.Status = (int)Constant.PDAResult.Fail;
  2117. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2118. }
  2119. }
  2120. catch (Exception ex)
  2121. {
  2122. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2123. OutputLog.TraceLog(LogPriority.Error,
  2124. this.ToString(),
  2125. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2126. ex.ToString(),
  2127. LocalPath.LogExePath);
  2128. actionResult.Status = (int)Constant.PDAResult.Exception;
  2129. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2130. }
  2131. return actionResult;
  2132. }
  2133. /// <summary>
  2134. /// 获取数据字典管理的数据
  2135. /// </summary>
  2136. /// <param name="Pvalue">显示停用标识</param>
  2137. /// <param name="dictionaryType">字典类别</param>
  2138. /// <returns></returns>
  2139. /// <remarks>
  2140. /// 2014.12.03 新建
  2141. /// </remarks>
  2142. public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  2143. {
  2144. ActionResult actionResult = new ActionResult();
  2145. try
  2146. {
  2147. // 验证请求头信息
  2148. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2149. // 验证失败
  2150. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2151. {
  2152. return actionResult;
  2153. }
  2154. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2155. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  2156. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2157. {
  2158. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2159. actionResult.Status = (int)Constant.PDAResult.Success;
  2160. }
  2161. else
  2162. {
  2163. actionResult.Status = (int)Constant.PDAResult.Fail;
  2164. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2165. }
  2166. }
  2167. catch (Exception ex)
  2168. {
  2169. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2170. OutputLog.TraceLog(LogPriority.Error,
  2171. this.ToString(),
  2172. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2173. ex.ToString(),
  2174. LocalPath.LogExePath);
  2175. actionResult.Status = (int)Constant.PDAResult.Exception;
  2176. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2177. }
  2178. return actionResult;
  2179. }
  2180. #endregion
  2181. #region 保存半检数据
  2182. /// <summary>
  2183. /// 保存半检数据
  2184. /// </summary>
  2185. /// <param name="accountCode">帐套code</param>
  2186. /// <param name="userCode">用户code</param>
  2187. /// <param name="userPassword">用户密码</param>
  2188. /// <param name="sessionKey">本次登陆密钥</param>
  2189. /// <param name="productionDataEntitys">半检信息</param>
  2190. /// <returns></returns>
  2191. public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  2192. {
  2193. ActionResult actionResult = new ActionResult();
  2194. try
  2195. {
  2196. // 验证请求头信息
  2197. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2198. // 验证失败
  2199. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2200. {
  2201. return actionResult;
  2202. }
  2203. string err = ServiceInvoker.Invoke<string>(this,
  2204. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2205. if (err == null)
  2206. {
  2207. err = "";
  2208. }
  2209. actionResult.Result = JsonHelper.ToJson(err);
  2210. actionResult.Status = (int)Constant.PDAResult.Success;
  2211. }
  2212. catch (Exception ex)
  2213. {
  2214. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2215. OutputLog.TraceLog(LogPriority.Error,
  2216. this.ToString(),
  2217. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2218. ex.ToString(),
  2219. LocalPath.LogExePath);
  2220. actionResult.Status = (int)Constant.PDAResult.Exception;
  2221. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2222. }
  2223. return actionResult;
  2224. }
  2225. #endregion
  2226. /// <summary>
  2227. /// 获取产品列表
  2228. /// </summary>
  2229. /// <returns></returns>
  2230. public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  2231. {
  2232. ActionResult actionResult = new ActionResult();
  2233. try
  2234. {
  2235. // 验证请求头信息
  2236. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2237. // 验证失败
  2238. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2239. {
  2240. return actionResult;
  2241. }
  2242. GoodsEntity goodsEntity = new GoodsEntity();
  2243. goodsEntity.ValueFlag = 1;//有效标记
  2244. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2245. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2246. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2247. {
  2248. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2249. actionResult.Status = (int)Constant.PDAResult.Success;
  2250. }
  2251. else
  2252. {
  2253. actionResult.Status = (int)Constant.PDAResult.Fail;
  2254. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2255. }
  2256. }
  2257. catch (Exception ex)
  2258. {
  2259. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2260. OutputLog.TraceLog(LogPriority.Error,
  2261. this.ToString(),
  2262. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2263. ex.ToString(),
  2264. LocalPath.LogExePath);
  2265. actionResult.Status = (int)Constant.PDAResult.Exception;
  2266. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2267. }
  2268. return actionResult;
  2269. }
  2270. /// <summary>
  2271. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2272. /// </summary>
  2273. /// <param name="searchEntity">生产数据实体类</param>
  2274. /// <returns>DataTable</returns>
  2275. public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2276. {
  2277. ActionResult actionResult = new ActionResult();
  2278. try
  2279. {
  2280. // 验证请求头信息
  2281. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2282. // 验证失败
  2283. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2284. {
  2285. return actionResult;
  2286. }
  2287. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2288. searchEntity.ProcedureID = ProcedureID;
  2289. searchEntity.BarCode = BarCode;
  2290. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2291. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2292. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2293. {
  2294. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2295. actionResult.Status = (int)Constant.PDAResult.Success;
  2296. }
  2297. else
  2298. {
  2299. actionResult.Status = (int)Constant.PDAResult.Fail;
  2300. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2301. }
  2302. }
  2303. catch (Exception ex)
  2304. {
  2305. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2306. OutputLog.TraceLog(LogPriority.Error,
  2307. this.ToString(),
  2308. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2309. ex.ToString(),
  2310. LocalPath.LogExePath);
  2311. actionResult.Status = (int)Constant.PDAResult.Exception;
  2312. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2313. }
  2314. return actionResult;
  2315. }
  2316. /// <summary>
  2317. /// xuwei add 2020-03-23 此方法用于成检后 回收 再次成检 获取正确ID
  2318. /// </summary>
  2319. /// <param name="searchEntity">生产数据实体类</param>
  2320. /// <returns>DataTable</returns>
  2321. public ActionResult GetProductionDataCheckID(string accountCode, string userCode, string userPassword, string sessionKey, string BarCode)
  2322. {
  2323. ActionResult actionResult = new ActionResult();
  2324. try
  2325. {
  2326. // 验证请求头信息
  2327. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2328. // 验证失败
  2329. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2330. {
  2331. return actionResult;
  2332. }
  2333. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2334. searchEntity.BarCode = BarCode;
  2335. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2336. () => PDAModuleLogic.GetProductionDataCheckID(searchEntity, sUserInfo));
  2337. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2338. {
  2339. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2340. actionResult.Status = (int)Constant.PDAResult.Success;
  2341. }
  2342. else
  2343. {
  2344. actionResult.Status = (int)Constant.PDAResult.Fail;
  2345. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2346. }
  2347. }
  2348. catch (Exception ex)
  2349. {
  2350. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2351. OutputLog.TraceLog(LogPriority.Error,
  2352. this.ToString(),
  2353. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2354. ex.ToString(),
  2355. LocalPath.LogExePath);
  2356. actionResult.Status = (int)Constant.PDAResult.Exception;
  2357. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2358. }
  2359. return actionResult;
  2360. }
  2361. /// <summary>
  2362. /// 根据所选生产数据ID,显示成检数据信息
  2363. /// </summary>
  2364. /// <param name="productionDataID">生产数据ID</param>
  2365. /// <returns>DataSet</returns>
  2366. public ActionResult GetProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2367. {
  2368. ActionResult actionResult = new ActionResult();
  2369. try
  2370. {
  2371. // 验证请求头信息
  2372. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2373. // 验证失败
  2374. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2375. {
  2376. return actionResult;
  2377. }
  2378. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2379. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2380. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2381. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2382. {
  2383. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2384. {
  2385. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2386. {
  2387. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2388. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2389. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2390. {
  2391. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2392. }
  2393. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2394. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2395. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2396. {
  2397. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2398. }
  2399. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2400. {
  2401. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2402. }
  2403. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2404. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2405. {
  2406. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2407. }
  2408. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2409. {
  2410. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2411. }
  2412. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2413. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2414. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2415. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2416. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2417. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2418. productionData.GlazeName = reworkDs.Tables[0].Rows[i]["GlazeName"].ToString();
  2419. productionData.LeakFlag1 = reworkDs.Tables[0].Rows[i]["LeakFlag1"].ToString();
  2420. productionData.LeakFlag2 = reworkDs.Tables[0].Rows[i]["LeakFlag2"].ToString();
  2421. productionData.LeakFlag3 = reworkDs.Tables[0].Rows[i]["LeakFlag3"].ToString();
  2422. productionData.SpecialRepairFlagName = reworkDs.Tables[0].Rows[i]["specialRepairFlagName"].ToString();
  2423. productionData.IsReFireName = reworkDs.Tables[0].Rows[i]["isReFireName"].ToString();
  2424. productionData.LeakFlag1Name = reworkDs.Tables[0].Rows[i]["LeakFlag1Name"].ToString();
  2425. productionData.LeakFlag2Name = reworkDs.Tables[0].Rows[i]["LeakFlag2Name"].ToString();
  2426. productionData.LeakFlag3Name = reworkDs.Tables[0].Rows[i]["LeakFlag3Name"].ToString();
  2427. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2428. {
  2429. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2430. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2431. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2432. }
  2433. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2434. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2435. {
  2436. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2437. }
  2438. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2439. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2440. DataTable dtDefect = dvDefect.ToTable();
  2441. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2442. {
  2443. // 产品缺陷
  2444. PDADefectResult defect = new PDADefectResult();
  2445. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2446. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2447. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2448. {
  2449. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2450. }
  2451. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2452. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2453. {
  2454. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2455. }
  2456. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2457. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2458. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2459. {
  2460. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2461. }
  2462. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2463. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2464. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2465. {
  2466. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2467. }
  2468. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2469. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2470. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2471. {
  2472. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2473. }
  2474. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2475. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2476. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2477. {
  2478. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2479. }
  2480. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2481. {
  2482. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2483. }
  2484. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2485. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2486. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2487. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2488. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2489. {
  2490. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2491. }
  2492. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2493. {
  2494. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2495. }
  2496. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2497. {
  2498. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2499. }
  2500. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2501. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2502. //--------责任员工-------------------
  2503. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2504. if (drRow.Length > Constant.INT_IS_ZERO)
  2505. {
  2506. foreach (DataRow r in drRow)
  2507. {
  2508. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2509. if (r["ProductionDefectID"].ToString() != "")
  2510. {
  2511. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2512. }
  2513. if (r["StaffID"].ToString() != "")
  2514. {
  2515. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2516. }
  2517. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2518. defectResponsible.StaffName = r["StaffName"].ToString();
  2519. if (r["StaffStatus"].ToString() != "")
  2520. {
  2521. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2522. }
  2523. if (r["UJobsID"].ToString() != "")
  2524. {
  2525. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2526. }
  2527. if (r["SJobsID"].ToString() != "")
  2528. {
  2529. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2530. }
  2531. defect.PDADefectResponsibles.Add(defectResponsible);
  2532. }
  2533. }
  2534. //------------------------------
  2535. //--------漏检员工-------------------
  2536. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2537. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2538. {
  2539. foreach (DataRow r in drMissedRow)
  2540. {
  2541. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2542. if (r["ProductionDefectID"].ToString() != "")
  2543. {
  2544. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2545. }
  2546. if (r["StaffID"].ToString() != "")
  2547. {
  2548. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2549. }
  2550. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2551. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2552. if (r["StaffStatus"].ToString() != "")
  2553. {
  2554. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2555. }
  2556. if (r["UJobsID"].ToString() != "")
  2557. {
  2558. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2559. }
  2560. if (r["SJobsID"].ToString() != "")
  2561. {
  2562. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2563. }
  2564. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2565. }
  2566. }
  2567. //------------------------------
  2568. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2569. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2570. {
  2571. foreach (DataRow r in drImageRow)
  2572. {
  2573. PDADefectImageResult defectImage = new PDADefectImageResult();
  2574. if (r["ProductionDefectID"].ToString() != "")
  2575. {
  2576. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2577. }
  2578. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2579. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2580. //{
  2581. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2582. //}
  2583. defect.PDADefectImageResults.Add(defectImage);
  2584. }
  2585. }
  2586. productionData.PDADefects.Add(defect);
  2587. }
  2588. if (productionDatas.PDAProductionData == null)
  2589. {
  2590. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2591. }
  2592. productionDatas.PDAProductionData.Add(productionData);
  2593. //---------------------------------------------------------------------------------
  2594. }
  2595. }
  2596. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2597. actionResult.Status = (int)Constant.PDAResult.Success;
  2598. }
  2599. else
  2600. {
  2601. actionResult.Status = (int)Constant.PDAResult.Fail;
  2602. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2603. }
  2604. }
  2605. catch (Exception ex)
  2606. {
  2607. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2608. OutputLog.TraceLog(LogPriority.Error,
  2609. this.ToString(),
  2610. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2611. ex.ToString(),
  2612. LocalPath.LogExePath);
  2613. actionResult.Status = (int)Constant.PDAResult.Exception;
  2614. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2615. }
  2616. return actionResult;
  2617. }
  2618. /// <summary>
  2619. /// 编辑后删除生产数据
  2620. /// </summary>
  2621. /// <param name="productionDataID">生产数据ID</param>
  2622. /// <returns>int</returns>
  2623. public ActionResult DeleteProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2624. {
  2625. ActionResult actionResult = new ActionResult();
  2626. try
  2627. {
  2628. // 验证请求头信息
  2629. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2630. // 验证失败
  2631. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2632. {
  2633. return actionResult;
  2634. }
  2635. int row = ServiceInvoker.Invoke<int>(this,
  2636. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2637. actionResult.Result = JsonHelper.ToJson(row);
  2638. actionResult.Status = (int)Constant.PDAResult.Success;
  2639. }
  2640. catch (Exception ex)
  2641. {
  2642. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2643. OutputLog.TraceLog(LogPriority.Error,
  2644. this.ToString(),
  2645. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2646. ex.ToString(),
  2647. LocalPath.LogExePath);
  2648. actionResult.Status = (int)Constant.PDAResult.Exception;
  2649. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2650. }
  2651. return actionResult;
  2652. }
  2653. /// <summary>
  2654. /// 获取产品完成工序的ID
  2655. /// </summary>
  2656. /// <param name="barcode">产品条码</param>
  2657. /// <returns>int</returns>
  2658. public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2659. {
  2660. ActionResult actionResult = new ActionResult();
  2661. try
  2662. {
  2663. // 验证请求头信息
  2664. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2665. // 验证失败
  2666. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2667. {
  2668. return actionResult;
  2669. }
  2670. int row = ServiceInvoker.Invoke<int>(this,
  2671. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2672. actionResult.Result = JsonHelper.ToJson(row);
  2673. actionResult.Status = (int)Constant.PDAResult.Success;
  2674. }
  2675. catch (Exception ex)
  2676. {
  2677. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2678. OutputLog.TraceLog(LogPriority.Error,
  2679. this.ToString(),
  2680. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2681. ex.ToString(),
  2682. LocalPath.LogExePath);
  2683. actionResult.Status = (int)Constant.PDAResult.Exception;
  2684. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2685. }
  2686. return actionResult;
  2687. }
  2688. /// <summary>
  2689. /// 绑定图片
  2690. /// </summary>
  2691. /// <param name="accountCode">帐套code</param>
  2692. /// <param name="userCode">用户code</param>
  2693. /// <param name="userPassword">用户密码</param>
  2694. /// <param name="sessionKey">本次登陆密钥</param>
  2695. /// <param name="imagePath">图片路径</param>
  2696. /// <returns></returns>
  2697. public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2698. {
  2699. try
  2700. {
  2701. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2702. }
  2703. catch (Exception ex)
  2704. {
  2705. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2706. OutputLog.TraceLog(LogPriority.Error,
  2707. this.ToString(),
  2708. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2709. ex.ToString(),
  2710. LocalPath.LogExePath);
  2711. return null;
  2712. }
  2713. }
  2714. /// <summary>
  2715. /// 根据所选工号对应的工种,查出缺陷责任员工
  2716. /// </summary>
  2717. /// <param name="jobs">工种ID</param>
  2718. /// <returns></returns>
  2719. public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2720. {
  2721. ActionResult actionResult = new ActionResult();
  2722. try
  2723. {
  2724. // 验证请求头信息
  2725. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2726. // 验证失败
  2727. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2728. {
  2729. return actionResult;
  2730. }
  2731. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2732. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2733. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2734. {
  2735. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2736. actionResult.Status = (int)Constant.PDAResult.Success;
  2737. }
  2738. else
  2739. {
  2740. actionResult.Status = (int)Constant.PDAResult.Fail;
  2741. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2742. }
  2743. }
  2744. catch (Exception ex)
  2745. {
  2746. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2747. OutputLog.TraceLog(LogPriority.Error,
  2748. this.ToString(),
  2749. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2750. ex.ToString(),
  2751. LocalPath.LogExePath);
  2752. actionResult.Status = (int)Constant.PDAResult.Exception;
  2753. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2754. }
  2755. return actionResult;
  2756. }
  2757. #region 产品报废
  2758. /// <summary>
  2759. /// 验证废弃产品唯一性
  2760. /// </summary>
  2761. /// <param name="barcode">产品条码</param>
  2762. /// <returns>int</returns>
  2763. public ActionResult ScrapProductChack(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2764. {
  2765. ActionResult actionResult = new ActionResult();
  2766. try
  2767. {
  2768. // 验证请求头信息
  2769. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2770. // 验证失败
  2771. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2772. {
  2773. return actionResult;
  2774. }
  2775. string row = ServiceInvoker.Invoke<string>(this,
  2776. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2777. string[] rm = row.Split(':');
  2778. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2779. if (rm.Length > 1)
  2780. {
  2781. actionResult.Message = rm[1];
  2782. }
  2783. actionResult.Status = (int)Constant.PDAResult.Success;
  2784. }
  2785. catch (Exception ex)
  2786. {
  2787. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2788. OutputLog.TraceLog(LogPriority.Error,
  2789. this.ToString(),
  2790. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2791. ex.ToString(),
  2792. LocalPath.LogExePath);
  2793. actionResult.Status = (int)Constant.PDAResult.Exception;
  2794. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2795. }
  2796. return actionResult;
  2797. }
  2798. /// <summary>
  2799. /// 根据条码获取该产品的在产信息以及生产数据
  2800. /// </summary>
  2801. /// <param name="Barcode">产品条码</param>
  2802. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2803. public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2804. {
  2805. ActionResult actionResult = new ActionResult();
  2806. try
  2807. {
  2808. // 验证请求头信息
  2809. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2810. // 验证失败
  2811. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2812. {
  2813. return actionResult;
  2814. }
  2815. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2816. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2817. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2818. {
  2819. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2820. actionResult.Status = (int)Constant.PDAResult.Success;
  2821. }
  2822. else
  2823. {
  2824. actionResult.Status = (int)Constant.PDAResult.Fail;
  2825. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2826. }
  2827. }
  2828. catch (Exception ex)
  2829. {
  2830. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2831. OutputLog.TraceLog(LogPriority.Error,
  2832. this.ToString(),
  2833. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2834. ex.ToString(),
  2835. LocalPath.LogExePath);
  2836. actionResult.Status = (int)Constant.PDAResult.Exception;
  2837. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2838. }
  2839. return actionResult;
  2840. }
  2841. /// <summary>
  2842. /// 根据工号查询员工档案信息
  2843. /// </summary>
  2844. /// <param name="accountCode"></param>
  2845. /// <param name="userCode"></param>
  2846. /// <param name="userPassword"></param>
  2847. /// <param name="sessionKey"></param>
  2848. /// <param name="userId"></param>
  2849. /// <returns></returns>
  2850. public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2851. {
  2852. ActionResult actionResult = new ActionResult();
  2853. try
  2854. {
  2855. // 验证请求头信息
  2856. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2857. // 验证失败
  2858. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2859. {
  2860. return actionResult;
  2861. }
  2862. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2863. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2864. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2865. {
  2866. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2867. actionResult.Status = (int)Constant.PDAResult.Success;
  2868. }
  2869. else
  2870. {
  2871. actionResult.Status = (int)Constant.PDAResult.Fail;
  2872. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2873. }
  2874. }
  2875. catch (Exception ex)
  2876. {
  2877. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2878. OutputLog.TraceLog(LogPriority.Error,
  2879. this.ToString(),
  2880. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2881. ex.ToString(),
  2882. LocalPath.LogExePath);
  2883. actionResult.Status = (int)Constant.PDAResult.Exception;
  2884. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2885. }
  2886. return actionResult;
  2887. }
  2888. /// <summary>
  2889. /// 添加废弃产品记录
  2890. /// </summary>
  2891. /// <param name="SProductEntity">废弃产品实体</param>
  2892. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2893. /// <param name="SResponsibleList">责任者集合</param>
  2894. /// <param name="userInfo">用户基本信息</param>
  2895. /// <returns>int结果返回值</returns>
  2896. /// <remarks>
  2897. /// 庄天威 2014.09.24 新建
  2898. /// </remarks>
  2899. public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey,
  2900. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2901. ScrapResponsibleEntity[] SResponsibleList)
  2902. {
  2903. ActionResult actionResult = new ActionResult();
  2904. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2905. {
  2906. actionResult.Status = (int)Constant.PDAResult.Fail;
  2907. actionResult.Message = "没有选择责任人";
  2908. }
  2909. try
  2910. {
  2911. // 验证请求头信息
  2912. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2913. // 验证失败
  2914. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2915. {
  2916. return actionResult;
  2917. }
  2918. int addRow = ServiceInvoker.Invoke<int>(this,
  2919. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  2920. actionResult.Result = JsonHelper.ToJson(addRow);
  2921. actionResult.Status = (int)Constant.PDAResult.Success;
  2922. }
  2923. catch (Exception ex)
  2924. {
  2925. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2926. OutputLog.TraceLog(LogPriority.Error,
  2927. this.ToString(),
  2928. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2929. ex.ToString(),
  2930. LocalPath.LogExePath);
  2931. actionResult.Status = (int)Constant.PDAResult.Exception;
  2932. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2933. // TODO 空指针异常问题检测
  2934. try
  2935. {
  2936. OutputLog.TraceLog(LogPriority.Error,
  2937. this.ToString(),
  2938. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2939. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  2940. LocalPath.LogExePath);
  2941. string json1 = JsonHelper.ToJson(SProductEntity);
  2942. OutputLog.TraceLog(LogPriority.Error,
  2943. this.ToString(),
  2944. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2945. "SProductEntity:" + json1,
  2946. LocalPath.LogExePath);
  2947. string json2 = JsonHelper.ToJson(RProcedureEntity);
  2948. OutputLog.TraceLog(LogPriority.Error,
  2949. this.ToString(),
  2950. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2951. "RProcedureEntity:" + json2,
  2952. LocalPath.LogExePath);
  2953. string json3 = JsonHelper.ToJson(SResponsibleList);
  2954. OutputLog.TraceLog(LogPriority.Error,
  2955. this.ToString(),
  2956. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2957. "SResponsibleList:" + json3,
  2958. LocalPath.LogExePath);
  2959. }
  2960. catch (Exception exc)
  2961. {
  2962. OutputLog.TraceLog(LogPriority.Error,
  2963. this.ToString(),
  2964. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2965. "参数输入异常:" + exc.Message,
  2966. LocalPath.LogExePath);
  2967. }
  2968. }
  2969. return actionResult;
  2970. }
  2971. /// <summary>
  2972. /// 获取产品分级的数据(根据ID)
  2973. /// </summary>
  2974. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  2975. /// <param name="GoodsLevelID">分类ID</param>
  2976. /// <param name="sUserInfo">用户基本信息</param>
  2977. /// <returns>DataSet</returns>
  2978. /// <remarks>
  2979. /// 2014.10.22 庄天威 新建
  2980. public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  2981. {
  2982. ActionResult actionResult = new ActionResult();
  2983. try
  2984. {
  2985. // 验证请求头信息
  2986. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2987. // 验证失败
  2988. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2989. {
  2990. return actionResult;
  2991. }
  2992. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2993. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  2994. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2995. {
  2996. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2997. actionResult.Status = (int)Constant.PDAResult.Success;
  2998. }
  2999. else
  3000. {
  3001. actionResult.Status = (int)Constant.PDAResult.Fail;
  3002. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3003. }
  3004. }
  3005. catch (Exception ex)
  3006. {
  3007. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3008. OutputLog.TraceLog(LogPriority.Error,
  3009. this.ToString(),
  3010. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3011. ex.ToString(),
  3012. LocalPath.LogExePath);
  3013. actionResult.Status = (int)Constant.PDAResult.Exception;
  3014. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3015. }
  3016. return actionResult;
  3017. }
  3018. /// <summary>
  3019. /// 获取账务日期
  3020. /// </summary>
  3021. /// <param name="accountCode"></param>
  3022. /// <param name="userCode"></param>
  3023. /// <param name="userPassword"></param>
  3024. /// <param name="sessionKey"></param>
  3025. /// <returns></returns>
  3026. public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey)
  3027. {
  3028. ActionResult actionResult = new ActionResult();
  3029. try
  3030. {
  3031. // 验证请求头信息
  3032. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3033. // 验证失败
  3034. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3035. {
  3036. return actionResult;
  3037. }
  3038. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  3039. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  3040. actionResult.Result = JsonHelper.ToJson(reworkDs);
  3041. actionResult.Status = (int)Constant.PDAResult.Success;
  3042. }
  3043. catch (Exception ex)
  3044. {
  3045. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3046. OutputLog.TraceLog(LogPriority.Error,
  3047. this.ToString(),
  3048. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3049. ex.ToString(),
  3050. LocalPath.LogExePath);
  3051. actionResult.Status = (int)Constant.PDAResult.Exception;
  3052. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3053. }
  3054. return actionResult;
  3055. }
  3056. /// <summary>
  3057. /// 获取登陆帐户有无报损权限
  3058. /// </summary>
  3059. /// <param name="accountCode"></param>
  3060. /// <param name="userCode"></param>
  3061. /// <param name="userPassword"></param>
  3062. /// <param name="sessionKey"></param>
  3063. /// <param name="usercode">工号编码</param>
  3064. /// <returns></returns>
  3065. public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3066. {
  3067. ActionResult actionResult = new ActionResult();
  3068. try
  3069. {
  3070. // 验证请求头信息
  3071. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3072. // 验证失败
  3073. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3074. {
  3075. return actionResult;
  3076. }
  3077. int returnValue = ServiceInvoker.Invoke<int>(this,
  3078. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  3079. actionResult.Result = JsonHelper.ToJson(returnValue);
  3080. actionResult.Status = (int)Constant.PDAResult.Success;
  3081. }
  3082. catch (Exception ex)
  3083. {
  3084. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3085. OutputLog.TraceLog(LogPriority.Error,
  3086. this.ToString(),
  3087. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3088. ex.ToString(),
  3089. LocalPath.LogExePath);
  3090. actionResult.Status = (int)Constant.PDAResult.Exception;
  3091. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3092. }
  3093. return actionResult;
  3094. }
  3095. #endregion
  3096. /// <summary>
  3097. /// 获取是否存在报损未审核产品
  3098. /// </summary>
  3099. /// <param name="barcode">产品条码</param>
  3100. /// <returns>int</returns>
  3101. public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  3102. {
  3103. ActionResult actionResult = new ActionResult();
  3104. try
  3105. {
  3106. // 验证请求头信息
  3107. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3108. // 验证失败
  3109. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3110. {
  3111. return actionResult;
  3112. }
  3113. int row = ServiceInvoker.Invoke<int>(this,
  3114. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  3115. actionResult.Result = JsonHelper.ToJson(row);
  3116. actionResult.Status = (int)Constant.PDAResult.Success;
  3117. }
  3118. catch (Exception ex)
  3119. {
  3120. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3121. OutputLog.TraceLog(LogPriority.Error,
  3122. this.ToString(),
  3123. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3124. ex.ToString(),
  3125. LocalPath.LogExePath);
  3126. actionResult.Status = (int)Constant.PDAResult.Exception;
  3127. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3128. }
  3129. return actionResult;
  3130. }
  3131. /// <summary>
  3132. /// 查询报废产品信息
  3133. /// </summary>
  3134. /// <param name="accountCode"></param>
  3135. /// <param name="userCode"></param>
  3136. /// <param name="userPassword"></param>
  3137. /// <param name="sessionKey"></param>
  3138. /// <param name="barCode">产品条码</param>
  3139. /// <param name="scrapProductID">报废产品ID</param>
  3140. /// <returns></returns>
  3141. public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  3142. {
  3143. ActionResult actionResult = new ActionResult();
  3144. try
  3145. {
  3146. // 验证请求头信息
  3147. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3148. // 验证失败
  3149. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3150. {
  3151. return actionResult;
  3152. }
  3153. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  3154. selectProEntity.BarCode = barCode;
  3155. selectProEntity.ScrapProductID = scrapProductID;
  3156. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3157. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  3158. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3159. {
  3160. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3161. actionResult.Status = (int)Constant.PDAResult.Success;
  3162. }
  3163. else
  3164. {
  3165. actionResult.Status = (int)Constant.PDAResult.Fail;
  3166. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3167. }
  3168. }
  3169. catch (Exception ex)
  3170. {
  3171. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3172. OutputLog.TraceLog(LogPriority.Error,
  3173. this.ToString(),
  3174. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3175. ex.ToString(),
  3176. LocalPath.LogExePath);
  3177. actionResult.Status = (int)Constant.PDAResult.Exception;
  3178. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3179. }
  3180. return actionResult;
  3181. }
  3182. /// <summary>
  3183. /// 根据废弃产品ID获取责任工序
  3184. /// </summary>
  3185. /// <param name="accountCode"></param>
  3186. /// <param name="userCode"></param>
  3187. /// <param name="userPassword"></param>
  3188. /// <param name="sessionKey"></param>
  3189. /// <param name="scrapProductID">报废产品ID</param>
  3190. /// <returns></returns>
  3191. public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3192. {
  3193. ActionResult actionResult = new ActionResult();
  3194. try
  3195. {
  3196. // 验证请求头信息
  3197. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3198. // 验证失败
  3199. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3200. {
  3201. return actionResult;
  3202. }
  3203. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3204. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  3205. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3206. {
  3207. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3208. actionResult.Status = (int)Constant.PDAResult.Success;
  3209. }
  3210. else
  3211. {
  3212. actionResult.Status = (int)Constant.PDAResult.Fail;
  3213. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3214. }
  3215. }
  3216. catch (Exception ex)
  3217. {
  3218. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3219. OutputLog.TraceLog(LogPriority.Error,
  3220. this.ToString(),
  3221. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3222. ex.ToString(),
  3223. LocalPath.LogExePath);
  3224. actionResult.Status = (int)Constant.PDAResult.Exception;
  3225. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3226. }
  3227. return actionResult;
  3228. }
  3229. /// <summary>
  3230. /// 根据废弃产品ID获取责任人列表
  3231. /// </summary>
  3232. /// <param name="accountCode"></param>
  3233. /// <param name="userCode"></param>
  3234. /// <param name="userPassword"></param>
  3235. /// <param name="sessionKey"></param>
  3236. /// <param name="scrapProductID">报废产品ID</param>
  3237. /// <returns></returns>
  3238. public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3239. {
  3240. ActionResult actionResult = new ActionResult();
  3241. try
  3242. {
  3243. // 验证请求头信息
  3244. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3245. // 验证失败
  3246. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3247. {
  3248. return actionResult;
  3249. }
  3250. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3251. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  3252. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3253. {
  3254. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3255. actionResult.Status = (int)Constant.PDAResult.Success;
  3256. }
  3257. else
  3258. {
  3259. actionResult.Status = (int)Constant.PDAResult.Fail;
  3260. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3261. }
  3262. }
  3263. catch (Exception ex)
  3264. {
  3265. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3266. OutputLog.TraceLog(LogPriority.Error,
  3267. this.ToString(),
  3268. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3269. ex.ToString(),
  3270. LocalPath.LogExePath);
  3271. actionResult.Status = (int)Constant.PDAResult.Exception;
  3272. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3273. }
  3274. return actionResult;
  3275. }
  3276. /// <summary>
  3277. /// 添加废弃产品记录
  3278. /// </summary>
  3279. /// <param name="SProductEntity">废弃产品实体</param>
  3280. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3281. /// <param name="SResponsibleList">责任者集合</param>
  3282. /// <param name="userInfo">用户基本信息</param>
  3283. /// <returns>int结果返回值</returns>
  3284. /// <remarks>
  3285. /// 庄天威 2014.09.24 新建
  3286. /// </remarks>
  3287. public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3288. ResponProcedureEntity UpdateRProcedureEntity,
  3289. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3290. {
  3291. ActionResult actionResult = new ActionResult();
  3292. try
  3293. {
  3294. // 验证请求头信息
  3295. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3296. // 验证失败
  3297. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3298. {
  3299. return actionResult;
  3300. }
  3301. int addRow = ServiceInvoker.Invoke<int>(this,
  3302. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3303. actionResult.Result = JsonHelper.ToJson(addRow);
  3304. actionResult.Status = (int)Constant.PDAResult.Success;
  3305. }
  3306. catch (Exception ex)
  3307. {
  3308. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3309. OutputLog.TraceLog(LogPriority.Error,
  3310. this.ToString(),
  3311. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3312. ex.ToString(),
  3313. LocalPath.LogExePath);
  3314. actionResult.Status = (int)Constant.PDAResult.Exception;
  3315. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3316. }
  3317. return actionResult;
  3318. }
  3319. /// <summary>
  3320. /// 获取产品窑炉
  3321. /// </summary>
  3322. /// <param name="accountCode"></param>
  3323. /// <param name="userCode"></param>
  3324. /// <param name="userPassword"></param>
  3325. /// <param name="sessionKey"></param>
  3326. /// <returns>Datase</returns>
  3327. public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  3328. {
  3329. ActionResult actionResult = new ActionResult();
  3330. try
  3331. {
  3332. // 验证请求头信息
  3333. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3334. // 验证失败
  3335. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3336. {
  3337. return actionResult;
  3338. }
  3339. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3340. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3341. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3342. {
  3343. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3344. actionResult.Status = (int)Constant.PDAResult.Success;
  3345. }
  3346. else
  3347. {
  3348. actionResult.Status = (int)Constant.PDAResult.Fail;
  3349. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3350. }
  3351. }
  3352. catch (Exception ex)
  3353. {
  3354. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3355. OutputLog.TraceLog(LogPriority.Error,
  3356. this.ToString(),
  3357. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3358. ex.ToString(),
  3359. LocalPath.LogExePath);
  3360. actionResult.Status = (int)Constant.PDAResult.Exception;
  3361. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3362. }
  3363. return actionResult;
  3364. }
  3365. /// <summary>
  3366. /// 获取次品产品条码允许编辑
  3367. /// </summary>
  3368. /// <param name="accountCode"></param>
  3369. /// <param name="userCode"></param>
  3370. /// <param name="userPassword"></param>
  3371. /// <param name="sessionKey"></param>
  3372. /// <param name="barcode">产品条码</param>
  3373. /// <returns>Datase</returns>
  3374. public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3375. {
  3376. ActionResult actionResult = new ActionResult();
  3377. try
  3378. {
  3379. // 验证请求头信息
  3380. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3381. // 验证失败
  3382. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3383. {
  3384. return actionResult;
  3385. }
  3386. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3387. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3388. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3389. {
  3390. actionResult.Result = JsonHelper.ToJson(1);
  3391. actionResult.Status = (int)Constant.PDAResult.Success;
  3392. }
  3393. else
  3394. {
  3395. actionResult.Result = JsonHelper.ToJson(0);
  3396. actionResult.Status = (int)Constant.PDAResult.Fail;
  3397. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3398. }
  3399. }
  3400. catch (Exception ex)
  3401. {
  3402. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3403. OutputLog.TraceLog(LogPriority.Error,
  3404. this.ToString(),
  3405. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3406. ex.ToString(),
  3407. LocalPath.LogExePath);
  3408. actionResult.Status = (int)Constant.PDAResult.Exception;
  3409. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3410. }
  3411. return actionResult;
  3412. }
  3413. /// <summary>
  3414. /// 获取产品条码是否重烧
  3415. /// </summary>
  3416. /// <param name="accountCode"></param>
  3417. /// <param name="userCode"></param>
  3418. /// <param name="userPassword"></param>
  3419. /// <param name="sessionKey"></param>
  3420. /// <param name="barcode">产品条码</param>
  3421. /// <returns>Datase</returns>
  3422. public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3423. {
  3424. ActionResult actionResult = new ActionResult();
  3425. try
  3426. {
  3427. // 验证请求头信息
  3428. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3429. // 验证失败
  3430. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3431. {
  3432. return actionResult;
  3433. }
  3434. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3435. () => PDAModuleLogic.GetReFine(barcode));
  3436. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3437. {
  3438. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3439. }
  3440. else
  3441. {
  3442. actionResult.Result = JsonHelper.ToJson(0);
  3443. }
  3444. actionResult.Status = (int)Constant.PDAResult.Success;
  3445. }
  3446. catch (Exception ex)
  3447. {
  3448. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3449. OutputLog.TraceLog(LogPriority.Error,
  3450. this.ToString(),
  3451. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3452. ex.ToString(),
  3453. LocalPath.LogExePath);
  3454. actionResult.Status = (int)Constant.PDAResult.Exception;
  3455. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3456. }
  3457. return actionResult;
  3458. }
  3459. /// <summary>
  3460. /// 获取登陆帐户有无成检编辑权限
  3461. /// </summary>
  3462. /// <param name="accountCode"></param>
  3463. /// <param name="userCode"></param>
  3464. /// <param name="userPassword"></param>
  3465. /// <param name="sessionKey"></param>
  3466. /// <param name="usercode">工号编码</param>
  3467. /// <returns></returns>
  3468. public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3469. {
  3470. ActionResult actionResult = new ActionResult();
  3471. try
  3472. {
  3473. // 验证请求头信息
  3474. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3475. // 验证失败
  3476. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3477. {
  3478. return actionResult;
  3479. }
  3480. int returnValue = ServiceInvoker.Invoke<int>(this,
  3481. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3482. actionResult.Result = JsonHelper.ToJson(returnValue);
  3483. actionResult.Status = (int)Constant.PDAResult.Success;
  3484. }
  3485. catch (Exception ex)
  3486. {
  3487. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3488. OutputLog.TraceLog(LogPriority.Error,
  3489. this.ToString(),
  3490. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3491. ex.ToString(),
  3492. LocalPath.LogExePath);
  3493. actionResult.Status = (int)Constant.PDAResult.Exception;
  3494. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3495. }
  3496. return actionResult;
  3497. }
  3498. /// <summary>
  3499. /// 根据条码及工序判断是否漏扫
  3500. /// </summary>
  3501. /// <param name="accountCode"></param>
  3502. /// <param name="userCode"></param>
  3503. /// <param name="userPassword"></param>
  3504. /// <param name="sessionKey"></param>
  3505. /// <param name="usercode">工号编码</param>
  3506. /// <param name="barcode">产品条码</param>
  3507. /// <param name="produceid">工序ID</param>
  3508. /// <returns></returns>
  3509. public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3510. {
  3511. ActionResult actionResult = new ActionResult();
  3512. try
  3513. {
  3514. // 验证请求头信息
  3515. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3516. // 验证失败
  3517. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3518. {
  3519. return actionResult;
  3520. }
  3521. int returnValue = 1;
  3522. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3523. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3524. actionResult.Result = JsonHelper.ToJson(returnValue);
  3525. actionResult.Status = (int)Constant.PDAResult.Success;
  3526. }
  3527. catch (Exception ex)
  3528. {
  3529. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3530. OutputLog.TraceLog(LogPriority.Error,
  3531. this.ToString(),
  3532. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3533. ex.ToString(),
  3534. LocalPath.LogExePath);
  3535. actionResult.Status = (int)Constant.PDAResult.Exception;
  3536. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3537. }
  3538. return actionResult;
  3539. }
  3540. /// <summary>
  3541. /// 获取登陆帐户有无报损审批权限
  3542. /// </summary>
  3543. /// <param name="accountCode"></param>
  3544. /// <param name="userCode"></param>
  3545. /// <param name="userPassword"></param>
  3546. /// <param name="sessionKey"></param>
  3547. /// <param name="usercode">工号编码</param>
  3548. /// <returns></returns>
  3549. public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3550. {
  3551. ActionResult actionResult = new ActionResult();
  3552. try
  3553. {
  3554. // 验证请求头信息
  3555. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3556. // 验证失败
  3557. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3558. {
  3559. return actionResult;
  3560. }
  3561. int returnValue = ServiceInvoker.Invoke<int>(this,
  3562. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3563. actionResult.Result = JsonHelper.ToJson(returnValue);
  3564. actionResult.Status = (int)Constant.PDAResult.Success;
  3565. }
  3566. catch (Exception ex)
  3567. {
  3568. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3569. OutputLog.TraceLog(LogPriority.Error,
  3570. this.ToString(),
  3571. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3572. ex.ToString(),
  3573. LocalPath.LogExePath);
  3574. actionResult.Status = (int)Constant.PDAResult.Exception;
  3575. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3576. }
  3577. return actionResult;
  3578. }
  3579. /// <summary>
  3580. /// 获取登陆帐户有无报损审批权限
  3581. /// </summary>
  3582. /// <param name="accountCode"></param>
  3583. /// <param name="userCode"></param>
  3584. /// <param name="userPassword"></param>
  3585. /// <param name="sessionKey"></param>
  3586. /// <param name="usercode">工号编码</param>
  3587. /// <returns></returns>
  3588. public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3589. {
  3590. ActionResult actionResult = new ActionResult();
  3591. try
  3592. {
  3593. // 验证请求头信息
  3594. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3595. // 验证失败
  3596. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3597. {
  3598. return actionResult;
  3599. }
  3600. int returnValue = ServiceInvoker.Invoke<int>(this,
  3601. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3602. actionResult.Result = JsonHelper.ToJson(returnValue);
  3603. actionResult.Status = (int)Constant.PDAResult.Success;
  3604. }
  3605. catch (Exception ex)
  3606. {
  3607. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3608. OutputLog.TraceLog(LogPriority.Error,
  3609. this.ToString(),
  3610. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3611. ex.ToString(),
  3612. LocalPath.LogExePath);
  3613. actionResult.Status = (int)Constant.PDAResult.Exception;
  3614. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3615. }
  3616. return actionResult;
  3617. }
  3618. /// <summary>
  3619. /// 获取窑车对应产品列表
  3620. /// </summary>
  3621. /// <param name="accountCode"></param>
  3622. /// <param name="userCode"></param>
  3623. /// <param name="userPassword"></param>
  3624. /// <param name="sessionKey"></param>
  3625. /// <param name="KilnCarID">窑车ID</param>
  3626. /// <returns>Dataset</returns>
  3627. public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  3628. {
  3629. ActionResult actionResult = new ActionResult();
  3630. try
  3631. {
  3632. // 验证请求头信息
  3633. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3634. // 验证失败
  3635. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3636. {
  3637. return actionResult;
  3638. }
  3639. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3640. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3641. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3642. {
  3643. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3644. actionResult.Status = (int)Constant.PDAResult.Success;
  3645. }
  3646. else
  3647. {
  3648. actionResult.Status = (int)Constant.PDAResult.Fail;
  3649. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3650. }
  3651. }
  3652. catch (Exception ex)
  3653. {
  3654. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3655. OutputLog.TraceLog(LogPriority.Error,
  3656. this.ToString(),
  3657. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3658. ex.ToString(),
  3659. LocalPath.LogExePath);
  3660. actionResult.Status = (int)Constant.PDAResult.Exception;
  3661. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3662. }
  3663. return actionResult;
  3664. }
  3665. /// <summary>
  3666. /// 更换条码
  3667. /// </summary>
  3668. /// <param name="accountCode"></param>
  3669. /// <param name="userCode"></param>
  3670. /// <param name="userPassword"></param>
  3671. /// <param name="sessionKey"></param>
  3672. ///<param name="barcode">原条码</param>
  3673. /// <param name="newBarcode">新条码</param>
  3674. /// <param name="remarks">备注</param>
  3675. /// <returns>操作结果</returns>
  3676. public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  3677. {
  3678. ActionResult actionResult = new ActionResult();
  3679. try
  3680. {
  3681. // 验证请求头信息
  3682. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3683. // 验证失败
  3684. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3685. {
  3686. return actionResult;
  3687. }
  3688. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3689. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3690. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3691. {
  3692. actionResult.Result = 1;
  3693. actionResult.Status = (int)Constant.PDAResult.Success;
  3694. }
  3695. else
  3696. {
  3697. actionResult.Status = (int)Constant.PDAResult.Fail;
  3698. actionResult.Message = serviceResultEntity.Message;
  3699. }
  3700. }
  3701. catch (Exception ex)
  3702. {
  3703. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3704. OutputLog.TraceLog(LogPriority.Error,
  3705. this.ToString(),
  3706. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3707. ex.ToString(),
  3708. LocalPath.LogExePath);
  3709. actionResult.Status = (int)Constant.PDAResult.Exception;
  3710. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3711. }
  3712. return actionResult;
  3713. }
  3714. /// <summary>
  3715. /// 获取(注浆登记)的查询数据
  3716. /// </summary>
  3717. /// <param name="accountCode"></param>
  3718. /// <param name="userCode"></param>
  3719. /// <param name="userPassword"></param>
  3720. /// <param name="sessionKey"></param>
  3721. /// <param name="se">查询条件</param>
  3722. /// <returns>Dataset</returns>
  3723. public ActionResult GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  3724. {
  3725. ActionResult actionResult = new ActionResult();
  3726. try
  3727. {
  3728. // 验证请求头信息
  3729. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3730. // 验证失败
  3731. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3732. {
  3733. return actionResult;
  3734. }
  3735. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3736. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3737. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3738. {
  3739. // PDA不显示的列删除掉
  3740. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3741. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3742. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3743. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3744. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3745. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3746. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3747. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3748. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3749. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3750. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3751. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3752. actionResult.Status = (int)Constant.PDAResult.Success;
  3753. }
  3754. else
  3755. {
  3756. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3757. actionResult.Message = "无查询数据";
  3758. }
  3759. }
  3760. catch (Exception ex)
  3761. {
  3762. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3763. OutputLog.TraceLog(LogPriority.Error,
  3764. this.ToString(),
  3765. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3766. ex.ToString(),
  3767. LocalPath.LogExePath);
  3768. actionResult.Status = (int)Constant.PDAResult.Exception;
  3769. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3770. }
  3771. return actionResult;
  3772. }
  3773. /// <summary>
  3774. /// 获取(注浆登记)的查询数据
  3775. /// </summary>
  3776. /// <param name="accountCode"></param>
  3777. /// <param name="userCode"></param>
  3778. /// <param name="userPassword"></param>
  3779. /// <param name="sessionKey"></param>
  3780. /// <param name="se">查询条件</param>
  3781. /// <returns>Dataset</returns>
  3782. public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3783. {
  3784. ActionResult actionResult = new ActionResult();
  3785. try
  3786. {
  3787. // 验证请求头信息
  3788. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3789. // 验证失败
  3790. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3791. {
  3792. return actionResult;
  3793. }
  3794. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3795. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3796. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3797. {
  3798. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3799. actionResult.Status = (int)Constant.PDAResult.Success;
  3800. }
  3801. else
  3802. {
  3803. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3804. actionResult.Message = "无查询数据";
  3805. }
  3806. }
  3807. catch (Exception ex)
  3808. {
  3809. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3810. OutputLog.TraceLog(LogPriority.Error,
  3811. this.ToString(),
  3812. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3813. ex.ToString(),
  3814. LocalPath.LogExePath);
  3815. actionResult.Status = (int)Constant.PDAResult.Exception;
  3816. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3817. }
  3818. return actionResult;
  3819. }
  3820. /// <summary>
  3821. ///获得成型线信息
  3822. /// </summary>
  3823. /// <param name="accountCode"></param>
  3824. /// <param name="userCode"></param>
  3825. /// <param name="userPassword"></param>
  3826. /// <param name="sessionKey"></param>
  3827. /// <param name="se">查询条件</param>
  3828. /// <returns>Dataset</returns>
  3829. public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3830. {
  3831. ActionResult actionResult = new ActionResult();
  3832. try
  3833. {
  3834. // 验证请求头信息
  3835. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3836. // 验证失败
  3837. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3838. {
  3839. return actionResult;
  3840. }
  3841. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3842. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3843. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3844. {
  3845. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3846. actionResult.Status = (int)Constant.PDAResult.Success;
  3847. }
  3848. else
  3849. {
  3850. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3851. actionResult.Message = "无查询数据";
  3852. }
  3853. }
  3854. catch (Exception ex)
  3855. {
  3856. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3857. OutputLog.TraceLog(LogPriority.Error,
  3858. this.ToString(),
  3859. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3860. ex.ToString(),
  3861. LocalPath.LogExePath);
  3862. actionResult.Status = (int)Constant.PDAResult.Exception;
  3863. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3864. }
  3865. return actionResult;
  3866. }
  3867. /// <summary>
  3868. ///获取在产产品的信息标识列表
  3869. /// </summary>
  3870. /// <param name="accountCode"></param>
  3871. /// <param name="userCode"></param>
  3872. /// <param name="userPassword"></param>
  3873. /// <param name="sessionKey"></param>
  3874. /// <param name="barcode">查询条件</param>
  3875. /// <returns>Dataset</returns>
  3876. public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3877. {
  3878. ActionResult actionResult = new ActionResult();
  3879. try
  3880. {
  3881. // 验证请求头信息
  3882. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3883. // 验证失败
  3884. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3885. {
  3886. return actionResult;
  3887. }
  3888. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3889. () => PMModuleLogic.GetInProductionDataList(barcode));
  3890. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3891. {
  3892. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3893. actionResult.Status = (int)Constant.PDAResult.Success;
  3894. }
  3895. else
  3896. {
  3897. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3898. actionResult.Message = "无查询数据";
  3899. }
  3900. }
  3901. catch (Exception ex)
  3902. {
  3903. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3904. OutputLog.TraceLog(LogPriority.Error,
  3905. this.ToString(),
  3906. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3907. ex.ToString(),
  3908. LocalPath.LogExePath);
  3909. actionResult.Status = (int)Constant.PDAResult.Exception;
  3910. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3911. }
  3912. return actionResult;
  3913. }
  3914. /// <summary>
  3915. ///获取条码是否注浆登记过,0行无效
  3916. /// </summary>
  3917. /// <param name="accountCode"></param>
  3918. /// <param name="userCode"></param>
  3919. /// <param name="userPassword"></param>
  3920. /// <param name="sessionKey"></param>
  3921. /// <param name="barcode">查询条件</param>
  3922. /// <returns>Dataset</returns>
  3923. public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3924. {
  3925. ActionResult actionResult = new ActionResult();
  3926. try
  3927. {
  3928. // 验证请求头信息
  3929. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3930. // 验证失败
  3931. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3932. {
  3933. return actionResult;
  3934. }
  3935. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3936. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  3937. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3938. {
  3939. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3940. actionResult.Status = (int)Constant.PDAResult.Success;
  3941. }
  3942. else
  3943. {
  3944. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3945. actionResult.Message = "该产品条码无效,无法报损!";
  3946. }
  3947. }
  3948. catch (Exception ex)
  3949. {
  3950. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3951. OutputLog.TraceLog(LogPriority.Error,
  3952. this.ToString(),
  3953. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3954. ex.ToString(),
  3955. LocalPath.LogExePath);
  3956. actionResult.Status = (int)Constant.PDAResult.Exception;
  3957. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3958. }
  3959. return actionResult;
  3960. }
  3961. /// <summary>
  3962. /// 获取登陆帐户有变更条码权限
  3963. /// </summary>
  3964. /// <param name="accountCode"></param>
  3965. /// <param name="userCode"></param>
  3966. /// <param name="userPassword"></param>
  3967. /// <param name="sessionKey"></param>
  3968. /// <returns></returns>
  3969. public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3970. {
  3971. ActionResult actionResult = new ActionResult();
  3972. try
  3973. {
  3974. // 验证请求头信息
  3975. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3976. // 验证失败
  3977. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3978. {
  3979. return actionResult;
  3980. }
  3981. int returnValue = ServiceInvoker.Invoke<int>(this,
  3982. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  3983. actionResult.Result = JsonHelper.ToJson(returnValue);
  3984. actionResult.Status = (int)Constant.PDAResult.Success;
  3985. }
  3986. catch (Exception ex)
  3987. {
  3988. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3989. OutputLog.TraceLog(LogPriority.Error,
  3990. this.ToString(),
  3991. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3992. ex.ToString(),
  3993. LocalPath.LogExePath);
  3994. actionResult.Status = (int)Constant.PDAResult.Exception;
  3995. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3996. }
  3997. return actionResult;
  3998. }
  3999. /// <summary>
  4000. /// 成检时获取此条码是否报损
  4001. /// </summary>
  4002. /// <param name="accountCode"></param>
  4003. /// <param name="userCode"></param>
  4004. /// <param name="userPassword"></param>
  4005. /// <param name="sessionKey"></param>
  4006. /// <param name="barcode">产品条码</param>
  4007. /// <returns></returns>
  4008. public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  4009. {
  4010. ActionResult actionResult = new ActionResult();
  4011. try
  4012. {
  4013. // 验证请求头信息
  4014. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4015. // 验证失败
  4016. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4017. {
  4018. return actionResult;
  4019. }
  4020. int returnValue = ServiceInvoker.Invoke<int>(this,
  4021. () => PMModuleLogic.CheckScrapProduct(barcode));
  4022. if (returnValue == -100)
  4023. {
  4024. actionResult.Result = JsonHelper.ToJson(returnValue);
  4025. actionResult.Status = (int)Constant.PDAResult.Success;
  4026. }
  4027. else
  4028. {
  4029. actionResult.Status = (int)Constant.PDAResult.Fail;
  4030. if (returnValue == 0)
  4031. {
  4032. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  4033. }
  4034. else
  4035. {
  4036. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  4037. }
  4038. }
  4039. }
  4040. catch (Exception ex)
  4041. {
  4042. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4043. OutputLog.TraceLog(LogPriority.Error,
  4044. this.ToString(),
  4045. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4046. ex.ToString(),
  4047. LocalPath.LogExePath);
  4048. actionResult.Status = (int)Constant.PDAResult.Exception;
  4049. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4050. }
  4051. return actionResult;
  4052. }
  4053. /// <summary>
  4054. /// 获取产品完成工序的ID(PDA)
  4055. /// </summary>
  4056. /// <param name="barcode">产品条码</param>
  4057. /// <returns>int</returns>
  4058. public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  4059. {
  4060. ActionResult actionResult = new ActionResult();
  4061. try
  4062. {
  4063. // 验证请求头信息
  4064. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4065. // 验证失败
  4066. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4067. {
  4068. return actionResult;
  4069. }
  4070. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4071. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  4072. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  4073. actionResult.Status = (int)Constant.PDAResult.Success;
  4074. }
  4075. catch (Exception ex)
  4076. {
  4077. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4078. OutputLog.TraceLog(LogPriority.Error,
  4079. this.ToString(),
  4080. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4081. ex.ToString(),
  4082. LocalPath.LogExePath);
  4083. actionResult.Status = (int)Constant.PDAResult.Exception;
  4084. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4085. }
  4086. return actionResult;
  4087. }
  4088. /// <summary>
  4089. /// 获取产品完成工序的ID(PDA)
  4090. /// </summary>
  4091. /// <param name="barcode">产品条码</param>
  4092. /// <returns>int</returns>
  4093. public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  4094. {
  4095. ActionResult actionResult = new ActionResult();
  4096. try
  4097. {
  4098. // 验证请求头信息
  4099. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4100. // 验证失败
  4101. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4102. {
  4103. return actionResult;
  4104. }
  4105. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4106. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  4107. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  4108. actionResult.Status = (int)Constant.PDAResult.Success;
  4109. }
  4110. catch (Exception ex)
  4111. {
  4112. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4113. OutputLog.TraceLog(LogPriority.Error,
  4114. this.ToString(),
  4115. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4116. ex.ToString(),
  4117. LocalPath.LogExePath);
  4118. actionResult.Status = (int)Constant.PDAResult.Exception;
  4119. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4120. }
  4121. return actionResult;
  4122. }
  4123. /// <summary>
  4124. /// 成检-校验生产工号
  4125. /// </summary>
  4126. /// <param name="usercode">生产工号</param>
  4127. /// <returns>int</returns>
  4128. public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode)
  4129. {
  4130. ActionResult actionResult = new ActionResult();
  4131. try
  4132. {
  4133. // 验证请求头信息
  4134. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4135. // 验证失败
  4136. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4137. {
  4138. return actionResult;
  4139. }
  4140. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4141. () => PDAModuleLogic.GetUserCode(usercode, sUserInfo));
  4142. actionResult.Result = JsonHelper.ToJson(ds);
  4143. actionResult.Status = (int)Constant.PDAResult.Success;
  4144. }
  4145. catch (Exception ex)
  4146. {
  4147. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4148. OutputLog.TraceLog(LogPriority.Error,
  4149. this.ToString(),
  4150. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4151. ex.ToString(),
  4152. LocalPath.LogExePath);
  4153. actionResult.Status = (int)Constant.PDAResult.Exception;
  4154. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4155. }
  4156. return actionResult;
  4157. }
  4158. /// <summary>
  4159. /// 更新漏扫的成型工号
  4160. /// </summary>
  4161. /// <param name="accountCode"></param>
  4162. /// <param name="userCode"></param>
  4163. /// <param name="userPassword"></param>
  4164. /// <param name="sessionKey"></param>
  4165. /// <param name="groutingUserCode">成型工号</param>
  4166. /// <param name="missingID">漏扫ID</param>
  4167. /// <returns></returns>
  4168. public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  4169. {
  4170. ActionResult actionResult = new ActionResult();
  4171. try
  4172. {
  4173. // 验证请求头信息
  4174. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4175. // 验证失败
  4176. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4177. {
  4178. return actionResult;
  4179. }
  4180. int returnValue = ServiceInvoker.Invoke<int>(this,
  4181. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  4182. if (returnValue != -1)
  4183. {
  4184. actionResult.Result = JsonHelper.ToJson(returnValue);
  4185. actionResult.Status = (int)Constant.PDAResult.Success;
  4186. }
  4187. else
  4188. {
  4189. actionResult.Status = (int)Constant.PDAResult.Fail;
  4190. actionResult.Message = "存在无效的漏扫工号";
  4191. }
  4192. }
  4193. catch (Exception ex)
  4194. {
  4195. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4196. OutputLog.TraceLog(LogPriority.Error,
  4197. this.ToString(),
  4198. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4199. ex.ToString(),
  4200. LocalPath.LogExePath);
  4201. actionResult.Status = (int)Constant.PDAResult.Exception;
  4202. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4203. }
  4204. return actionResult;
  4205. }
  4206. /// <summary>
  4207. /// 在入窑工序检验窑车号是否存在
  4208. /// </summary>
  4209. /// <param name="accountCode"></param>
  4210. /// <param name="userCode"></param>
  4211. /// <param name="userPassword"></param>
  4212. /// <param name="sessionKey"></param>
  4213. /// <param name="kilncarcode">窑车编码</param>
  4214. /// <param name="procedureid">工序ID</param>
  4215. /// <returns></returns>
  4216. public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4217. {
  4218. ActionResult actionResult = new ActionResult();
  4219. try
  4220. {
  4221. // 验证请求头信息
  4222. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4223. // 验证失败
  4224. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4225. {
  4226. return actionResult;
  4227. }
  4228. int returnValue = ServiceInvoker.Invoke<int>(this,
  4229. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  4230. if (returnValue == 1)
  4231. {
  4232. actionResult.Result = JsonHelper.ToJson(returnValue);
  4233. actionResult.Status = (int)Constant.PDAResult.Success;
  4234. }
  4235. else
  4236. {
  4237. actionResult.Status = (int)Constant.PDAResult.Fail;
  4238. if (returnValue == -99)
  4239. actionResult.Message = "窑炉车号无效";
  4240. else if (returnValue == -98)
  4241. actionResult.Message = "窑车己无产品";
  4242. else if (returnValue == -97)
  4243. actionResult.Message = "窑车没有入窑,不可以撤销";
  4244. else if (returnValue == -1)
  4245. actionResult.Message = "保存失败";
  4246. }
  4247. }
  4248. catch (Exception ex)
  4249. {
  4250. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4251. OutputLog.TraceLog(LogPriority.Error,
  4252. this.ToString(),
  4253. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4254. ex.ToString(),
  4255. LocalPath.LogExePath);
  4256. actionResult.Status = (int)Constant.PDAResult.Exception;
  4257. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4258. }
  4259. return actionResult;
  4260. }
  4261. /// <summary>
  4262. /// 获取盘点单列表
  4263. /// </summary>
  4264. /// <param name="sUserInfo"></param>
  4265. /// <returns></returns>
  4266. public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey)
  4267. {
  4268. ActionResult actionResult = new ActionResult();
  4269. try
  4270. {
  4271. // 验证请求头信息
  4272. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4273. // 验证失败
  4274. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4275. {
  4276. return actionResult;
  4277. }
  4278. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4279. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  4280. actionResult.Result = JsonHelper.ToJson(ds);
  4281. actionResult.Status = (int)Constant.PDAResult.Success;
  4282. }
  4283. catch (Exception ex)
  4284. {
  4285. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4286. OutputLog.TraceLog(LogPriority.Error,
  4287. this.ToString(),
  4288. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4289. ex.ToString(),
  4290. LocalPath.LogExePath);
  4291. actionResult.Status = (int)Constant.PDAResult.Exception;
  4292. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4293. }
  4294. return actionResult;
  4295. }
  4296. /// <summary>
  4297. /// 进行盘点操作
  4298. /// </summary>
  4299. /// <param name="accountCode"></param>
  4300. /// <param name="userCode"></param>
  4301. /// <param name="userPassword"></param>
  4302. /// <param name="sessionKey"></param>
  4303. /// <param name="InCheckedID">盘点单ID</param>
  4304. /// <param name="BarCode">产品条码</param>
  4305. /// <returns></returns>
  4306. public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4307. {
  4308. ActionResult actionResult = new ActionResult();
  4309. try
  4310. {
  4311. // 验证请求头信息
  4312. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4313. // 验证失败
  4314. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4315. {
  4316. return actionResult;
  4317. }
  4318. int returnValue = ServiceInvoker.Invoke<int>(this,
  4319. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4320. if (returnValue > 0)
  4321. {
  4322. actionResult.Result = JsonHelper.ToJson(returnValue);
  4323. actionResult.Status = (int)Constant.PDAResult.Success;
  4324. actionResult.Message = "产品" + BarCode + "盘点成功";
  4325. }
  4326. else if (returnValue == 10)
  4327. {
  4328. actionResult.Result = JsonHelper.ToJson(returnValue);
  4329. actionResult.Status = (int)Constant.PDAResult.Success;
  4330. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4331. }
  4332. else
  4333. {
  4334. actionResult.Status = (int)Constant.PDAResult.Fail;
  4335. if (returnValue == -2)
  4336. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4337. //if (returnValue == 10)
  4338. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4339. //if (returnValue > 0)
  4340. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4341. if (returnValue == -22)
  4342. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4343. if (returnValue == -23)
  4344. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4345. if (returnValue == -24)
  4346. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4347. if (returnValue == -25)
  4348. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4349. else if (returnValue == 0)
  4350. actionResult.Message = "盘点失败";
  4351. }
  4352. }
  4353. catch (Exception ex)
  4354. {
  4355. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4356. OutputLog.TraceLog(LogPriority.Error,
  4357. this.ToString(),
  4358. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4359. ex.ToString(),
  4360. LocalPath.LogExePath);
  4361. actionResult.Status = (int)Constant.PDAResult.Exception;
  4362. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4363. }
  4364. return actionResult;
  4365. }
  4366. #region 班次配置
  4367. /// <summary>
  4368. /// 班次配置-通过工号获取工种列表
  4369. /// </summary>
  4370. /// <param name="userId">工号ID</param>
  4371. /// <returns></returns>
  4372. public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4373. {
  4374. ActionResult actionResult = new ActionResult();
  4375. try
  4376. {
  4377. // 验证请求头信息
  4378. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4379. // 验证失败
  4380. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4381. {
  4382. return actionResult;
  4383. }
  4384. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4385. () => SystemModuleLogic.GetJobByUserId(userId));
  4386. actionResult.Result = JsonHelper.ToJson(ds);
  4387. actionResult.Status = (int)Constant.PDAResult.Success;
  4388. }
  4389. catch (Exception ex)
  4390. {
  4391. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4392. OutputLog.TraceLog(LogPriority.Error,
  4393. this.ToString(),
  4394. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4395. ex.ToString(),
  4396. LocalPath.LogExePath);
  4397. actionResult.Status = (int)Constant.PDAResult.Exception;
  4398. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4399. }
  4400. return actionResult;
  4401. }
  4402. ///// <summary>
  4403. ///// 班次配置-根据工号查询员工档案信息
  4404. ///// </summary>
  4405. ///// <param name="userId">工号ID</param>
  4406. ///// <returns></returns>
  4407. //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4408. //{
  4409. // ActionResult actionResult = new ActionResult();
  4410. // try
  4411. // {
  4412. // // 验证请求头信息
  4413. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4414. // // 验证失败
  4415. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4416. // {
  4417. // return actionResult;
  4418. // }
  4419. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4420. // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
  4421. // actionResult.Result = JsonHelper.ToJson(ds);
  4422. // actionResult.Status = (int)Constant.PDAResult.Success;
  4423. // }
  4424. // catch (Exception ex)
  4425. // {
  4426. // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4427. // OutputLog.TraceLog(LogPriority.Error,
  4428. // this.ToString(),
  4429. // System.Reflection.MethodBase.GetCurrentMethod().Name,
  4430. // ex.ToString(),
  4431. // LocalPath.LogExePath);
  4432. // actionResult.Status = (int)Constant.PDAResult.Exception;
  4433. // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4434. // }
  4435. // return actionResult;
  4436. //}
  4437. /// <summary>
  4438. /// 班次配置-根据员工姓名查员工信息
  4439. /// </summary>
  4440. /// <param name="searchStaffEntity"></param>
  4441. /// <returns></returns>
  4442. public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4443. {
  4444. ActionResult actionResult = new ActionResult();
  4445. try
  4446. {
  4447. // 验证请求头信息
  4448. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4449. // 验证失败
  4450. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4451. {
  4452. return actionResult;
  4453. }
  4454. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4455. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4456. actionResult.Result = JsonHelper.ToJson(ds);
  4457. actionResult.Status = (int)Constant.PDAResult.Success;
  4458. }
  4459. catch (Exception ex)
  4460. {
  4461. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4462. OutputLog.TraceLog(LogPriority.Error,
  4463. this.ToString(),
  4464. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4465. ex.ToString(),
  4466. LocalPath.LogExePath);
  4467. actionResult.Status = (int)Constant.PDAResult.Exception;
  4468. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4469. }
  4470. return actionResult;
  4471. }
  4472. /// <summary>
  4473. /// 获取班次配置信息
  4474. /// </summary>
  4475. /// <param name="searchEntity"></param>
  4476. /// <returns></returns>
  4477. public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  4478. {
  4479. ActionResult actionResult = new ActionResult();
  4480. try
  4481. {
  4482. // 验证请求头信息
  4483. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4484. // 验证失败
  4485. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4486. {
  4487. return actionResult;
  4488. }
  4489. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4490. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4491. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4492. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4493. actionResult.Result = JsonHelper.ToJson(ds);
  4494. actionResult.Status = (int)Constant.PDAResult.Success;
  4495. }
  4496. catch (Exception ex)
  4497. {
  4498. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4499. OutputLog.TraceLog(LogPriority.Error,
  4500. this.ToString(),
  4501. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4502. ex.ToString(),
  4503. LocalPath.LogExePath);
  4504. actionResult.Status = (int)Constant.PDAResult.Exception;
  4505. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4506. }
  4507. return actionResult;
  4508. }
  4509. public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4510. {
  4511. ActionResult actionResult = new ActionResult();
  4512. try
  4513. {
  4514. // 验证请求头信息
  4515. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4516. // 验证失败
  4517. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4518. {
  4519. return actionResult;
  4520. }
  4521. int returnValue = ServiceInvoker.Invoke<int>(this,
  4522. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4523. if (returnValue > 0)
  4524. {
  4525. actionResult.Result = JsonHelper.ToJson(returnValue);
  4526. actionResult.Status = (int)Constant.PDAResult.Success;
  4527. }
  4528. else
  4529. {
  4530. actionResult.Status = (int)Constant.PDAResult.Fail;
  4531. actionResult.Message = "保存失败";
  4532. }
  4533. }
  4534. catch (Exception ex)
  4535. {
  4536. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4537. OutputLog.TraceLog(LogPriority.Error,
  4538. this.ToString(),
  4539. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4540. ex.ToString(),
  4541. LocalPath.LogExePath);
  4542. actionResult.Status = (int)Constant.PDAResult.Exception;
  4543. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4544. }
  4545. return actionResult;
  4546. }
  4547. /// <summary>
  4548. /// 班次配置--获取详细信息
  4549. /// </summary>
  4550. /// <param name="searchEntity"></param>
  4551. /// <returns></returns>
  4552. public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4553. {
  4554. ActionResult actionResult = new ActionResult();
  4555. try
  4556. {
  4557. // 验证请求头信息
  4558. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4559. // 验证失败
  4560. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4561. {
  4562. return actionResult;
  4563. }
  4564. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4565. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4566. actionResult.Result = JsonHelper.ToJson(ds);
  4567. actionResult.Status = (int)Constant.PDAResult.Success;
  4568. }
  4569. catch (Exception ex)
  4570. {
  4571. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4572. OutputLog.TraceLog(LogPriority.Error,
  4573. this.ToString(),
  4574. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4575. ex.ToString(),
  4576. LocalPath.LogExePath);
  4577. actionResult.Status = (int)Constant.PDAResult.Exception;
  4578. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4579. }
  4580. return actionResult;
  4581. }
  4582. /// <summary>
  4583. /// 获取用户是否有班次配置权限
  4584. /// </summary>
  4585. /// <param name="accountCode"></param>
  4586. /// <param name="userCode"></param>
  4587. /// <param name="userPassword"></param>
  4588. /// <param name="sessionKey"></param>
  4589. /// <returns></returns>
  4590. public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4591. {
  4592. ActionResult actionResult = new ActionResult();
  4593. try
  4594. {
  4595. // 验证请求头信息
  4596. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4597. // 验证失败
  4598. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4599. {
  4600. return actionResult;
  4601. }
  4602. int returnValue = ServiceInvoker.Invoke<int>(this,
  4603. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4604. actionResult.Result = JsonHelper.ToJson(returnValue);
  4605. actionResult.Status = (int)Constant.PDAResult.Success;
  4606. }
  4607. catch (Exception ex)
  4608. {
  4609. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4610. OutputLog.TraceLog(LogPriority.Error,
  4611. this.ToString(),
  4612. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4613. ex.ToString(),
  4614. LocalPath.LogExePath);
  4615. actionResult.Status = (int)Constant.PDAResult.Exception;
  4616. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4617. }
  4618. return actionResult;
  4619. }
  4620. /// <summary>
  4621. /// 获取盘点单列表
  4622. /// </summary>
  4623. /// <param name="sUserInfo"></param>
  4624. /// <returns></returns>
  4625. public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  4626. {
  4627. ActionResult actionResult = new ActionResult();
  4628. try
  4629. {
  4630. // 验证请求头信息
  4631. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4632. // 验证失败
  4633. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4634. {
  4635. return actionResult;
  4636. }
  4637. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4638. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4639. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4640. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4641. actionResult.Result = JsonHelper.ToJson(ds);
  4642. actionResult.Status = (int)Constant.PDAResult.Success;
  4643. }
  4644. catch (Exception ex)
  4645. {
  4646. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4647. OutputLog.TraceLog(LogPriority.Error,
  4648. this.ToString(),
  4649. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4650. ex.ToString(),
  4651. LocalPath.LogExePath);
  4652. actionResult.Status = (int)Constant.PDAResult.Exception;
  4653. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4654. }
  4655. return actionResult;
  4656. }
  4657. #endregion
  4658. #region PDA报表
  4659. /// <summary>
  4660. /// 产品质量跟踪
  4661. /// </summary>
  4662. /// <param name="accountCode"></param>
  4663. /// <param name="userCode"></param>
  4664. /// <param name="userPassword"></param>
  4665. /// <param name="sessionKey"></param>
  4666. /// <param name="se"></param>
  4667. /// <returns></returns>
  4668. public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4669. {
  4670. ActionResult actionResult = new ActionResult();
  4671. try
  4672. {
  4673. // 验证请求头信息
  4674. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4675. // 验证失败
  4676. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4677. {
  4678. return actionResult;
  4679. }
  4680. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4681. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4682. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4683. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4684. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4685. {
  4686. actionResult.Status = (int)Constant.PDAResult.Fail;
  4687. actionResult.Message = Messages.MSG_CMN_I002;
  4688. }
  4689. else
  4690. {
  4691. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4692. actionResult.Status = (int)Constant.PDAResult.Success;
  4693. }
  4694. }
  4695. catch (Exception ex)
  4696. {
  4697. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4698. OutputLog.TraceLog(LogPriority.Error,
  4699. this.ToString(),
  4700. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4701. ex.ToString(),
  4702. LocalPath.LogExePath);
  4703. actionResult.Status = (int)Constant.PDAResult.Exception;
  4704. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4705. }
  4706. return actionResult;
  4707. }
  4708. /// <summary>
  4709. /// 工号产量质量分析表
  4710. /// </summary>
  4711. /// <param name="accountCode"></param>
  4712. /// <param name="userCode"></param>
  4713. /// <param name="userPassword"></param>
  4714. /// <param name="sessionKey"></param>
  4715. /// <param name="se"></param>
  4716. /// <returns></returns>
  4717. public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4718. int rptSProcedureID, string workcode, string date)
  4719. {
  4720. ActionResult actionResult = new ActionResult();
  4721. try
  4722. {
  4723. // 验证请求头信息
  4724. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4725. // 验证失败
  4726. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4727. {
  4728. return actionResult;
  4729. }
  4730. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4731. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4732. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4733. {
  4734. actionResult.Status = (int)Constant.PDAResult.Fail;
  4735. actionResult.Message = Messages.MSG_CMN_I002;
  4736. }
  4737. else
  4738. {
  4739. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4740. actionResult.Status = (int)Constant.PDAResult.Success;
  4741. }
  4742. }
  4743. catch (Exception ex)
  4744. {
  4745. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4746. OutputLog.TraceLog(LogPriority.Error,
  4747. this.ToString(),
  4748. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4749. ex.ToString(),
  4750. LocalPath.LogExePath);
  4751. actionResult.Status = (int)Constant.PDAResult.Exception;
  4752. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4753. }
  4754. return actionResult;
  4755. }
  4756. /// <summary>
  4757. /// 工号产量质量分析表(中陶)
  4758. /// </summary>
  4759. /// <param name="accountCode"></param>
  4760. /// <param name="userCode"></param>
  4761. /// <param name="userPassword"></param>
  4762. /// <param name="sessionKey"></param>
  4763. /// <param name="se"></param>
  4764. /// <returns></returns>
  4765. public ActionResult GetFP00002_1Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4766. int rptSProcedureID, string workcode, string date, string goodscode)
  4767. {
  4768. ActionResult actionResult = new ActionResult();
  4769. try
  4770. {
  4771. // 验证请求头信息
  4772. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4773. // 验证失败
  4774. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4775. {
  4776. return actionResult;
  4777. }
  4778. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4779. () => PDAModuleLogic.GetFP00002_1Data(sUserInfo, rptSProcedureID, workcode,
  4780. Convert.ToDateTime(date), goodscode));
  4781. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4782. {
  4783. actionResult.Status = (int)Constant.PDAResult.Fail;
  4784. actionResult.Message = Messages.MSG_CMN_I002;
  4785. }
  4786. else
  4787. {
  4788. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4789. actionResult.Status = (int)Constant.PDAResult.Success;
  4790. }
  4791. }
  4792. catch (Exception ex)
  4793. {
  4794. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4795. OutputLog.TraceLog(LogPriority.Error,
  4796. this.ToString(),
  4797. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4798. ex.ToString(),
  4799. LocalPath.LogExePath);
  4800. actionResult.Status = (int)Constant.PDAResult.Exception;
  4801. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4802. }
  4803. return actionResult;
  4804. }
  4805. /// <summary>
  4806. /// 半检数据统计表
  4807. /// </summary>
  4808. /// <param name="accountCode"></param>
  4809. /// <param name="userCode"></param>
  4810. /// <param name="userPassword"></param>
  4811. /// <param name="sessionKey"></param>
  4812. /// <param name="se"></param>
  4813. /// <returns></returns>
  4814. public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4815. string workcode, string datebegin, string dateend)
  4816. {
  4817. ActionResult actionResult = new ActionResult();
  4818. try
  4819. {
  4820. // 验证请求头信息
  4821. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4822. // 验证失败
  4823. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4824. {
  4825. return actionResult;
  4826. }
  4827. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4828. DateTime datetimeend = Convert.ToDateTime(dateend);
  4829. datetimebegin = datetimebegin.Date;
  4830. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4831. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4832. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4833. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4834. {
  4835. actionResult.Status = (int)Constant.PDAResult.Fail;
  4836. actionResult.Message = Messages.MSG_CMN_I002;
  4837. }
  4838. else
  4839. {
  4840. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4841. actionResult.Status = (int)Constant.PDAResult.Success;
  4842. }
  4843. }
  4844. catch (Exception ex)
  4845. {
  4846. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4847. OutputLog.TraceLog(LogPriority.Error,
  4848. this.ToString(),
  4849. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4850. ex.ToString(),
  4851. LocalPath.LogExePath);
  4852. actionResult.Status = (int)Constant.PDAResult.Exception;
  4853. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4854. }
  4855. return actionResult;
  4856. }
  4857. /// <summary>
  4858. /// 工号质量统计表
  4859. /// </summary>
  4860. /// <param name="accountCode"></param>
  4861. /// <param name="userCode"></param>
  4862. /// <param name="userPassword"></param>
  4863. /// <param name="sessionKey"></param>
  4864. /// <param name="se"></param>
  4865. /// <returns></returns>
  4866. public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4867. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4868. {
  4869. ActionResult actionResult = new ActionResult();
  4870. try
  4871. {
  4872. // 验证请求头信息
  4873. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4874. // 验证失败
  4875. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4876. {
  4877. return actionResult;
  4878. }
  4879. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4880. DateTime datetimeend = Convert.ToDateTime(dateend);
  4881. datetimebegin = datetimebegin.Date;
  4882. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4883. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4884. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4885. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4886. {
  4887. actionResult.Status = (int)Constant.PDAResult.Fail;
  4888. actionResult.Message = Messages.MSG_CMN_I002;
  4889. }
  4890. else
  4891. {
  4892. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4893. actionResult.Status = (int)Constant.PDAResult.Success;
  4894. }
  4895. }
  4896. catch (Exception ex)
  4897. {
  4898. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4899. OutputLog.TraceLog(LogPriority.Error,
  4900. this.ToString(),
  4901. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4902. ex.ToString(),
  4903. LocalPath.LogExePath);
  4904. actionResult.Status = (int)Constant.PDAResult.Exception;
  4905. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4906. }
  4907. return actionResult;
  4908. }
  4909. /// <summary>
  4910. /// 损坯数据统计表
  4911. /// </summary>
  4912. /// <param name="accountCode"></param>
  4913. /// <param name="userCode"></param>
  4914. /// <param name="userPassword"></param>
  4915. /// <param name="sessionKey"></param>
  4916. /// <param name="se"></param>
  4917. /// <returns></returns>
  4918. public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4919. string workcode, string datebegin, string dateend)
  4920. {
  4921. ActionResult actionResult = new ActionResult();
  4922. try
  4923. {
  4924. // 验证请求头信息
  4925. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4926. // 验证失败
  4927. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4928. {
  4929. return actionResult;
  4930. }
  4931. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4932. DateTime datetimeend = Convert.ToDateTime(dateend);
  4933. datetimebegin = datetimebegin.Date;
  4934. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4935. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4936. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4937. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4938. {
  4939. actionResult.Status = (int)Constant.PDAResult.Fail;
  4940. actionResult.Message = Messages.MSG_CMN_I002;
  4941. }
  4942. else
  4943. {
  4944. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4945. actionResult.Status = (int)Constant.PDAResult.Success;
  4946. }
  4947. }
  4948. catch (Exception ex)
  4949. {
  4950. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4951. OutputLog.TraceLog(LogPriority.Error,
  4952. this.ToString(),
  4953. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4954. ex.ToString(),
  4955. LocalPath.LogExePath);
  4956. actionResult.Status = (int)Constant.PDAResult.Exception;
  4957. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4958. }
  4959. return actionResult;
  4960. }
  4961. #endregion
  4962. /// <summary>
  4963. /// 取得报表数据源数据
  4964. /// </summary>
  4965. /// <param name="accountCode"></param>
  4966. /// <param name="userCode"></param>
  4967. /// <param name="userPassword"></param>
  4968. /// <param name="sessionKey"></param>
  4969. /// <returns></returns>
  4970. public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
  4971. {
  4972. ActionResult actionResult = new ActionResult();
  4973. try
  4974. {
  4975. // 验证请求头信息
  4976. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4977. // 验证失败
  4978. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4979. {
  4980. return actionResult;
  4981. }
  4982. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4983. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4984. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4985. {
  4986. actionResult.Status = (int)Constant.PDAResult.Fail;
  4987. actionResult.Message = Messages.MSG_CMN_I002;
  4988. }
  4989. else
  4990. {
  4991. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4992. actionResult.Status = (int)Constant.PDAResult.Success;
  4993. }
  4994. }
  4995. catch (Exception ex)
  4996. {
  4997. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4998. OutputLog.TraceLog(LogPriority.Error,
  4999. this.ToString(),
  5000. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5001. ex.ToString(),
  5002. LocalPath.LogExePath);
  5003. actionResult.Status = (int)Constant.PDAResult.Exception;
  5004. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5005. }
  5006. return actionResult;
  5007. }
  5008. /// <summary>
  5009. /// 取得报表的查询数据源统计工序数据
  5010. /// </summary>
  5011. /// <param name="accountCode"></param>
  5012. /// <param name="userCode"></param>
  5013. /// <param name="userPassword"></param>
  5014. /// <param name="sessionKey"></param>
  5015. /// <param name="RptProcedureID"></param>
  5016. /// <returns></returns>
  5017. public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  5018. {
  5019. ActionResult actionResult = new ActionResult();
  5020. try
  5021. {
  5022. // 验证请求头信息
  5023. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5024. // 验证失败
  5025. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5026. {
  5027. return actionResult;
  5028. }
  5029. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5030. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  5031. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5032. {
  5033. actionResult.Status = (int)Constant.PDAResult.Fail;
  5034. actionResult.Message = Messages.MSG_CMN_I002;
  5035. }
  5036. else
  5037. {
  5038. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5039. actionResult.Status = (int)Constant.PDAResult.Success;
  5040. }
  5041. }
  5042. catch (Exception ex)
  5043. {
  5044. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5045. OutputLog.TraceLog(LogPriority.Error,
  5046. this.ToString(),
  5047. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5048. ex.ToString(),
  5049. LocalPath.LogExePath);
  5050. actionResult.Status = (int)Constant.PDAResult.Exception;
  5051. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5052. }
  5053. return actionResult;
  5054. }
  5055. /// <summary>
  5056. /// 获取用户是否有统计产成品权限
  5057. /// </summary>
  5058. /// <param name="accountCode"></param>
  5059. /// <param name="userCode"></param>
  5060. /// <param name="userPassword"></param>
  5061. /// <param name="sessionKey"></param>
  5062. /// <returns></returns>
  5063. public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5064. {
  5065. ActionResult actionResult = new ActionResult();
  5066. try
  5067. {
  5068. // 验证请求头信息
  5069. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5070. // 验证失败
  5071. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5072. {
  5073. return actionResult;
  5074. }
  5075. int returnValue = ServiceInvoker.Invoke<int>(this,
  5076. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  5077. actionResult.Result = JsonHelper.ToJson(returnValue);
  5078. actionResult.Status = (int)Constant.PDAResult.Success;
  5079. }
  5080. catch (Exception ex)
  5081. {
  5082. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5083. OutputLog.TraceLog(LogPriority.Error,
  5084. this.ToString(),
  5085. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5086. ex.ToString(),
  5087. LocalPath.LogExePath);
  5088. actionResult.Status = (int)Constant.PDAResult.Exception;
  5089. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5090. }
  5091. return actionResult;
  5092. }
  5093. /// <summary>
  5094. /// 获取用户是否有盘点权限
  5095. /// </summary>
  5096. /// <param name="accountCode"></param>
  5097. /// <param name="userCode"></param>
  5098. /// <param name="userPassword"></param>
  5099. /// <param name="sessionKey"></param>
  5100. /// <returns></returns>
  5101. public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5102. {
  5103. ActionResult actionResult = new ActionResult();
  5104. try
  5105. {
  5106. // 验证请求头信息
  5107. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5108. // 验证失败
  5109. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5110. {
  5111. return actionResult;
  5112. }
  5113. int returnValue = ServiceInvoker.Invoke<int>(this,
  5114. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  5115. actionResult.Result = JsonHelper.ToJson(returnValue);
  5116. actionResult.Status = (int)Constant.PDAResult.Success;
  5117. }
  5118. catch (Exception ex)
  5119. {
  5120. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5121. OutputLog.TraceLog(LogPriority.Error,
  5122. this.ToString(),
  5123. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5124. ex.ToString(),
  5125. LocalPath.LogExePath);
  5126. actionResult.Status = (int)Constant.PDAResult.Exception;
  5127. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5128. }
  5129. return actionResult;
  5130. }
  5131. /// <summary>
  5132. /// 根据条件查询是否存在班次配置
  5133. /// </summary>
  5134. /// <param name="accountCode"></param>
  5135. /// <param name="userCode"></param>
  5136. /// <param name="userPassword"></param>
  5137. /// <param name="sessionKey"></param>
  5138. /// <param name="userCode">工号编码</param>
  5139. /// <returns></returns>
  5140. public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  5141. {
  5142. ActionResult actionResult = new ActionResult();
  5143. try
  5144. {
  5145. // 验证请求头信息
  5146. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5147. // 验证失败
  5148. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5149. {
  5150. return actionResult;
  5151. }
  5152. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5153. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  5154. actionResult.Result = JsonHelper.ToJson(ds);
  5155. actionResult.Status = (int)Constant.PDAResult.Success;
  5156. }
  5157. catch (Exception ex)
  5158. {
  5159. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5160. OutputLog.TraceLog(LogPriority.Error,
  5161. this.ToString(),
  5162. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5163. ex.ToString(),
  5164. LocalPath.LogExePath);
  5165. actionResult.Status = (int)Constant.PDAResult.Exception;
  5166. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5167. }
  5168. return actionResult;
  5169. }
  5170. /// <summary>
  5171. /// 报损工序查出工号根据生产数据ID
  5172. /// </summary>
  5173. /// <param name="accountCode"></param>
  5174. /// <param name="userCode"></param>
  5175. /// <param name="userPassword"></param>
  5176. /// <param name="sessionKey"></param>
  5177. /// <param name="ProductionDataID">生产数据ID</param>
  5178. /// <returns></returns>
  5179. public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  5180. {
  5181. ActionResult actionResult = new ActionResult();
  5182. try
  5183. {
  5184. // 验证请求头信息
  5185. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5186. // 验证失败
  5187. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5188. {
  5189. return actionResult;
  5190. }
  5191. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5192. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  5193. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5194. {
  5195. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5196. actionResult.Status = (int)Constant.PDAResult.Success;
  5197. }
  5198. else
  5199. {
  5200. actionResult.Status = (int)Constant.PDAResult.Fail;
  5201. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5202. }
  5203. }
  5204. catch (Exception ex)
  5205. {
  5206. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5207. OutputLog.TraceLog(LogPriority.Error,
  5208. this.ToString(),
  5209. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5210. ex.ToString(),
  5211. LocalPath.LogExePath);
  5212. actionResult.Status = (int)Constant.PDAResult.Exception;
  5213. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5214. }
  5215. return actionResult;
  5216. }
  5217. /// <summary>
  5218. /// 在入窑工序检验窑车号是否存在
  5219. /// </summary>
  5220. /// <param name="accountCode"></param>
  5221. /// <param name="userCode"></param>
  5222. /// <param name="userPassword"></param>
  5223. /// <param name="sessionKey"></param>
  5224. /// <param name="kilncarcode">窑车编码</param>
  5225. /// <param name="procedureid">工序ID</param>
  5226. /// <returns></returns>
  5227. public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  5228. {
  5229. ActionResult actionResult = new ActionResult();
  5230. try
  5231. {
  5232. // 验证请求头信息
  5233. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5234. // 验证失败
  5235. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5236. {
  5237. return actionResult;
  5238. }
  5239. int returnValue = ServiceInvoker.Invoke<int>(this,
  5240. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  5241. if (returnValue == 1)
  5242. {
  5243. actionResult.Result = JsonHelper.ToJson(returnValue);
  5244. actionResult.Status = (int)Constant.PDAResult.Success;
  5245. }
  5246. else
  5247. {
  5248. actionResult.Status = (int)Constant.PDAResult.Fail;
  5249. if (returnValue == -99)
  5250. actionResult.Message = "窑炉车号无效";
  5251. else if (returnValue == -98)
  5252. actionResult.Message = "窑车己无产品";
  5253. else if (returnValue == -97)
  5254. actionResult.Message = "窑车没有入窑,不可以撤销";
  5255. else if (returnValue == -1)
  5256. actionResult.Message = "保存失败";
  5257. }
  5258. }
  5259. catch (Exception ex)
  5260. {
  5261. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5262. OutputLog.TraceLog(LogPriority.Error,
  5263. this.ToString(),
  5264. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5265. ex.ToString(),
  5266. LocalPath.LogExePath);
  5267. actionResult.Status = (int)Constant.PDAResult.Exception;
  5268. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5269. }
  5270. return actionResult;
  5271. }
  5272. /// <summary>
  5273. /// 撤销包装
  5274. /// </summary>
  5275. /// <param name="accountCode"></param>
  5276. /// <param name="userCode"></param>
  5277. /// <param name="userPassword"></param>
  5278. /// <param name="sessionKey"></param>
  5279. /// <param name="barcode"></param>
  5280. /// <returns></returns>
  5281. public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5282. {
  5283. ActionResult actionResult = new ActionResult();
  5284. try
  5285. {
  5286. // 验证请求头信息
  5287. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5288. // 验证失败
  5289. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5290. {
  5291. return actionResult;
  5292. }
  5293. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5294. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  5295. if (Convert.ToInt32(returnValue.Result) > 0)
  5296. {
  5297. actionResult.Result = JsonHelper.ToJson(returnValue);
  5298. actionResult.Status = (int)Constant.PDAResult.Success;
  5299. }
  5300. else
  5301. {
  5302. actionResult.Status = (int)Constant.PDAResult.Fail;
  5303. if (Convert.ToInt32(returnValue.Result) == -1)
  5304. actionResult.Message = "产品条码不存在包装记录";
  5305. else if (Convert.ToInt32(returnValue.Result) == -200)
  5306. actionResult.Message = returnValue.Message;
  5307. else
  5308. actionResult.Message = "成品撤销失败";
  5309. }
  5310. }
  5311. catch (Exception ex)
  5312. {
  5313. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5314. OutputLog.TraceLog(LogPriority.Error,
  5315. this.ToString(),
  5316. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5317. ex.ToString(),
  5318. LocalPath.LogExePath);
  5319. actionResult.Status = (int)Constant.PDAResult.Exception;
  5320. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5321. }
  5322. return actionResult;
  5323. }
  5324. /*
  5325. /// <summary>
  5326. /// 获取用户是否有撤销包装权限
  5327. /// </summary>
  5328. /// <param name="accountCode"></param>
  5329. /// <param name="userCode"></param>
  5330. /// <param name="userPassword"></param>
  5331. /// <param name="sessionKey"></param>
  5332. /// <returns></returns>
  5333. public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5334. {
  5335. ActionResult actionResult = new ActionResult();
  5336. try
  5337. {
  5338. // 验证请求头信息
  5339. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5340. // 验证失败
  5341. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5342. {
  5343. return actionResult;
  5344. }
  5345. int returnValue = ServiceInvoker.Invoke<int>(this,
  5346. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5347. actionResult.Result = JsonHelper.ToJson(returnValue);
  5348. actionResult.Status = (int)Constant.PDAResult.Success;
  5349. }
  5350. catch (Exception ex)
  5351. {
  5352. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5353. OutputLog.TraceLog(LogPriority.Error,
  5354. this.ToString(),
  5355. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5356. ex.ToString(),
  5357. LocalPath.LogExePath);
  5358. actionResult.Status = (int)Constant.PDAResult.Exception;
  5359. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5360. }
  5361. return actionResult;
  5362. }
  5363. */
  5364. /// <summary>
  5365. /// 窑车状态明细表查询
  5366. /// </summary>
  5367. /// <param name="accountCode"></param>
  5368. /// <param name="userCode"></param>
  5369. /// <param name="userPassword"></param>
  5370. /// <param name="sessionKey"></param>
  5371. /// <param name="kilnCarCode"></param>
  5372. /// <returns></returns>
  5373. public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5374. {
  5375. ActionResult actionResult = new ActionResult();
  5376. try
  5377. {
  5378. // 验证请求头信息
  5379. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5380. // 验证失败
  5381. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5382. {
  5383. return actionResult;
  5384. }
  5385. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5386. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5387. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5388. {
  5389. actionResult.Status = (int)Constant.PDAResult.Fail;
  5390. actionResult.Message = Messages.MSG_CMN_I002;
  5391. }
  5392. else
  5393. {
  5394. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5395. actionResult.Status = (int)Constant.PDAResult.Success;
  5396. }
  5397. }
  5398. catch (Exception ex)
  5399. {
  5400. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5401. OutputLog.TraceLog(LogPriority.Error,
  5402. this.ToString(),
  5403. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5404. ex.ToString(),
  5405. LocalPath.LogExePath);
  5406. actionResult.Status = (int)Constant.PDAResult.Exception;
  5407. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5408. }
  5409. return actionResult;
  5410. }
  5411. /// <summary>
  5412. /// 损坯撤销
  5413. /// </summary>
  5414. /// <param name="accountCode"></param>
  5415. /// <param name="userCode"></param>
  5416. /// <param name="userPassword"></param>
  5417. /// <param name="sessionKey"></param>
  5418. /// <param name="barcode"></param>
  5419. /// <returns></returns>
  5420. public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5421. {
  5422. ActionResult actionResult = new ActionResult();
  5423. try
  5424. {
  5425. // 验证请求头信息
  5426. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5427. // 验证失败
  5428. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5429. {
  5430. return actionResult;
  5431. }
  5432. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5433. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5434. if (Convert.ToInt32(returnValue.Result) > 0)
  5435. {
  5436. actionResult.Result = JsonHelper.ToJson(returnValue);
  5437. actionResult.Status = (int)Constant.PDAResult.Success;
  5438. }
  5439. else
  5440. {
  5441. actionResult.Status = (int)Constant.PDAResult.Fail;
  5442. if (Convert.ToInt32(returnValue.Result) == -1)
  5443. actionResult.Message = "此产品没有损坯,不能撤销";
  5444. else if (Convert.ToInt32(returnValue.Result) == -200)
  5445. actionResult.Message = returnValue.Message;
  5446. else
  5447. actionResult.Message = "损坯撤销失败";
  5448. }
  5449. }
  5450. catch (Exception ex)
  5451. {
  5452. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5453. OutputLog.TraceLog(LogPriority.Error,
  5454. this.ToString(),
  5455. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5456. ex.ToString(),
  5457. LocalPath.LogExePath);
  5458. actionResult.Status = (int)Constant.PDAResult.Exception;
  5459. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5460. }
  5461. return actionResult;
  5462. }
  5463. /*
  5464. /// <summary>
  5465. /// 获取用户是否有损坯撤销权限
  5466. /// </summary>
  5467. /// <param name="accountCode"></param>
  5468. /// <param name="userCode"></param>
  5469. /// <param name="userPassword"></param>
  5470. /// <param name="sessionKey"></param>
  5471. /// <returns></returns>
  5472. public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5473. {
  5474. ActionResult actionResult = new ActionResult();
  5475. try
  5476. {
  5477. // 验证请求头信息
  5478. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5479. // 验证失败
  5480. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5481. {
  5482. return actionResult;
  5483. }
  5484. int returnValue = ServiceInvoker.Invoke<int>(this,
  5485. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5486. actionResult.Result = JsonHelper.ToJson(returnValue);
  5487. actionResult.Status = (int)Constant.PDAResult.Success;
  5488. }
  5489. catch (Exception ex)
  5490. {
  5491. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5492. OutputLog.TraceLog(LogPriority.Error,
  5493. this.ToString(),
  5494. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5495. ex.ToString(),
  5496. LocalPath.LogExePath);
  5497. actionResult.Status = (int)Constant.PDAResult.Exception;
  5498. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5499. }
  5500. return actionResult;
  5501. }
  5502. */
  5503. /// <summary>
  5504. /// 获取条码注浆信息
  5505. /// </summary>
  5506. /// <param name="accountCode"></param>
  5507. /// <param name="userCode"></param>
  5508. /// <param name="userPassword"></param>
  5509. /// <param name="sessionKey"></param>
  5510. /// <returns></returns>
  5511. public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5512. {
  5513. ActionResult actionResult = new ActionResult();
  5514. try
  5515. {
  5516. // 验证请求头信息
  5517. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5518. // 验证失败
  5519. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5520. {
  5521. return actionResult;
  5522. }
  5523. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5524. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5525. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5526. {
  5527. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5528. actionResult.Status = (int)Constant.PDAResult.Success;
  5529. }
  5530. else
  5531. {
  5532. actionResult.Status = (int)Constant.PDAResult.Fail;
  5533. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5534. }
  5535. }
  5536. catch (Exception ex)
  5537. {
  5538. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5539. OutputLog.TraceLog(LogPriority.Error,
  5540. this.ToString(),
  5541. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5542. ex.ToString(),
  5543. LocalPath.LogExePath);
  5544. actionResult.Status = (int)Constant.PDAResult.Exception;
  5545. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5546. }
  5547. return actionResult;
  5548. }
  5549. /// <summary>
  5550. /// 获取条码注浆信息
  5551. /// </summary>
  5552. /// <param name="accountCode"></param>
  5553. /// <param name="userCode"></param>
  5554. /// <param name="userPassword"></param>
  5555. /// <param name="sessionKey"></param>
  5556. /// <returns></returns>
  5557. public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5558. {
  5559. ActionResult actionResult = new ActionResult();
  5560. try
  5561. {
  5562. // 验证请求头信息
  5563. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5564. // 验证失败
  5565. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5566. {
  5567. return actionResult;
  5568. }
  5569. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5570. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5571. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5572. {
  5573. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5574. actionResult.Status = (int)Constant.PDAResult.Success;
  5575. }
  5576. else
  5577. {
  5578. actionResult.Status = (int)Constant.PDAResult.Fail;
  5579. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5580. }
  5581. }
  5582. catch (Exception ex)
  5583. {
  5584. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5585. OutputLog.TraceLog(LogPriority.Error,
  5586. this.ToString(),
  5587. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5588. ex.ToString(),
  5589. LocalPath.LogExePath);
  5590. actionResult.Status = (int)Constant.PDAResult.Exception;
  5591. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5592. }
  5593. return actionResult;
  5594. }
  5595. /// <summary>
  5596. /// 公坯设定
  5597. /// </summary>
  5598. /// <param name="accountCode"></param>
  5599. /// <param name="userCode"></param>
  5600. /// <param name="userPassword"></param>
  5601. /// <param name="sessionKey"></param>
  5602. /// <param name="barcode"></param>
  5603. /// <returns></returns>
  5604. public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5605. {
  5606. ActionResult actionResult = new ActionResult();
  5607. try
  5608. {
  5609. // 验证请求头信息
  5610. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5611. // 验证失败
  5612. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5613. {
  5614. return actionResult;
  5615. }
  5616. int returnValue = ServiceInvoker.Invoke<int>(this,
  5617. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5618. if (returnValue > 0)
  5619. {
  5620. actionResult.Result = JsonHelper.ToJson(returnValue);
  5621. actionResult.Status = (int)Constant.PDAResult.Success;
  5622. }
  5623. else
  5624. {
  5625. actionResult.Status = (int)Constant.PDAResult.Fail;
  5626. if (returnValue == -1)
  5627. actionResult.Message = "此产品不在生产线上";
  5628. else if (returnValue == -2)
  5629. actionResult.Message = "该产品已经标识为公坯";
  5630. else
  5631. actionResult.Message = "公坯设定失败";
  5632. }
  5633. }
  5634. catch (Exception ex)
  5635. {
  5636. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5637. OutputLog.TraceLog(LogPriority.Error,
  5638. this.ToString(),
  5639. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5640. ex.ToString(),
  5641. LocalPath.LogExePath);
  5642. actionResult.Status = (int)Constant.PDAResult.Exception;
  5643. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5644. }
  5645. return actionResult;
  5646. }
  5647. /*
  5648. /// <summary>
  5649. /// 获取用户是否有公坯设定
  5650. /// </summary>
  5651. /// <param name="accountCode"></param>
  5652. /// <param name="userCode"></param>
  5653. /// <param name="userPassword"></param>
  5654. /// <param name="sessionKey"></param>
  5655. /// <returns></returns>
  5656. public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5657. {
  5658. ActionResult actionResult = new ActionResult();
  5659. try
  5660. {
  5661. // 验证请求头信息
  5662. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5663. // 验证失败
  5664. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5665. {
  5666. return actionResult;
  5667. }
  5668. int returnValue = ServiceInvoker.Invoke<int>(this,
  5669. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5670. actionResult.Result = JsonHelper.ToJson(returnValue);
  5671. actionResult.Status = (int)Constant.PDAResult.Success;
  5672. }
  5673. catch (Exception ex)
  5674. {
  5675. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5676. OutputLog.TraceLog(LogPriority.Error,
  5677. this.ToString(),
  5678. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5679. ex.ToString(),
  5680. LocalPath.LogExePath);
  5681. actionResult.Status = (int)Constant.PDAResult.Exception;
  5682. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5683. }
  5684. return actionResult;
  5685. }
  5686. */
  5687. /// <summary>
  5688. /// 校验产品条码是否可以走到该工序
  5689. /// </summary>
  5690. /// <param name="accountCode">帐套code</param>
  5691. /// <param name="userCode">用户code</param>
  5692. /// <param name="userPassword">用户密码</param>
  5693. /// <param name="sessionKey">本次登陆密钥</param>
  5694. /// <param name="procedureID">工序ID</param>
  5695. /// <param name="barcode">条码</param>
  5696. /// <returns></returns>
  5697. /// <remarks>
  5698. /// 陈冰 2014.09.18 新建
  5699. /// </remarks>
  5700. public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5701. {
  5702. ActionResult actionResult = new ActionResult();
  5703. try
  5704. {
  5705. // 验证请求头信息
  5706. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5707. // 验证失败
  5708. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5709. {
  5710. return actionResult;
  5711. }
  5712. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5713. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5714. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5715. {
  5716. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5717. actionResult.Status = (int)Constant.PDAResult.Success;
  5718. }
  5719. else
  5720. {
  5721. actionResult.Status = (int)Constant.PDAResult.Fail;
  5722. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5723. }
  5724. }
  5725. catch (Exception ex)
  5726. {
  5727. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5728. OutputLog.TraceLog(LogPriority.Error,
  5729. this.ToString(),
  5730. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5731. ex.ToString(),
  5732. LocalPath.LogExePath);
  5733. actionResult.Status = (int)Constant.PDAResult.Exception;
  5734. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5735. }
  5736. return actionResult;
  5737. }
  5738. /// <summary>
  5739. /// 获取用户所有菜单权限
  5740. /// </summary>
  5741. /// <param name="accountCode"></param>
  5742. /// <param name="userCode"></param>
  5743. /// <param name="userPassword"></param>
  5744. /// <param name="sessionKey"></param>
  5745. /// <returns></returns>
  5746. public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
  5747. {
  5748. ActionResult actionResult = new ActionResult();
  5749. try
  5750. {
  5751. // 验证请求头信息
  5752. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5753. // 验证失败
  5754. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5755. {
  5756. return actionResult;
  5757. }
  5758. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5759. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5760. actionResult.Result = JsonHelper.ToJson(returnValue);
  5761. actionResult.Status = (int)Constant.PDAResult.Success;
  5762. }
  5763. catch (Exception ex)
  5764. {
  5765. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5766. OutputLog.TraceLog(LogPriority.Error,
  5767. this.ToString(),
  5768. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5769. ex.ToString(),
  5770. LocalPath.LogExePath);
  5771. actionResult.Status = (int)Constant.PDAResult.Exception;
  5772. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5773. }
  5774. return actionResult;
  5775. }
  5776. public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5777. {
  5778. ActionResult actionResult = new ActionResult();
  5779. try
  5780. {
  5781. // 验证请求头信息
  5782. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5783. // 验证失败
  5784. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5785. {
  5786. return actionResult;
  5787. }
  5788. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5789. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5790. if (Convert.ToInt32(returnValue.Result) > 0)
  5791. {
  5792. actionResult.Result = JsonHelper.ToJson(returnValue);
  5793. actionResult.Status = (int)Constant.PDAResult.Success;
  5794. }
  5795. else
  5796. {
  5797. actionResult.Status = (int)Constant.PDAResult.Fail;
  5798. if (Convert.ToInt32(returnValue.Result) == -1)
  5799. actionResult.Message = "无效条码";
  5800. else if (Convert.ToInt32(returnValue.Result) == -2)
  5801. actionResult.Message = "已经生产完成";
  5802. else if (Convert.ToInt32(returnValue.Result) == -3)
  5803. actionResult.Message = "条码已经申请报废";
  5804. else if (Convert.ToInt32(returnValue.Result) == -4)
  5805. actionResult.Message = "此条码当前工序不允许进行撤销";
  5806. else if (Convert.ToInt32(returnValue.Result) == -5)
  5807. actionResult.Message = "此条码没有生产数据";
  5808. else if (Convert.ToInt32(returnValue.Result) == -6)
  5809. actionResult.Message = "没有当前工序权限";
  5810. else if (Convert.ToInt32(returnValue.Result) == -7)
  5811. actionResult.Message = "条码不在生产线上";
  5812. else if (Convert.ToInt32(returnValue.Result) == -8)
  5813. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5814. else if (Convert.ToInt32(returnValue.Result) == -9)
  5815. actionResult.Message = "条码已经是返工状态";
  5816. else if (Convert.ToInt32(returnValue.Result) == -200)
  5817. actionResult.Message = returnValue.Message;
  5818. }
  5819. }
  5820. catch (Exception ex)
  5821. {
  5822. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5823. OutputLog.TraceLog(LogPriority.Error,
  5824. this.ToString(),
  5825. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5826. ex.ToString(),
  5827. LocalPath.LogExePath);
  5828. actionResult.Status = (int)Constant.PDAResult.Exception;
  5829. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5830. }
  5831. return actionResult;
  5832. }
  5833. public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5834. {
  5835. ActionResult actionResult = new ActionResult();
  5836. try
  5837. {
  5838. // 验证请求头信息
  5839. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5840. // 验证失败
  5841. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5842. {
  5843. return actionResult;
  5844. }
  5845. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5846. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5847. if (Convert.ToInt32(returnValue.Result) > 0)
  5848. {
  5849. actionResult.Result = JsonHelper.ToJson(returnValue);
  5850. actionResult.Status = (int)Constant.PDAResult.Success;
  5851. }
  5852. else
  5853. {
  5854. actionResult.Status = (int)Constant.PDAResult.Fail;
  5855. if (Convert.ToInt32(returnValue.Result) == -1)
  5856. actionResult.Message = "无效条码";
  5857. else if (Convert.ToInt32(returnValue.Result) == -2)
  5858. actionResult.Message = "已经生产完成";
  5859. else if (Convert.ToInt32(returnValue.Result) == -3)
  5860. actionResult.Message = "条码已经申请报废";
  5861. else if (Convert.ToInt32(returnValue.Result) == -4)
  5862. actionResult.Message = "此条码当前工序不允许进行撤销";
  5863. else if (Convert.ToInt32(returnValue.Result) == -5)
  5864. actionResult.Message = "此条码没有生产数据";
  5865. else if (Convert.ToInt32(returnValue.Result) == -55)
  5866. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5867. else if (Convert.ToInt32(returnValue.Result) == -6)
  5868. actionResult.Message = "没有任何影响行";
  5869. else if (Convert.ToInt32(returnValue.Result) == -7)
  5870. actionResult.Message = "条码不在生产线上";
  5871. else if (Convert.ToInt32(returnValue.Result) == -8)
  5872. actionResult.Message = "条码已经是返工状态";
  5873. else if (Convert.ToInt32(returnValue.Result) == -200)
  5874. actionResult.Message = returnValue.Message;
  5875. }
  5876. }
  5877. catch (Exception ex)
  5878. {
  5879. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5880. OutputLog.TraceLog(LogPriority.Error,
  5881. this.ToString(),
  5882. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5883. ex.ToString(),
  5884. LocalPath.LogExePath);
  5885. actionResult.Status = (int)Constant.PDAResult.Exception;
  5886. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5887. }
  5888. return actionResult;
  5889. }
  5890. public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  5891. {
  5892. ActionResult actionResult = new ActionResult();
  5893. try
  5894. {
  5895. // 验证请求头信息
  5896. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5897. // 验证失败
  5898. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5899. {
  5900. return actionResult;
  5901. }
  5902. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5903. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5904. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5905. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5906. {
  5907. //DataView dv = returnValue.Tables[0].DefaultView;
  5908. //dv.RowFilter = "ValueFlag=1";
  5909. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5910. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5911. actionResult.Status = (int)Constant.PDAResult.Success;
  5912. }
  5913. }
  5914. catch (Exception ex)
  5915. {
  5916. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5917. OutputLog.TraceLog(LogPriority.Error,
  5918. this.ToString(),
  5919. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5920. ex.ToString(),
  5921. LocalPath.LogExePath);
  5922. actionResult.Status = (int)Constant.PDAResult.Exception;
  5923. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5924. }
  5925. return actionResult;
  5926. }
  5927. /// <summary>
  5928. /// 变更产品商标用
  5929. /// </summary>
  5930. /// <param name="accountCode"></param>
  5931. /// <param name="userCode"></param>
  5932. /// <param name="userPassword"></param>
  5933. /// <param name="sessionKey"></param>
  5934. /// <param name="goodsid"></param>
  5935. /// <returns></returns>
  5936. public ActionResult GetLogoInfoForChange(string accountCode, string userCode, string userPassword, string sessionKey
  5937. , int goodsid)
  5938. {
  5939. ActionResult actionResult = new ActionResult();
  5940. try
  5941. {
  5942. // 验证请求头信息
  5943. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5944. // 验证失败
  5945. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5946. {
  5947. return actionResult;
  5948. }
  5949. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5950. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5951. //() => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5952. () => SystemModuleLogic.GetLogoInfoForChange(sUserInfo, goodsid));
  5953. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5954. {
  5955. //DataView dv = returnValue.Tables[0].DefaultView;
  5956. //dv.RowFilter = "ValueFlag=1";
  5957. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5958. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5959. actionResult.Status = (int)Constant.PDAResult.Success;
  5960. }
  5961. }
  5962. catch (Exception ex)
  5963. {
  5964. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5965. OutputLog.TraceLog(LogPriority.Error,
  5966. this.ToString(),
  5967. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5968. ex.ToString(),
  5969. LocalPath.LogExePath);
  5970. actionResult.Status = (int)Constant.PDAResult.Exception;
  5971. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5972. }
  5973. return actionResult;
  5974. }
  5975. public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5976. {
  5977. ActionResult actionResult = new ActionResult();
  5978. try
  5979. {
  5980. // 验证请求头信息
  5981. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5982. // 验证失败
  5983. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5984. {
  5985. return actionResult;
  5986. }
  5987. int returnValue = ServiceInvoker.Invoke<int>(this,
  5988. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5989. actionResult.Result = JsonHelper.ToJson(returnValue);
  5990. actionResult.Status = (int)Constant.PDAResult.Success;
  5991. }
  5992. catch (Exception ex)
  5993. {
  5994. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5995. OutputLog.TraceLog(LogPriority.Error,
  5996. this.ToString(),
  5997. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5998. ex.ToString(),
  5999. LocalPath.LogExePath);
  6000. actionResult.Status = (int)Constant.PDAResult.Exception;
  6001. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6002. }
  6003. return actionResult;
  6004. }
  6005. public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  6006. {
  6007. ActionResult actionResult = new ActionResult();
  6008. try
  6009. {
  6010. // 验证请求头信息
  6011. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6012. // 验证失败
  6013. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6014. {
  6015. return actionResult;
  6016. }
  6017. string returnMessage = "";
  6018. int returnValue = ServiceInvoker.Invoke<int>(this,
  6019. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo, out returnMessage));
  6020. actionResult.Result = JsonHelper.ToJson(returnValue);
  6021. if (returnValue > 0)
  6022. {
  6023. actionResult.Status = (int)Constant.PDAResult.Success;
  6024. }
  6025. else if (returnValue == -2)
  6026. {
  6027. //lsq 20210723 已注浆非产成品没有商标可以变更商标
  6028. //begin
  6029. //actionResult.Message = "条码不存在";
  6030. actionResult.Message = "该条码未注浆";
  6031. //end
  6032. actionResult.Status = (int)Constant.PDAResult.Fail;
  6033. }
  6034. else if (returnValue == -3)
  6035. {
  6036. actionResult.Message = "已交接的产品不能变更商标";
  6037. actionResult.Status = (int)Constant.PDAResult.Fail;
  6038. }
  6039. else if (returnValue == -5)
  6040. {
  6041. actionResult.Message = "该商标已超过生产计划允许变更数量,不能变更商标";
  6042. actionResult.Status = (int)Constant.PDAResult.Fail;
  6043. }
  6044. else if (returnValue == -6)
  6045. {
  6046. actionResult.Message = "该商标无计划,不允许变更商标";
  6047. actionResult.Status = (int)Constant.PDAResult.Fail;
  6048. }
  6049. else
  6050. {
  6051. actionResult.Message = returnMessage;
  6052. actionResult.Status = (int)Constant.PDAResult.Fail;
  6053. }
  6054. }
  6055. catch (Exception ex)
  6056. {
  6057. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6058. OutputLog.TraceLog(LogPriority.Error,
  6059. this.ToString(),
  6060. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6061. ex.ToString(),
  6062. LocalPath.LogExePath);
  6063. actionResult.Status = (int)Constant.PDAResult.Exception;
  6064. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6065. }
  6066. return actionResult;
  6067. }
  6068. public ActionResult SaveBarCodeLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  6069. string barcode, int logoid, int glazetypeid)
  6070. {
  6071. ActionResult actionResult = new ActionResult();
  6072. try
  6073. {
  6074. // 验证请求头信息
  6075. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6076. // 验证失败
  6077. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6078. {
  6079. return actionResult;
  6080. }
  6081. string returnMessage = "";
  6082. int returnValue = ServiceInvoker.Invoke<int>(this,
  6083. () => PMModuleLogicDAL.SaveBarCodeLogoAndGlazetype(barcode, logoid, glazetypeid, sUserInfo, out returnMessage));
  6084. actionResult.Result = JsonHelper.ToJson(returnValue);
  6085. if (returnValue > 0)
  6086. {
  6087. actionResult.Status = (int)Constant.PDAResult.Success;
  6088. }
  6089. else
  6090. {
  6091. actionResult.Status = (int)Constant.PDAResult.Fail;
  6092. actionResult.Message = returnMessage;
  6093. }
  6094. }
  6095. catch (Exception ex)
  6096. {
  6097. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6098. OutputLog.TraceLog(LogPriority.Error,
  6099. this.ToString(),
  6100. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6101. ex.ToString(),
  6102. LocalPath.LogExePath);
  6103. actionResult.Status = (int)Constant.PDAResult.Exception;
  6104. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6105. }
  6106. return actionResult;
  6107. }
  6108. public ActionResult SaveBarCodesLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  6109. string barcodes, int logoid, int glazetypeid, int procedureID)
  6110. {
  6111. ActionResult actionResult = new ActionResult();
  6112. try
  6113. {
  6114. // 验证请求头信息
  6115. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6116. // 验证失败
  6117. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6118. {
  6119. return actionResult;
  6120. }
  6121. string returnMessage = "";
  6122. int returnValue = ServiceInvoker.Invoke<int>(this,
  6123. () => PMModuleLogicDAL.SaveBarCodesLogoAndGlazetype(barcodes, logoid, glazetypeid, procedureID, sUserInfo, out returnMessage));
  6124. actionResult.Result = JsonHelper.ToJson(returnValue);
  6125. if (returnValue > 0)
  6126. {
  6127. actionResult.Status = (int)Constant.PDAResult.Success;
  6128. }
  6129. else
  6130. {
  6131. actionResult.Status = (int)Constant.PDAResult.Fail;
  6132. actionResult.Message = returnMessage;
  6133. }
  6134. }
  6135. catch (Exception ex)
  6136. {
  6137. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6138. OutputLog.TraceLog(LogPriority.Error,
  6139. this.ToString(),
  6140. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6141. ex.ToString(),
  6142. LocalPath.LogExePath);
  6143. actionResult.Status = (int)Constant.PDAResult.Exception;
  6144. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6145. }
  6146. return actionResult;
  6147. }
  6148. public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6149. {
  6150. ActionResult actionResult = new ActionResult();
  6151. try
  6152. {
  6153. // 验证请求头信息
  6154. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6155. // 验证失败
  6156. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6157. {
  6158. return actionResult;
  6159. }
  6160. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  6161. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  6162. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  6163. {
  6164. string err_msg = returnValue.Tables[0].Rows[0]["err_msg"] + "";
  6165. if (!string.IsNullOrWhiteSpace(err_msg))
  6166. {
  6167. actionResult.Status = (int)Constant.PDAResult.Fail;
  6168. actionResult.Message = err_msg;
  6169. }
  6170. else
  6171. {
  6172. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  6173. actionResult.Status = (int)Constant.PDAResult.Success;
  6174. }
  6175. }
  6176. else
  6177. {
  6178. actionResult.Status = (int)Constant.PDAResult.Fail;
  6179. }
  6180. }
  6181. catch (Exception ex)
  6182. {
  6183. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6184. OutputLog.TraceLog(LogPriority.Error,
  6185. this.ToString(),
  6186. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6187. ex.ToString(),
  6188. LocalPath.LogExePath);
  6189. actionResult.Status = (int)Constant.PDAResult.Exception;
  6190. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6191. }
  6192. return actionResult;
  6193. }
  6194. /// <summary>
  6195. /// 半检时,入窑前检验获取此条码是否报损为废品
  6196. /// </summary>
  6197. /// <param name="accountCode"></param>
  6198. /// <param name="userCode"></param>
  6199. /// <param name="userPassword"></param>
  6200. /// <param name="sessionKey"></param>
  6201. /// <param name="barcode">产品条码</param>
  6202. /// <returns></returns>
  6203. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6204. {
  6205. ActionResult actionResult = new ActionResult();
  6206. try
  6207. {
  6208. // 验证请求头信息
  6209. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6210. // 验证失败
  6211. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6212. {
  6213. return actionResult;
  6214. }
  6215. int returnValue = ServiceInvoker.Invoke<int>(this,
  6216. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  6217. if (returnValue != -100)
  6218. {
  6219. actionResult.Result = JsonHelper.ToJson(returnValue);
  6220. actionResult.Status = (int)Constant.PDAResult.Success;
  6221. }
  6222. else
  6223. {
  6224. actionResult.Status = (int)Constant.PDAResult.Fail;
  6225. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  6226. }
  6227. }
  6228. catch (Exception ex)
  6229. {
  6230. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6231. OutputLog.TraceLog(LogPriority.Error,
  6232. this.ToString(),
  6233. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6234. ex.ToString(),
  6235. LocalPath.LogExePath);
  6236. actionResult.Status = (int)Constant.PDAResult.Exception;
  6237. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6238. }
  6239. return actionResult;
  6240. }
  6241. /// <summary>
  6242. /// 获取登陆帐户有无入窑前检验数据编辑权限
  6243. /// </summary>
  6244. /// <param name="accountCode"></param>
  6245. /// <param name="userCode"></param>
  6246. /// <param name="userPassword"></param>
  6247. /// <param name="sessionKey"></param>
  6248. /// <param name="usercode">工号编码</param>
  6249. /// <returns></returns>
  6250. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6251. {
  6252. ActionResult actionResult = new ActionResult();
  6253. try
  6254. {
  6255. // 验证请求头信息
  6256. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6257. // 验证失败
  6258. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6259. {
  6260. return actionResult;
  6261. }
  6262. int returnValue = ServiceInvoker.Invoke<int>(this,
  6263. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  6264. actionResult.Result = JsonHelper.ToJson(returnValue);
  6265. actionResult.Status = (int)Constant.PDAResult.Success;
  6266. }
  6267. catch (Exception ex)
  6268. {
  6269. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6270. OutputLog.TraceLog(LogPriority.Error,
  6271. this.ToString(),
  6272. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6273. ex.ToString(),
  6274. LocalPath.LogExePath);
  6275. actionResult.Status = (int)Constant.PDAResult.Exception;
  6276. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6277. }
  6278. return actionResult;
  6279. }
  6280. /// <summary>
  6281. /// 获取登陆帐户有无半检验数据编辑权限
  6282. /// </summary>
  6283. /// <param name="accountCode"></param>
  6284. /// <param name="userCode"></param>
  6285. /// <param name="userPassword"></param>
  6286. /// <param name="sessionKey"></param>
  6287. /// <param name="usercode">工号编码</param>
  6288. /// <returns></returns>
  6289. public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6290. {
  6291. ActionResult actionResult = new ActionResult();
  6292. try
  6293. {
  6294. // 验证请求头信息
  6295. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6296. // 验证失败
  6297. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6298. {
  6299. return actionResult;
  6300. }
  6301. int returnValue = ServiceInvoker.Invoke<int>(this,
  6302. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  6303. actionResult.Result = JsonHelper.ToJson(returnValue);
  6304. actionResult.Status = (int)Constant.PDAResult.Success;
  6305. }
  6306. catch (Exception ex)
  6307. {
  6308. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6309. OutputLog.TraceLog(LogPriority.Error,
  6310. this.ToString(),
  6311. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6312. ex.ToString(),
  6313. LocalPath.LogExePath);
  6314. actionResult.Status = (int)Constant.PDAResult.Exception;
  6315. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6316. }
  6317. return actionResult;
  6318. }
  6319. /// <summary>
  6320. /// 获取缺陷扣罚管理的全部数据
  6321. /// </summary>
  6322. /// <param name="accountCode"></param>
  6323. /// <param name="userCode"></param>
  6324. /// <param name="userPassword"></param>
  6325. /// <param name="sessionKey"></param>
  6326. /// <returns></returns>
  6327. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  6328. {
  6329. ActionResult actionResult = new ActionResult();
  6330. try
  6331. {
  6332. // 验证请求头信息
  6333. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6334. // 验证失败
  6335. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6336. {
  6337. return actionResult;
  6338. }
  6339. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6340. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  6341. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6342. {
  6343. DataView dv = ds.Tables[0].DefaultView;
  6344. dv.RowFilter = "valueflag=1";
  6345. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6346. actionResult.Status = (int)Constant.PDAResult.Success;
  6347. }
  6348. else
  6349. {
  6350. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6351. actionResult.Status = (int)Constant.PDAResult.Success;
  6352. }
  6353. }
  6354. catch (Exception ex)
  6355. {
  6356. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6357. OutputLog.TraceLog(LogPriority.Error,
  6358. this.ToString(),
  6359. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6360. ex.ToString(),
  6361. LocalPath.LogExePath);
  6362. actionResult.Status = (int)Constant.PDAResult.Exception;
  6363. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6364. }
  6365. return actionResult;
  6366. }
  6367. /// <summary>
  6368. /// 获取缺陷扣除数管理的全部数据
  6369. /// </summary>
  6370. /// <param name="accountCode"></param>
  6371. /// <param name="userCode"></param>
  6372. /// <param name="userPassword"></param>
  6373. /// <param name="sessionKey"></param>
  6374. /// <returns></returns>
  6375. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  6376. {
  6377. ActionResult actionResult = new ActionResult();
  6378. try
  6379. {
  6380. // 验证请求头信息
  6381. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6382. // 验证失败
  6383. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6384. {
  6385. return actionResult;
  6386. }
  6387. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6388. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  6389. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6390. {
  6391. DataView dv = ds.Tables[0].DefaultView;
  6392. dv.RowFilter = "valueflag=1";
  6393. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6394. actionResult.Status = (int)Constant.PDAResult.Success;
  6395. }
  6396. else
  6397. {
  6398. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6399. actionResult.Status = (int)Constant.PDAResult.Success;
  6400. }
  6401. }
  6402. catch (Exception ex)
  6403. {
  6404. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6405. OutputLog.TraceLog(LogPriority.Error,
  6406. this.ToString(),
  6407. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6408. ex.ToString(),
  6409. LocalPath.LogExePath);
  6410. actionResult.Status = (int)Constant.PDAResult.Exception;
  6411. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6412. }
  6413. return actionResult;
  6414. }
  6415. /// <summary>
  6416. /// 获取缺陷扣罚关系管理的全部数据
  6417. /// </summary>
  6418. /// <param name="accountCode"></param>
  6419. /// <param name="userCode"></param>
  6420. /// <param name="userPassword"></param>
  6421. /// <param name="sessionKey"></param>
  6422. /// <returns></returns>
  6423. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6424. {
  6425. ActionResult actionResult = new ActionResult();
  6426. try
  6427. {
  6428. // 验证请求头信息
  6429. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6430. // 验证失败
  6431. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6432. {
  6433. return actionResult;
  6434. }
  6435. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6436. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  6437. DataTable dt = new DataTable();
  6438. dt.Columns.Add("DefectID");
  6439. dt.Columns.Add("DefectFineID");
  6440. DataView dv = ds.Tables[0].DefaultView;
  6441. DataTable dtFor = dv.ToTable("defectid", true);
  6442. for (int i = 0; i < dtFor.Rows.Count; i++)
  6443. {
  6444. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6445. string substring = "";
  6446. foreach (DataRow r1 in r)
  6447. {
  6448. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  6449. }
  6450. if (substring != "")
  6451. {
  6452. DataRow drnew = dt.NewRow();
  6453. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6454. drnew["DefectFineID"] = substring.TrimEnd(',');
  6455. dt.Rows.Add(drnew);
  6456. }
  6457. }
  6458. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6459. actionResult.Status = (int)Constant.PDAResult.Success;
  6460. }
  6461. catch (Exception ex)
  6462. {
  6463. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6464. OutputLog.TraceLog(LogPriority.Error,
  6465. this.ToString(),
  6466. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6467. ex.ToString(),
  6468. LocalPath.LogExePath);
  6469. actionResult.Status = (int)Constant.PDAResult.Exception;
  6470. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6471. }
  6472. return actionResult;
  6473. }
  6474. /// <summary>
  6475. /// 获取缺陷扣除数关系管理的全部数据
  6476. /// </summary>
  6477. /// <param name="accountCode"></param>
  6478. /// <param name="userCode"></param>
  6479. /// <param name="userPassword"></param>
  6480. /// <param name="sessionKey"></param>
  6481. /// <returns></returns>
  6482. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6483. {
  6484. ActionResult actionResult = new ActionResult();
  6485. try
  6486. {
  6487. // 验证请求头信息
  6488. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6489. // 验证失败
  6490. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6491. {
  6492. return actionResult;
  6493. }
  6494. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6495. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6496. DataTable dt = new DataTable();
  6497. dt.Columns.Add("DefectID");
  6498. dt.Columns.Add("DefectDeductionNum");
  6499. DataView dv = ds.Tables[0].DefaultView;
  6500. DataTable dtFor = dv.ToTable("defectid", true);
  6501. for (int i = 0; i < dtFor.Rows.Count; i++)
  6502. {
  6503. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6504. string substring = "";
  6505. foreach (DataRow r1 in r)
  6506. {
  6507. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6508. }
  6509. if (substring != "")
  6510. {
  6511. DataRow drnew = dt.NewRow();
  6512. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6513. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6514. dt.Rows.Add(drnew);
  6515. }
  6516. }
  6517. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6518. actionResult.Status = (int)Constant.PDAResult.Success;
  6519. }
  6520. catch (Exception ex)
  6521. {
  6522. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6523. OutputLog.TraceLog(LogPriority.Error,
  6524. this.ToString(),
  6525. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6526. ex.ToString(),
  6527. LocalPath.LogExePath);
  6528. actionResult.Status = (int)Constant.PDAResult.Exception;
  6529. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6530. }
  6531. return actionResult;
  6532. }
  6533. /// <summary>
  6534. /// 获取盘点单明细
  6535. /// </summary>
  6536. /// <param name="sUserInfo"></param>
  6537. /// <returns></returns>
  6538. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6539. {
  6540. ActionResult actionResult = new ActionResult();
  6541. try
  6542. {
  6543. // 验证请求头信息
  6544. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6545. // 验证失败
  6546. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6547. {
  6548. return actionResult;
  6549. }
  6550. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6551. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6552. actionResult.Result = JsonHelper.ToJson(ds);
  6553. actionResult.Status = (int)Constant.PDAResult.Success;
  6554. }
  6555. catch (Exception ex)
  6556. {
  6557. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6558. OutputLog.TraceLog(LogPriority.Error,
  6559. this.ToString(),
  6560. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6561. ex.ToString(),
  6562. LocalPath.LogExePath);
  6563. actionResult.Status = (int)Constant.PDAResult.Exception;
  6564. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6565. }
  6566. return actionResult;
  6567. }
  6568. /// <summary>
  6569. /// 半检检验条码
  6570. /// </summary>
  6571. /// <param name="sUserInfo"></param>
  6572. /// <returns></returns>
  6573. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6574. {
  6575. ActionResult actionResult = new ActionResult();
  6576. try
  6577. {
  6578. // 验证请求头信息
  6579. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6580. // 验证失败
  6581. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6582. {
  6583. return actionResult;
  6584. }
  6585. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6586. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6587. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6588. if (Convert.ToInt32(resultEntity.Result) < 0)
  6589. {
  6590. actionResult.Status = (int)Constant.PDAResult.Fail;
  6591. }
  6592. else
  6593. {
  6594. actionResult.Status = (int)Constant.PDAResult.Success;
  6595. }
  6596. actionResult.Message = resultEntity.Message;
  6597. }
  6598. catch (Exception ex)
  6599. {
  6600. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6601. OutputLog.TraceLog(LogPriority.Error,
  6602. this.ToString(),
  6603. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6604. ex.ToString(),
  6605. LocalPath.LogExePath);
  6606. actionResult.Status = (int)Constant.PDAResult.Exception;
  6607. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6608. }
  6609. return actionResult;
  6610. }
  6611. /// <summary>
  6612. /// 根据条码获取经过的工序,用于绑定返工工序
  6613. /// </summary>
  6614. /// <param name="sUserInfo"></param>
  6615. /// <returns></returns>
  6616. public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6617. {
  6618. ActionResult actionResult = new ActionResult();
  6619. try
  6620. {
  6621. // 验证请求头信息
  6622. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6623. // 验证失败
  6624. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6625. {
  6626. return actionResult;
  6627. }
  6628. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6629. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6630. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6631. actionResult.Status = (int)Constant.PDAResult.Success;
  6632. }
  6633. catch (Exception ex)
  6634. {
  6635. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6636. OutputLog.TraceLog(LogPriority.Error,
  6637. this.ToString(),
  6638. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6639. ex.ToString(),
  6640. LocalPath.LogExePath);
  6641. actionResult.Status = (int)Constant.PDAResult.Exception;
  6642. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6643. }
  6644. return actionResult;
  6645. }
  6646. /// <summary>
  6647. /// 获取登陆帐户有无半检状态权限
  6648. /// </summary>
  6649. /// <param name="sUserInfo"></param>
  6650. /// <returns></returns>
  6651. public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6652. {
  6653. ActionResult actionResult = new ActionResult();
  6654. try
  6655. {
  6656. // 验证请求头信息
  6657. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6658. // 验证失败
  6659. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6660. {
  6661. return actionResult;
  6662. }
  6663. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6664. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6665. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6666. actionResult.Status = (int)Constant.PDAResult.Success;
  6667. }
  6668. catch (Exception ex)
  6669. {
  6670. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6671. OutputLog.TraceLog(LogPriority.Error,
  6672. this.ToString(),
  6673. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6674. ex.ToString(),
  6675. LocalPath.LogExePath);
  6676. actionResult.Status = (int)Constant.PDAResult.Exception;
  6677. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6678. }
  6679. return actionResult;
  6680. }
  6681. /// <summary>
  6682. /// 复检状态数据源
  6683. /// </summary>
  6684. /// <param name="sUserInfo"></param>
  6685. /// <returns></returns>
  6686. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6687. {
  6688. ActionResult actionResult = new ActionResult();
  6689. try
  6690. {
  6691. // 验证请求头信息
  6692. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6693. // 验证失败
  6694. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6695. {
  6696. return actionResult;
  6697. }
  6698. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6699. () => SystemModuleLogic.GetSemiCheckType());
  6700. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6701. actionResult.Status = (int)Constant.PDAResult.Success;
  6702. }
  6703. catch (Exception ex)
  6704. {
  6705. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6706. OutputLog.TraceLog(LogPriority.Error,
  6707. this.ToString(),
  6708. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6709. ex.ToString(),
  6710. LocalPath.LogExePath);
  6711. actionResult.Status = (int)Constant.PDAResult.Exception;
  6712. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6713. }
  6714. return actionResult;
  6715. }
  6716. /// <summary>
  6717. /// 根据半成品检验数据ID,显示半成品数据信息
  6718. /// </summary>
  6719. /// <param name="sUserInfo"></param>
  6720. /// <returns></returns>
  6721. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6722. {
  6723. ActionResult actionResult = new ActionResult();
  6724. try
  6725. {
  6726. // 验证请求头信息
  6727. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6728. // 验证失败
  6729. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6730. {
  6731. return actionResult;
  6732. }
  6733. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6734. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6735. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6736. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6737. {
  6738. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6739. {
  6740. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6741. {
  6742. SemiCheckEntity productionData = new SemiCheckEntity();
  6743. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6744. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6745. {
  6746. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6747. }
  6748. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6749. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6750. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6751. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6752. productionData.ReFine = 0;
  6753. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6754. {
  6755. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6756. }
  6757. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6758. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6759. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6760. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6761. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6762. {
  6763. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6764. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6765. }
  6766. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6767. {
  6768. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6769. }
  6770. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6771. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6772. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6773. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6774. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6775. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6776. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6777. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6778. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6779. {
  6780. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6781. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6782. }
  6783. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6784. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6785. {
  6786. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6787. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6788. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6789. }
  6790. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6791. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6792. {
  6793. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6794. }
  6795. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6796. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6797. DataTable dtDefect = dvDefect.ToTable();
  6798. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6799. {
  6800. // 产品缺陷
  6801. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6802. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6803. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6804. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6805. //{
  6806. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6807. //}
  6808. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6809. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6810. {
  6811. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6812. }
  6813. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6814. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6815. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6816. {
  6817. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6818. }
  6819. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6820. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6821. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6822. {
  6823. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6824. }
  6825. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6826. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6827. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6828. {
  6829. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6830. }
  6831. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6832. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6833. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6834. //{
  6835. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6836. //}
  6837. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6838. //{
  6839. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6840. //}
  6841. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6842. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6843. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6844. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6845. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6846. {
  6847. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6848. }
  6849. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6850. {
  6851. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6852. }
  6853. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6854. //{
  6855. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6856. //}
  6857. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6858. //--------责任员工-------------------
  6859. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6860. if (drRow.Length > Constant.INT_IS_ZERO)
  6861. {
  6862. if (defect.DefectResponsibles == null)
  6863. {
  6864. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6865. }
  6866. foreach (DataRow r in drRow)
  6867. {
  6868. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6869. if (r["SemiCheckDefectID"].ToString() != "")
  6870. {
  6871. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6872. }
  6873. if (r["StaffID"].ToString() != "")
  6874. {
  6875. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6876. }
  6877. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6878. defectResponsible.StaffName = r["StaffName"].ToString();
  6879. if (r["StaffStatus"].ToString() != "")
  6880. {
  6881. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6882. }
  6883. if (r["UJobsID"].ToString() != "")
  6884. {
  6885. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6886. }
  6887. if (r["SJobsID"].ToString() != "")
  6888. {
  6889. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6890. }
  6891. defect.DefectResponsibles.Add(defectResponsible);
  6892. }
  6893. }
  6894. //------------------------------
  6895. if (productionData.SemiCheckDefects == null)
  6896. {
  6897. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6898. }
  6899. productionData.SemiCheckDefects.Add(defect);
  6900. }
  6901. //if (productionDatas.PDAProductionData == null)
  6902. //{
  6903. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6904. //}
  6905. productionDatas[0] = productionData;
  6906. //---------------------------------------------------------------------------------
  6907. }
  6908. }
  6909. }
  6910. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6911. actionResult.Status = (int)Constant.PDAResult.Success;
  6912. }
  6913. catch (Exception ex)
  6914. {
  6915. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6916. OutputLog.TraceLog(LogPriority.Error,
  6917. this.ToString(),
  6918. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6919. ex.ToString(),
  6920. LocalPath.LogExePath);
  6921. actionResult.Status = (int)Constant.PDAResult.Exception;
  6922. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6923. }
  6924. return actionResult;
  6925. }
  6926. /// <summary>
  6927. /// 保存半检登记
  6928. /// </summary>
  6929. /// <param name="accountCode">帐套code</param>
  6930. /// <param name="userCode">用户code</param>
  6931. /// <param name="userPassword">用户密码</param>
  6932. /// <param name="sessionKey">本次登陆密钥</param>
  6933. /// <param name="entity">半检实体类</param>
  6934. /// <param name="sUserInfo">用户基本信息</param>
  6935. /// <returns></returns>
  6936. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6937. {
  6938. ActionResult actionResult = new ActionResult();
  6939. try
  6940. {
  6941. // 验证请求头信息
  6942. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6943. // 验证失败
  6944. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6945. {
  6946. return actionResult;
  6947. }
  6948. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6949. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6950. string err = string.Empty;
  6951. err = resultEntity.Message;
  6952. if (err == null)
  6953. {
  6954. err = "";
  6955. }
  6956. SemiCheckEntity entity = entityobj[0];
  6957. if (entity.SemiCheckCategory == 1) // 半检登记
  6958. {
  6959. }
  6960. else if (entity.SemiCheckCategory == 2)// 复检登记
  6961. {
  6962. err = JsonHelper.ToJson(err);
  6963. }
  6964. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6965. {
  6966. err = JsonHelper.ToJson(err);
  6967. }
  6968. //actionResult.Result = JsonHelper.ToJson(err);
  6969. actionResult.Result = err;//JsonHelper.ToJson(err);
  6970. actionResult.Status = (int)Constant.PDAResult.Success;
  6971. }
  6972. catch (Exception ex)
  6973. {
  6974. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6975. OutputLog.TraceLog(LogPriority.Error,
  6976. this.ToString(),
  6977. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6978. ex.ToString(),
  6979. LocalPath.LogExePath);
  6980. actionResult.Status = (int)Constant.PDAResult.Exception;
  6981. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6982. }
  6983. return actionResult;
  6984. }
  6985. /// <summary>
  6986. /// 根据所选工号,查出缺陷责任员工
  6987. /// </summary>
  6988. /// <param name="sUserInfo"></param>
  6989. /// <returns></returns>
  6990. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6991. {
  6992. ActionResult actionResult = new ActionResult();
  6993. try
  6994. {
  6995. // 验证请求头信息
  6996. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6997. // 验证失败
  6998. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6999. {
  7000. return actionResult;
  7001. }
  7002. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7003. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  7004. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7005. actionResult.Status = (int)Constant.PDAResult.Success;
  7006. }
  7007. catch (Exception ex)
  7008. {
  7009. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7010. OutputLog.TraceLog(LogPriority.Error,
  7011. this.ToString(),
  7012. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7013. ex.ToString(),
  7014. LocalPath.LogExePath);
  7015. actionResult.Status = (int)Constant.PDAResult.Exception;
  7016. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7017. }
  7018. return actionResult;
  7019. }
  7020. /// <summary>
  7021. /// 获取半成品缺陷管理的全部数据
  7022. /// </summary>
  7023. /// <param name="sUserInfo"></param>
  7024. /// <returns></returns>
  7025. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  7026. {
  7027. ActionResult actionResult = new ActionResult();
  7028. try
  7029. {
  7030. // 验证请求头信息
  7031. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7032. // 验证失败
  7033. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7034. {
  7035. return actionResult;
  7036. }
  7037. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7038. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  7039. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7040. actionResult.Status = (int)Constant.PDAResult.Success;
  7041. }
  7042. catch (Exception ex)
  7043. {
  7044. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7045. OutputLog.TraceLog(LogPriority.Error,
  7046. this.ToString(),
  7047. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7048. ex.ToString(),
  7049. LocalPath.LogExePath);
  7050. actionResult.Status = (int)Constant.PDAResult.Exception;
  7051. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7052. }
  7053. return actionResult;
  7054. }
  7055. /// <summary>
  7056. /// 获取PLC参数
  7057. /// </summary>
  7058. /// <param name="sUserInfo"></param>
  7059. /// <returns></returns>
  7060. public ActionResult GetPLCParameter(string accountCode, string userCode, string userPassword, string sessionKey, string PlcName)
  7061. {
  7062. ActionResult actionResult = new ActionResult();
  7063. try
  7064. {
  7065. // 验证请求头信息
  7066. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7067. // 验证失败
  7068. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7069. {
  7070. return actionResult;
  7071. }
  7072. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7073. () => SystemModuleLogic.GetPLCParameter(PlcName));
  7074. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7075. actionResult.Status = (int)Constant.PDAResult.Success;
  7076. }
  7077. catch (Exception ex)
  7078. {
  7079. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7080. OutputLog.TraceLog(LogPriority.Error,
  7081. this.ToString(),
  7082. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7083. ex.ToString(),
  7084. LocalPath.LogExePath);
  7085. actionResult.Status = (int)Constant.PDAResult.Exception;
  7086. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7087. }
  7088. return actionResult;
  7089. }
  7090. /// <summary>
  7091. /// 获取产品信息
  7092. /// </summary>
  7093. /// <param name="sUserInfo"></param>
  7094. /// <returns></returns>
  7095. public ActionResult GetGodsParameter(string accountCode, string userCode, string userPassword, string sessionKey, string BarCode)
  7096. {
  7097. ActionResult actionResult = new ActionResult();
  7098. try
  7099. {
  7100. // 验证请求头信息
  7101. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7102. // 验证失败
  7103. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7104. {
  7105. return actionResult;
  7106. }
  7107. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7108. () => SystemModuleLogic.GetGodsParameter(BarCode));
  7109. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7110. actionResult.Status = (int)Constant.PDAResult.Success;
  7111. }
  7112. catch (Exception ex)
  7113. {
  7114. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7115. OutputLog.TraceLog(LogPriority.Error,
  7116. this.ToString(),
  7117. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7118. ex.ToString(),
  7119. LocalPath.LogExePath);
  7120. actionResult.Status = (int)Constant.PDAResult.Exception;
  7121. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7122. }
  7123. return actionResult;
  7124. }
  7125. /// <summary>
  7126. /// 传输PLC产品信息
  7127. /// </summary>
  7128. /// <param name="sUserInfo"></param>
  7129. /// <returns></returns>
  7130. public ActionResult AddPlcGood(string accountCode, string userCode, string userPassword, string sessionKey, string Plcid, string BarCode, string GROUTINGLINECODE, string GOODSMODEL, string GOODSTYPENAME, string GOODSSPECIFICATION)
  7131. {
  7132. ActionResult actionResult = new ActionResult();
  7133. try
  7134. {
  7135. // 验证请求头信息
  7136. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7137. // 验证失败
  7138. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7139. {
  7140. return actionResult;
  7141. }
  7142. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7143. () => SystemModuleLogic.AddPlcGood(Plcid, BarCode, GROUTINGLINECODE, GOODSMODEL, GOODSTYPENAME, GOODSSPECIFICATION));
  7144. actionResult.Result = JsonHelper.ToJson(resultEntity);
  7145. actionResult.Status = (int)Constant.PDAResult.Success;
  7146. }
  7147. catch (Exception ex)
  7148. {
  7149. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7150. OutputLog.TraceLog(LogPriority.Error,
  7151. this.ToString(),
  7152. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7153. ex.ToString(),
  7154. LocalPath.LogExePath);
  7155. actionResult.Status = (int)Constant.PDAResult.Exception;
  7156. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7157. }
  7158. return actionResult;
  7159. }
  7160. /// <summary>
  7161. /// 获取半成品缺陷位置管理的全部数据
  7162. /// </summary>
  7163. /// <param name="sUserInfo"></param>
  7164. /// <returns></returns>
  7165. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  7166. {
  7167. ActionResult actionResult = new ActionResult();
  7168. try
  7169. {
  7170. // 验证请求头信息
  7171. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7172. // 验证失败
  7173. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7174. {
  7175. return actionResult;
  7176. }
  7177. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7178. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  7179. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7180. actionResult.Status = (int)Constant.PDAResult.Success;
  7181. }
  7182. catch (Exception ex)
  7183. {
  7184. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7185. OutputLog.TraceLog(LogPriority.Error,
  7186. this.ToString(),
  7187. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7188. ex.ToString(),
  7189. LocalPath.LogExePath);
  7190. actionResult.Status = (int)Constant.PDAResult.Exception;
  7191. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7192. }
  7193. return actionResult;
  7194. }
  7195. /// <summary>
  7196. /// 复检验条码
  7197. /// </summary>
  7198. /// <param name="sUserInfo"></param>
  7199. /// <returns></returns>
  7200. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7201. {
  7202. ActionResult actionResult = new ActionResult();
  7203. try
  7204. {
  7205. // 验证请求头信息
  7206. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7207. // 验证失败
  7208. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7209. {
  7210. return actionResult;
  7211. }
  7212. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7213. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  7214. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7215. if (Convert.ToInt32(resultEntity.Result) < 0)
  7216. {
  7217. actionResult.Status = (int)Constant.PDAResult.Fail;
  7218. }
  7219. else
  7220. {
  7221. actionResult.Status = (int)Constant.PDAResult.Success;
  7222. }
  7223. actionResult.Message = resultEntity.Message;
  7224. }
  7225. catch (Exception ex)
  7226. {
  7227. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7228. OutputLog.TraceLog(LogPriority.Error,
  7229. this.ToString(),
  7230. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7231. ex.ToString(),
  7232. LocalPath.LogExePath);
  7233. actionResult.Status = (int)Constant.PDAResult.Exception;
  7234. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7235. }
  7236. return actionResult;
  7237. }
  7238. /// <summary>
  7239. /// 撤销复检验条码
  7240. /// </summary>
  7241. /// <param name="sUserInfo"></param>
  7242. /// <returns></returns>
  7243. public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7244. {
  7245. ActionResult actionResult = new ActionResult();
  7246. try
  7247. {
  7248. // 验证请求头信息
  7249. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7250. // 验证失败
  7251. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7252. {
  7253. return actionResult;
  7254. }
  7255. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7256. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  7257. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7258. if (Convert.ToInt32(resultEntity.Result) < 0)
  7259. {
  7260. actionResult.Status = (int)Constant.PDAResult.Fail;
  7261. }
  7262. else
  7263. {
  7264. actionResult.Status = (int)Constant.PDAResult.Success;
  7265. }
  7266. actionResult.Message = resultEntity.Message;
  7267. }
  7268. catch (Exception ex)
  7269. {
  7270. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7271. OutputLog.TraceLog(LogPriority.Error,
  7272. this.ToString(),
  7273. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7274. ex.ToString(),
  7275. LocalPath.LogExePath);
  7276. actionResult.Status = (int)Constant.PDAResult.Exception;
  7277. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7278. }
  7279. return actionResult;
  7280. }
  7281. /// <summary>
  7282. /// 恢复数据
  7283. /// </summary>
  7284. /// <param name="sUserInfo"></param>
  7285. /// <returns></returns>
  7286. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7287. {
  7288. ActionResult actionResult = new ActionResult();
  7289. try
  7290. {
  7291. // 验证请求头信息
  7292. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7293. // 验证失败
  7294. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7295. {
  7296. return actionResult;
  7297. }
  7298. int resultEntity = ServiceInvoker.Invoke<int>(this,
  7299. () => PMModuleLogicDAL.ResetBarCode(barcode));
  7300. if (resultEntity > 0)
  7301. {
  7302. actionResult.Status = (int)Constant.PDAResult.Success;
  7303. actionResult.Message = "恢复数据成功";
  7304. }
  7305. else
  7306. {
  7307. actionResult.Status = (int)Constant.PDAResult.Fail;
  7308. if (resultEntity == -1)
  7309. {
  7310. actionResult.Message = "此条码没有清除,不能恢复";
  7311. }
  7312. else if (resultEntity == 0)
  7313. {
  7314. actionResult.Message = "没有可恢复的数据";
  7315. }
  7316. }
  7317. }
  7318. catch (Exception ex)
  7319. {
  7320. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7321. OutputLog.TraceLog(LogPriority.Error,
  7322. this.ToString(),
  7323. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7324. ex.ToString(),
  7325. LocalPath.LogExePath);
  7326. actionResult.Status = (int)Constant.PDAResult.Exception;
  7327. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7328. }
  7329. return actionResult;
  7330. }
  7331. /// <summary>
  7332. /// 通过SettingCode获取系统参数管理的数据
  7333. /// </summary>
  7334. /// <param name="accountCode"></param>
  7335. /// <param name="userCode"></param>
  7336. /// <param name="userPassword"></param>
  7337. /// <param name="sessionKey"></param>
  7338. /// <param name="settingcode">设置编码</param>
  7339. /// <returns></returns>
  7340. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  7341. {
  7342. ActionResult actionResult = new ActionResult();
  7343. try
  7344. {
  7345. // 验证请求头信息
  7346. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7347. // 验证失败
  7348. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7349. {
  7350. return actionResult;
  7351. }
  7352. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7353. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  7354. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7355. actionResult.Status = (int)Constant.PDAResult.Success;
  7356. }
  7357. catch (Exception ex)
  7358. {
  7359. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7360. OutputLog.TraceLog(LogPriority.Error,
  7361. this.ToString(),
  7362. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7363. ex.ToString(),
  7364. LocalPath.LogExePath);
  7365. actionResult.Status = (int)Constant.PDAResult.Exception;
  7366. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7367. }
  7368. return actionResult;
  7369. }
  7370. /// <summary>
  7371. /// 校验条码是否允许撤销,如果不允许提示错误消息
  7372. /// </summary>
  7373. /// <param name="accountCode"></param>
  7374. /// <param name="userCode"></param>
  7375. /// <param name="userPassword"></param>
  7376. /// <param name="sessionKey"></param>
  7377. /// <param name="orgTime">原时间</param>
  7378. /// <param name="days">允许撤销天数</param>
  7379. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  7380. /// <returns></returns>
  7381. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  7382. {
  7383. ActionResult actionResult = new ActionResult();
  7384. try
  7385. {
  7386. // 验证请求头信息
  7387. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7388. // 验证失败
  7389. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7390. {
  7391. return actionResult;
  7392. }
  7393. string[] subOrgTime = orgTime.Split('-');
  7394. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  7395. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7396. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  7397. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7398. if (Convert.ToInt32(resultEntity.Result) < 0)
  7399. {
  7400. actionResult.Status = (int)Constant.PDAResult.Fail;
  7401. }
  7402. else
  7403. {
  7404. actionResult.Status = (int)Constant.PDAResult.Success;
  7405. }
  7406. actionResult.Message = resultEntity.Message;
  7407. }
  7408. catch (Exception ex)
  7409. {
  7410. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7411. OutputLog.TraceLog(LogPriority.Error,
  7412. this.ToString(),
  7413. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7414. ex.ToString(),
  7415. LocalPath.LogExePath);
  7416. actionResult.Status = (int)Constant.PDAResult.Exception;
  7417. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7418. }
  7419. return actionResult;
  7420. }
  7421. /// <summary>
  7422. /// 获取生产订单管理的全部数据
  7423. /// </summary>
  7424. /// <param name="sUserInfo"></param>
  7425. /// <returns></returns>
  7426. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  7427. {
  7428. ActionResult actionResult = new ActionResult();
  7429. try
  7430. {
  7431. // 验证请求头信息
  7432. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7433. // 验证失败
  7434. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7435. {
  7436. return actionResult;
  7437. }
  7438. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7439. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  7440. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7441. actionResult.Status = (int)Constant.PDAResult.Success;
  7442. }
  7443. catch (Exception ex)
  7444. {
  7445. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7446. OutputLog.TraceLog(LogPriority.Error,
  7447. this.ToString(),
  7448. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7449. ex.ToString(),
  7450. LocalPath.LogExePath);
  7451. actionResult.Status = (int)Constant.PDAResult.Exception;
  7452. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7453. }
  7454. return actionResult;
  7455. }
  7456. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7457. {
  7458. ActionResult actionResult = new ActionResult();
  7459. try
  7460. {
  7461. // 验证请求头信息
  7462. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7463. // 验证失败
  7464. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7465. {
  7466. return actionResult;
  7467. }
  7468. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7469. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  7470. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7471. if (Convert.ToInt32(resultEntity.Result) < 0)
  7472. {
  7473. actionResult.Status = (int)Constant.PDAResult.Fail;
  7474. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  7475. }
  7476. else
  7477. {
  7478. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  7479. actionResult.Status = (int)Constant.PDAResult.Success;
  7480. }
  7481. actionResult.Message = resultEntity.Message;
  7482. }
  7483. catch (Exception ex)
  7484. {
  7485. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7486. OutputLog.TraceLog(LogPriority.Error,
  7487. this.ToString(),
  7488. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7489. ex.ToString(),
  7490. LocalPath.LogExePath);
  7491. actionResult.Status = (int)Constant.PDAResult.Exception;
  7492. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7493. }
  7494. return actionResult;
  7495. }
  7496. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  7497. {
  7498. ActionResult actionResult = new ActionResult();
  7499. try
  7500. {
  7501. // 验证请求头信息
  7502. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7503. // 验证失败
  7504. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7505. {
  7506. return actionResult;
  7507. }
  7508. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7509. () => SystemModuleLogic.GetSystemData(sUserInfo));
  7510. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7511. actionResult.Status = (int)Constant.PDAResult.Success;
  7512. }
  7513. catch (Exception ex)
  7514. {
  7515. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7516. OutputLog.TraceLog(LogPriority.Error,
  7517. this.ToString(),
  7518. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7519. ex.ToString(),
  7520. LocalPath.LogExePath);
  7521. actionResult.Status = (int)Constant.PDAResult.Exception;
  7522. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7523. }
  7524. return actionResult;
  7525. }
  7526. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  7527. {
  7528. ActionResult actionResult = new ActionResult();
  7529. try
  7530. {
  7531. // 验证请求头信息
  7532. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7533. // 验证失败
  7534. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7535. {
  7536. return actionResult;
  7537. }
  7538. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  7539. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7540. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  7541. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7542. if (Convert.ToInt32(resultEntity.Result) < 0)
  7543. {
  7544. actionResult.Status = (int)Constant.PDAResult.Fail;
  7545. }
  7546. else
  7547. {
  7548. actionResult.Status = (int)Constant.PDAResult.Success;
  7549. }
  7550. actionResult.Message = resultEntity.Message;
  7551. }
  7552. catch (Exception ex)
  7553. {
  7554. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7555. OutputLog.TraceLog(LogPriority.Error,
  7556. this.ToString(),
  7557. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7558. ex.ToString(),
  7559. LocalPath.LogExePath);
  7560. actionResult.Status = (int)Constant.PDAResult.Exception;
  7561. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7562. }
  7563. return actionResult;
  7564. }
  7565. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7566. {
  7567. ActionResult actionResult = new ActionResult();
  7568. try
  7569. {
  7570. // 验证请求头信息
  7571. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7572. // 验证失败
  7573. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7574. {
  7575. return actionResult;
  7576. }
  7577. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7578. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7579. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7580. if (Convert.ToInt32(resultEntity.Result) < 0)
  7581. {
  7582. actionResult.Status = (int)Constant.PDAResult.Fail;
  7583. }
  7584. else
  7585. {
  7586. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7587. actionResult.Status = (int)Constant.PDAResult.Success;
  7588. }
  7589. actionResult.Message = resultEntity.Message;
  7590. }
  7591. catch (Exception ex)
  7592. {
  7593. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7594. OutputLog.TraceLog(LogPriority.Error,
  7595. this.ToString(),
  7596. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7597. ex.ToString(),
  7598. LocalPath.LogExePath);
  7599. actionResult.Status = (int)Constant.PDAResult.Exception;
  7600. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7601. }
  7602. return actionResult;
  7603. }
  7604. public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7605. {
  7606. ActionResult actionResult = new ActionResult();
  7607. try
  7608. {
  7609. // 验证请求头信息
  7610. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7611. // 验证失败
  7612. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7613. {
  7614. return actionResult;
  7615. }
  7616. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7617. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7618. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7619. if (Convert.ToInt32(resultEntity.Result) < 0)
  7620. {
  7621. actionResult.Status = (int)Constant.PDAResult.Fail;
  7622. }
  7623. else
  7624. {
  7625. actionResult.Status = (int)Constant.PDAResult.Success;
  7626. }
  7627. actionResult.Message = resultEntity.Message;
  7628. }
  7629. catch (Exception ex)
  7630. {
  7631. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7632. OutputLog.TraceLog(LogPriority.Error,
  7633. this.ToString(),
  7634. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7635. ex.ToString(),
  7636. LocalPath.LogExePath);
  7637. actionResult.Status = (int)Constant.PDAResult.Exception;
  7638. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7639. }
  7640. return actionResult;
  7641. }
  7642. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7643. {
  7644. ActionResult actionResult = new ActionResult();
  7645. try
  7646. {
  7647. // 验证请求头信息
  7648. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7649. // 验证失败
  7650. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7651. {
  7652. return actionResult;
  7653. }
  7654. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7655. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7656. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7657. if (Convert.ToInt32(resultEntity.Result) < 0)
  7658. {
  7659. actionResult.Status = (int)Constant.PDAResult.Fail;
  7660. }
  7661. else
  7662. {
  7663. actionResult.Status = (int)Constant.PDAResult.Success;
  7664. }
  7665. actionResult.Message = resultEntity.Message;
  7666. }
  7667. catch (Exception ex)
  7668. {
  7669. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7670. OutputLog.TraceLog(LogPriority.Error,
  7671. this.ToString(),
  7672. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7673. ex.ToString(),
  7674. LocalPath.LogExePath);
  7675. actionResult.Status = (int)Constant.PDAResult.Exception;
  7676. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7677. }
  7678. return actionResult;
  7679. }
  7680. #region PDA条码打印
  7681. /// <summary>
  7682. /// 获取条码打印机
  7683. /// </summary>
  7684. /// <param name="accountCode"></param>
  7685. /// <param name="userCode"></param>
  7686. /// <param name="userPassword"></param>
  7687. /// <param name="sessionKey"></param>
  7688. /// <returns></returns>
  7689. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printType = 0)
  7690. {
  7691. ActionResult actionResult = new ActionResult();
  7692. try
  7693. {
  7694. // 验证请求头信息
  7695. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7696. // 验证失败
  7697. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7698. {
  7699. return actionResult;
  7700. }
  7701. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType);
  7702. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7703. actionResult.Status = (int)Constant.PDAResult.Success;
  7704. }
  7705. catch (Exception ex)
  7706. {
  7707. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7708. OutputLog.TraceLog(LogPriority.Error,
  7709. this.ToString(),
  7710. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7711. ex.ToString(),
  7712. LocalPath.LogExePath);
  7713. actionResult.Status = (int)Constant.PDAResult.Exception;
  7714. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7715. }
  7716. return actionResult;
  7717. }
  7718. /// <summary>
  7719. /// 打印条码样式(补打)
  7720. /// </summary>
  7721. /// <param name="accountCode"></param>
  7722. /// <param name="userCode"></param>
  7723. /// <param name="userPassword"></param>
  7724. /// <param name="sessionKey"></param>
  7725. /// <returns></returns>
  7726. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey,
  7727. string barcode, int copies, int printerID, int printWay = 2)
  7728. {
  7729. ActionResult actionResult = new ActionResult();
  7730. try
  7731. {
  7732. // 验证请求头信息
  7733. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7734. // 验证失败
  7735. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7736. {
  7737. return actionResult;
  7738. }
  7739. /*if (printWay == 0)
  7740. {
  7741. printWay = 2;
  7742. }*/
  7743. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7744. // copies, printerID, sUserInfo);
  7745. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(barcode,
  7746. copies, printerID, sUserInfo, printWay);
  7747. if (sre.Status != Constant.ServiceResultStatus.Success)
  7748. {
  7749. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7750. actionResult.Message = sre.Message;
  7751. return actionResult;
  7752. }
  7753. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7754. actionResult.Status = (int)Constant.PDAResult.Success;
  7755. }
  7756. catch (Exception ex)
  7757. {
  7758. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7759. OutputLog.TraceLog(LogPriority.Error,
  7760. this.ToString(),
  7761. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7762. ex.ToString(),
  7763. LocalPath.LogExePath);
  7764. actionResult.Status = (int)Constant.PDAResult.Exception;
  7765. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7766. }
  7767. return actionResult;
  7768. }
  7769. #endregion PDA条码打印
  7770. #region 统计报表
  7771. /// <summary>
  7772. /// 成型结算报表
  7773. /// </summary>
  7774. /// <param name="accountCode"></param>
  7775. /// <param name="userCode"></param>
  7776. /// <param name="userPassword"></param>
  7777. /// <param name="sessionKey"></param>
  7778. /// <returns></returns>
  7779. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7780. int currentMonth)
  7781. {
  7782. ActionResult actionResult = new ActionResult();
  7783. try
  7784. {
  7785. // 验证请求头信息
  7786. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7787. // 验证失败
  7788. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7789. {
  7790. return actionResult;
  7791. }
  7792. DateTime date = DateTime.Now;
  7793. if (currentMonth != 1)
  7794. {
  7795. date = date.AddMonths(-1);
  7796. }
  7797. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7798. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7799. if (resultEntity == null || resultEntity.Data == null)
  7800. {
  7801. actionResult.Status = (int)Constant.PDAResult.Fail;
  7802. actionResult.Message = "查询失败";
  7803. return actionResult;
  7804. }
  7805. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7806. {
  7807. actionResult.Status = (int)Constant.PDAResult.Fail;
  7808. actionResult.Message = resultEntity.Message;
  7809. return actionResult;
  7810. }
  7811. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7812. actionResult.Status = (int)Constant.PDAResult.Success;
  7813. }
  7814. catch (Exception ex)
  7815. {
  7816. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7817. OutputLog.TraceLog(LogPriority.Error,
  7818. this.ToString(),
  7819. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7820. ex.ToString(),
  7821. LocalPath.LogExePath);
  7822. actionResult.Status = (int)Constant.PDAResult.Exception;
  7823. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7824. }
  7825. return actionResult;
  7826. }
  7827. #endregion
  7828. #region 设置当期用户默认打印机配置
  7829. /// <summary>
  7830. /// 设置当期用户默认打印机配置
  7831. /// </summary>
  7832. /// <param name="accountCode"></param>
  7833. /// <param name="userCode"></param>
  7834. /// <param name="userPassword"></param>
  7835. /// <param name="sessionKey"></param>
  7836. /// <param name="printerID"></param>
  7837. /// <returns></returns>
  7838. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7839. int printerID)
  7840. {
  7841. ActionResult actionResult = new ActionResult();
  7842. try
  7843. {
  7844. // 验证请求头信息
  7845. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7846. // 验证失败
  7847. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7848. {
  7849. return actionResult;
  7850. }
  7851. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7852. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7853. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7854. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7855. {
  7856. actionResult.Status = (int)Constant.PDAResult.Fail;
  7857. }
  7858. else
  7859. {
  7860. actionResult.Status = (int)Constant.PDAResult.Success;
  7861. }
  7862. actionResult.Message = resultEntity.Message;
  7863. }
  7864. catch (Exception ex)
  7865. {
  7866. OutputLog.TraceLog(LogPriority.Error,
  7867. this.ToString(),
  7868. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7869. ex.ToString(),
  7870. LocalPath.LogExePath);
  7871. actionResult.Status = (int)Constant.PDAResult.Exception;
  7872. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7873. }
  7874. return actionResult;
  7875. }
  7876. /// <summary>
  7877. /// 校验产品条码是否可以进行回收
  7878. /// </summary>
  7879. /// <param name="accountCode">帐套code</param>
  7880. /// <param name="userCode">用户code</param>
  7881. /// <param name="userPassword">用户密码</param>
  7882. /// <param name="sessionKey">本次登陆密钥</param>
  7883. /// <param name="procedureID">工序ID</param>
  7884. /// <param name="barcode">条码</param>
  7885. /// <returns></returns>
  7886. /// <remarks>
  7887. /// 王鑫 2017.7.21 新建
  7888. /// </remarks>
  7889. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7890. {
  7891. ActionResult actionResult = new ActionResult();
  7892. try
  7893. {
  7894. // 验证请求头信息
  7895. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7896. // 验证失败
  7897. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7898. {
  7899. return actionResult;
  7900. }
  7901. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7902. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7903. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7904. {
  7905. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7906. actionResult.Status = (int)Constant.PDAResult.Success;
  7907. }
  7908. else
  7909. {
  7910. actionResult.Status = (int)Constant.PDAResult.Fail;
  7911. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7912. }
  7913. }
  7914. catch (Exception ex)
  7915. {
  7916. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7917. OutputLog.TraceLog(LogPriority.Error,
  7918. this.ToString(),
  7919. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7920. ex.ToString(),
  7921. LocalPath.LogExePath);
  7922. actionResult.Status = (int)Constant.PDAResult.Exception;
  7923. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7924. }
  7925. return actionResult;
  7926. }
  7927. /// <summary>
  7928. /// 获取回收标识
  7929. /// </summary>
  7930. /// <param name="accountCode"></param>
  7931. /// <param name="userCode"></param>
  7932. /// <param name="userPassword"></param>
  7933. /// <param name="sessionKey"></param>
  7934. /// <param name="usercode">工号编码</param>
  7935. /// <returns></returns>
  7936. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7937. {
  7938. ActionResult actionResult = new ActionResult();
  7939. try
  7940. {
  7941. // 验证请求头信息
  7942. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7943. // 验证失败
  7944. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7945. {
  7946. return actionResult;
  7947. }
  7948. int returnValue = ServiceInvoker.Invoke<int>(this,
  7949. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7950. actionResult.Result = JsonHelper.ToJson(returnValue);
  7951. actionResult.Status = (int)Constant.PDAResult.Success;
  7952. }
  7953. catch (Exception ex)
  7954. {
  7955. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7956. OutputLog.TraceLog(LogPriority.Error,
  7957. this.ToString(),
  7958. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7959. ex.ToString(),
  7960. LocalPath.LogExePath);
  7961. actionResult.Status = (int)Constant.PDAResult.Exception;
  7962. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7963. }
  7964. return actionResult;
  7965. }
  7966. #endregion
  7967. #region 注浆盘点
  7968. /// <summary>
  7969. /// 获取注浆盘点单列表
  7970. /// </summary>
  7971. /// <param name="sUserInfo"></param>
  7972. /// <returns></returns>
  7973. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7974. {
  7975. ActionResult actionResult = new ActionResult();
  7976. try
  7977. {
  7978. // 验证请求头信息
  7979. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7980. // 验证失败
  7981. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7982. {
  7983. return actionResult;
  7984. }
  7985. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7986. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7987. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7988. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7989. actionResult.Result = JsonHelper.ToJson(ds);
  7990. actionResult.Status = (int)Constant.PDAResult.Success;
  7991. }
  7992. catch (Exception ex)
  7993. {
  7994. string json = JsonHelper.ToJson(entity);
  7995. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7996. OutputLog.TraceLog(LogPriority.Error,
  7997. this.ToString(),
  7998. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7999. ex.ToString(),
  8000. LocalPath.LogExePath);
  8001. actionResult.Status = (int)Constant.PDAResult.Exception;
  8002. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8003. }
  8004. return actionResult;
  8005. }
  8006. /// <summary>
  8007. /// 进行盘点操作
  8008. /// </summary>
  8009. /// <param name="accountCode"></param>
  8010. /// <param name="userCode"></param>
  8011. /// <param name="userPassword"></param>
  8012. /// <param name="sessionKey"></param>
  8013. /// <param name="InCheckedID">盘点单ID</param>
  8014. /// <param name="BarCode">产品条码</param>
  8015. /// <returns></returns>
  8016. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  8017. {
  8018. ActionResult actionResult = new ActionResult();
  8019. try
  8020. {
  8021. // 验证请求头信息
  8022. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8023. // 验证失败
  8024. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8025. {
  8026. return actionResult;
  8027. }
  8028. ClientRequestEntity cre = new ClientRequestEntity();
  8029. cre.Properties["CheckedID"] = CheckedID;
  8030. cre.Properties["Barcode"] = BarCode;
  8031. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  8032. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  8033. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  8034. {
  8035. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8036. actionResult.Status = (int)Constant.PDAResult.Success;
  8037. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  8038. }
  8039. else
  8040. {
  8041. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8042. actionResult.Status = (int)Constant.PDAResult.Fail;
  8043. actionResult.Message = returnValue.Message;
  8044. }
  8045. }
  8046. catch (Exception ex)
  8047. {
  8048. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8049. OutputLog.TraceLog(LogPriority.Error,
  8050. this.ToString(),
  8051. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8052. ex.ToString(),
  8053. LocalPath.LogExePath);
  8054. actionResult.Status = (int)Constant.PDAResult.Exception;
  8055. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8056. }
  8057. return actionResult;
  8058. }
  8059. /// <summary>
  8060. /// 获取盘点单明细
  8061. /// </summary>
  8062. /// <param name="sUserInfo"></param>
  8063. /// <returns></returns>
  8064. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  8065. {
  8066. ActionResult actionResult = new ActionResult();
  8067. try
  8068. {
  8069. // 验证请求头信息
  8070. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8071. // 验证失败
  8072. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8073. {
  8074. return actionResult;
  8075. }
  8076. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8077. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  8078. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  8079. actionResult.Result = JsonHelper.ToJson(ds);
  8080. actionResult.Status = (int)Constant.PDAResult.Success;
  8081. }
  8082. catch (Exception ex)
  8083. {
  8084. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8085. OutputLog.TraceLog(LogPriority.Error,
  8086. this.ToString(),
  8087. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8088. ex.ToString(),
  8089. LocalPath.LogExePath);
  8090. actionResult.Status = (int)Constant.PDAResult.Exception;
  8091. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8092. }
  8093. return actionResult;
  8094. }
  8095. #endregion
  8096. #region 模具盘点
  8097. /// <summary>
  8098. /// 获取模具盘点单列表
  8099. /// </summary>
  8100. /// <param name="sUserInfo"></param>
  8101. /// <returns></returns>
  8102. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  8103. {
  8104. ActionResult actionResult = new ActionResult();
  8105. try
  8106. {
  8107. // 验证请求头信息
  8108. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8109. // 验证失败
  8110. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8111. {
  8112. return actionResult;
  8113. }
  8114. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  8115. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  8116. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8117. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  8118. actionResult.Result = JsonHelper.ToJson(ds);
  8119. actionResult.Status = (int)Constant.PDAResult.Success;
  8120. }
  8121. catch (Exception ex)
  8122. {
  8123. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8124. OutputLog.TraceLog(LogPriority.Error,
  8125. this.ToString(),
  8126. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8127. ex.ToString(),
  8128. LocalPath.LogExePath);
  8129. actionResult.Status = (int)Constant.PDAResult.Exception;
  8130. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8131. }
  8132. return actionResult;
  8133. }
  8134. /// <summary>
  8135. /// 进行盘点操作
  8136. /// </summary>
  8137. /// <param name="accountCode"></param>
  8138. /// <param name="userCode"></param>
  8139. /// <param name="userPassword"></param>
  8140. /// <param name="sessionKey"></param>
  8141. /// <param name="InCheckedID">盘点单ID</param>
  8142. /// <param name="BarCode">产品条码</param>
  8143. /// <returns></returns>
  8144. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  8145. {
  8146. ActionResult actionResult = new ActionResult();
  8147. try
  8148. {
  8149. // 验证请求头信息
  8150. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8151. // 验证失败
  8152. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8153. {
  8154. return actionResult;
  8155. }
  8156. ClientRequestEntity cre = new ClientRequestEntity();
  8157. cre.Properties["CheckedID"] = CheckedID;
  8158. cre.Properties["Barcode"] = BarCode;
  8159. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  8160. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  8161. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  8162. {
  8163. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8164. actionResult.Status = (int)Constant.PDAResult.Success;
  8165. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  8166. }
  8167. else
  8168. {
  8169. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8170. actionResult.Status = (int)Constant.PDAResult.Fail;
  8171. actionResult.Message = returnValue.Message;
  8172. }
  8173. }
  8174. catch (Exception ex)
  8175. {
  8176. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8177. OutputLog.TraceLog(LogPriority.Error,
  8178. this.ToString(),
  8179. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8180. ex.ToString(),
  8181. LocalPath.LogExePath);
  8182. actionResult.Status = (int)Constant.PDAResult.Exception;
  8183. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8184. }
  8185. return actionResult;
  8186. }
  8187. /// <summary>
  8188. /// 获取盘点单明细
  8189. /// </summary>
  8190. /// <param name="sUserInfo"></param>
  8191. /// <returns></returns>
  8192. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  8193. {
  8194. ActionResult actionResult = new ActionResult();
  8195. try
  8196. {
  8197. // 验证请求头信息
  8198. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8199. // 验证失败
  8200. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8201. {
  8202. return actionResult;
  8203. }
  8204. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8205. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  8206. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  8207. actionResult.Result = JsonHelper.ToJson(ds);
  8208. actionResult.Status = (int)Constant.PDAResult.Success;
  8209. }
  8210. catch (Exception ex)
  8211. {
  8212. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8213. OutputLog.TraceLog(LogPriority.Error,
  8214. this.ToString(),
  8215. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8216. ex.ToString(),
  8217. LocalPath.LogExePath);
  8218. actionResult.Status = (int)Constant.PDAResult.Exception;
  8219. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8220. }
  8221. return actionResult;
  8222. }
  8223. #endregion
  8224. #region 通用接口
  8225. /// <summary>
  8226. /// PDA调用通用接口
  8227. /// </summary>
  8228. /// <param name="accountCode"></param>
  8229. /// <param name="userCode"></param>
  8230. /// <param name="userPassword"></param>
  8231. /// <param name="sessionKey"></param>
  8232. /// <param name="module"></param>
  8233. /// <param name="action"></param>
  8234. /// <param name="data"></param>
  8235. /// <returns></returns>
  8236. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  8237. string module, string action, string jsonData)
  8238. {
  8239. ActionResult actionResult = null;
  8240. try
  8241. {
  8242. // 验证请求头信息
  8243. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8244. // 验证失败
  8245. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8246. {
  8247. return actionResult;
  8248. }
  8249. actionResult.Status = (int)Constant.PDAResult.Fail;
  8250. Dictionary<string, object> data = null;
  8251. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  8252. {
  8253. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  8254. }
  8255. #region PDA报表
  8256. if (module == "Report")
  8257. {
  8258. // 成型月度结算
  8259. if (action == "GetGroutingSettlementInfo")
  8260. {
  8261. DateTime month = DateTime.Now;
  8262. month = new DateTime(month.Year, month.Month, 1);
  8263. //month = new DateTime(2017, 6, 1);
  8264. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  8265. if (currentMonth != 1)
  8266. {
  8267. month = month.AddMonths(-1);
  8268. }
  8269. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  8270. if (sre.Status == Constant.ServiceResultStatus.Success)
  8271. {
  8272. actionResult.Status = (int)Constant.PDAResult.Success;
  8273. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8274. }
  8275. else
  8276. {
  8277. actionResult.Status = (int)Constant.PDAResult.Fail;
  8278. actionResult.Message = sre.Message;
  8279. }
  8280. return actionResult;
  8281. }
  8282. // 成型月度结算-明细
  8283. if (action == "GetGroutingSettlementDetail")
  8284. {
  8285. DateTime month = DateTime.Now;
  8286. month = new DateTime(month.Year, month.Month, 1);
  8287. //month = new DateTime(2017, 6, 1);
  8288. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  8289. if (currentMonth != 1)
  8290. {
  8291. month = month.AddMonths(-1);
  8292. }
  8293. string goodsCode = data["GoodsCode"].ToString();
  8294. string detailDate = data["DetailDate"].ToString();
  8295. DateTime? date = null;
  8296. if (detailDate != "合计")
  8297. {
  8298. date = DateTime.Parse(detailDate);
  8299. }
  8300. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  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. // 产成品交接汇总
  8314. if (action == "GetFinishedProductHandoverSum")
  8315. {
  8316. DateTime date = DateTime.Parse(data["date"].ToString());
  8317. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  8318. data["goodscode"] as string, sUserInfo);
  8319. if (sre.Status == Constant.ServiceResultStatus.Success)
  8320. {
  8321. actionResult.Status = (int)Constant.PDAResult.Success;
  8322. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8323. }
  8324. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  8325. {
  8326. actionResult.Status = (int)Constant.PDAResult.Success;
  8327. }
  8328. else
  8329. {
  8330. actionResult.Status = (int)Constant.PDAResult.Fail;
  8331. actionResult.Message = sre.Message;
  8332. }
  8333. return actionResult;
  8334. }
  8335. //xuwei add 2019-10-21
  8336. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  8337. if (action == "GetSemiReworkDayCount")
  8338. {
  8339. //不指定参数查询当天
  8340. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  8341. //dateStr = "2019-10-17";
  8342. //指定参数查询特定日期
  8343. if (data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  8344. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  8345. if (sre.Status == Constant.ServiceResultStatus.Success)
  8346. {
  8347. actionResult.Status = (int)Constant.PDAResult.Success;
  8348. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8349. }
  8350. else
  8351. {
  8352. actionResult.Status = (int)Constant.PDAResult.Fail;
  8353. actionResult.Message = sre.Message;
  8354. }
  8355. return actionResult;
  8356. }
  8357. //xuwe end
  8358. return actionResult;
  8359. }
  8360. #endregion
  8361. #region 模具管理
  8362. if (module == "PC_Mould")
  8363. {
  8364. #region 模具新建画面数据初始化
  8365. if (action == "GetMouldAddInit")
  8366. {
  8367. ClientRequestEntity cre = new ClientRequestEntity();
  8368. cre.Properties["MouldID"] = 0;
  8369. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  8370. if (sre.Status == Constant.ServiceResultStatus.Success)
  8371. {
  8372. actionResult.Status = (int)Constant.PDAResult.Success;
  8373. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8374. }
  8375. else
  8376. {
  8377. actionResult.Status = (int)Constant.PDAResult.Fail;
  8378. actionResult.Message = sre.Message;
  8379. }
  8380. return actionResult;
  8381. }
  8382. #endregion
  8383. #region 验证模具产品型号
  8384. if (action == "CheckGoodsCodeOnMould")
  8385. {
  8386. ClientRequestEntity cre = new ClientRequestEntity();
  8387. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8388. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  8389. if (sre.Status == Constant.ServiceResultStatus.Success &&
  8390. sre.Data.Tables[0].Rows.Count > 0)
  8391. {
  8392. actionResult.Status = (int)Constant.PDAResult.Success;
  8393. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8394. }
  8395. else
  8396. {
  8397. actionResult.Status = (int)Constant.PDAResult.Fail;
  8398. actionResult.Message = "无效产品型号";
  8399. }
  8400. return actionResult;
  8401. }
  8402. #endregion
  8403. #region 验证模具生产工号
  8404. if (action == "CheckUserCodeOnMould")
  8405. {
  8406. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  8407. if (sre != null && sre.Rows.Count > 0)
  8408. {
  8409. actionResult.Status = (int)Constant.PDAResult.Success;
  8410. actionResult.Result = JsonHelper.ToJson(sre);
  8411. }
  8412. else
  8413. {
  8414. actionResult.Status = (int)Constant.PDAResult.Fail;
  8415. actionResult.Message = "无效生产工号";
  8416. }
  8417. return actionResult;
  8418. }
  8419. #endregion
  8420. #region 新建保存
  8421. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  8422. {
  8423. ClientRequestEntity cre = new ClientRequestEntity();
  8424. foreach (string item in data.Keys)
  8425. {
  8426. if (item == "ProductionDate")
  8427. {
  8428. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  8429. }
  8430. else
  8431. {
  8432. cre.Properties.Add(item, data[item]);
  8433. }
  8434. }
  8435. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  8436. if (sre.Status == Constant.ServiceResultStatus.Success)
  8437. {
  8438. actionResult.Status = (int)Constant.PDAResult.Success;
  8439. }
  8440. else
  8441. {
  8442. actionResult.Status = (int)Constant.PDAResult.Fail;
  8443. actionResult.Result = sre.OtherStatus;
  8444. actionResult.Message = sre.Message;
  8445. }
  8446. return actionResult;
  8447. }
  8448. #endregion
  8449. #region 模具编辑画面数据初始化
  8450. if (action == "GetMouldEditInfo")
  8451. {
  8452. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  8453. if (sre != null && sre.Rows.Count > 0)
  8454. {
  8455. actionResult.Status = (int)Constant.PDAResult.Success;
  8456. actionResult.Result = JsonHelper.ToJson(sre);
  8457. }
  8458. else
  8459. {
  8460. actionResult.Status = (int)Constant.PDAResult.Fail;
  8461. actionResult.Message = "无效模具条码";
  8462. }
  8463. return actionResult;
  8464. }
  8465. #endregion
  8466. #region 模具操作-画面初始化
  8467. if (action == "GetMouldOperationInit")
  8468. {
  8469. ClientRequestEntity cre = new ClientRequestEntity();
  8470. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8471. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8472. if (sre.Status == Constant.ServiceResultStatus.Success)
  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 = sre.OtherStatus;
  8481. actionResult.Message = sre.Message;
  8482. }
  8483. return actionResult;
  8484. }
  8485. #endregion
  8486. #region 模具操作-验证模具条码
  8487. if (action == "CheckMouldBarcode")
  8488. {
  8489. ClientRequestEntity cre = new ClientRequestEntity();
  8490. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8491. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8492. if (sre.Status == Constant.ServiceResultStatus.Success)
  8493. {
  8494. if (sre.Data.Tables[0].Rows.Count == 0)
  8495. {
  8496. actionResult.Status = (int)Constant.PDAResult.Fail;
  8497. actionResult.Result = -1;
  8498. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8499. return actionResult;
  8500. }
  8501. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8502. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8503. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8504. #region 报损
  8505. if (mouldOperationType == 2)
  8506. {
  8507. if (mouldStatusID == 1 || mouldStatusID == 3)
  8508. {
  8509. actionResult.Status = (int)Constant.PDAResult.Success;
  8510. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8511. }
  8512. else
  8513. {
  8514. actionResult.Status = (int)Constant.PDAResult.Fail;
  8515. actionResult.Result = -2;
  8516. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8517. }
  8518. return actionResult;
  8519. }
  8520. #endregion
  8521. #region 撤销
  8522. if (mouldOperationType == 3)
  8523. {
  8524. if (mouldStatusID == 4)
  8525. {
  8526. actionResult.Status = (int)Constant.PDAResult.Success;
  8527. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8528. }
  8529. else
  8530. {
  8531. actionResult.Status = (int)Constant.PDAResult.Fail;
  8532. actionResult.Result = -2;
  8533. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  8534. }
  8535. return actionResult;
  8536. }
  8537. #endregion
  8538. #region 领用
  8539. if (mouldOperationType == 4)
  8540. {
  8541. if (mouldStatusID == 1)
  8542. {
  8543. actionResult.Status = (int)Constant.PDAResult.Success;
  8544. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8545. }
  8546. else
  8547. {
  8548. actionResult.Status = (int)Constant.PDAResult.Fail;
  8549. actionResult.Result = -2;
  8550. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  8551. }
  8552. return actionResult;
  8553. }
  8554. #endregion
  8555. #region 回收
  8556. if (mouldOperationType == 5)
  8557. {
  8558. if (mouldStatusID == 3)
  8559. {
  8560. actionResult.Status = (int)Constant.PDAResult.Success;
  8561. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8562. }
  8563. else
  8564. {
  8565. actionResult.Status = (int)Constant.PDAResult.Fail;
  8566. actionResult.Result = -2;
  8567. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  8568. }
  8569. return actionResult;
  8570. }
  8571. #endregion
  8572. #region 变更型号
  8573. if (mouldOperationType == -1)
  8574. {
  8575. if (mouldStatusID != 4)
  8576. {
  8577. actionResult.Status = (int)Constant.PDAResult.Success;
  8578. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8579. }
  8580. else
  8581. {
  8582. actionResult.Status = (int)Constant.PDAResult.Fail;
  8583. actionResult.Result = -2;
  8584. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  8585. }
  8586. return actionResult;
  8587. }
  8588. #endregion
  8589. #region 替换条码
  8590. if (mouldOperationType == -2)
  8591. {
  8592. actionResult.Status = (int)Constant.PDAResult.Success;
  8593. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8594. return actionResult;
  8595. }
  8596. #endregion
  8597. return actionResult;
  8598. }
  8599. }
  8600. #endregion
  8601. #region 模具操作-保存
  8602. if (action == "SetMouldOperation")
  8603. {
  8604. ClientRequestEntity cre = new ClientRequestEntity();
  8605. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8606. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8607. cre.Properties["Remarks"] = data["Remarks"];
  8608. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8609. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8610. {
  8611. cre.Properties["GoodsID"] = data["GoodsID"];
  8612. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8613. }
  8614. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8615. {
  8616. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8617. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8618. }
  8619. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8620. if (sre.Status == Constant.ServiceResultStatus.Success)
  8621. {
  8622. actionResult.Status = (int)Constant.PDAResult.Success;
  8623. }
  8624. else
  8625. {
  8626. actionResult.Status = (int)Constant.PDAResult.Fail;
  8627. }
  8628. return actionResult;
  8629. }
  8630. #endregion
  8631. #region 模具操作-替换条码
  8632. if (action == "ChangedMouldBarcode")
  8633. {
  8634. ClientRequestEntity cre = new ClientRequestEntity();
  8635. cre.Properties["MouldID"] = data["MouldID"];
  8636. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8637. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8638. cre.Properties["Remarks"] = data["Remarks"];
  8639. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8640. if (sre.Status == Constant.ServiceResultStatus.Success)
  8641. {
  8642. actionResult.Status = (int)Constant.PDAResult.Success;
  8643. }
  8644. else
  8645. {
  8646. actionResult.Status = (int)Constant.PDAResult.Fail;
  8647. actionResult.Result = sre.OtherStatus;
  8648. actionResult.Message = sre.Message;
  8649. }
  8650. return actionResult;
  8651. }
  8652. #endregion
  8653. #region 模具跟踪表
  8654. if (action == "GetMoldTracking")
  8655. {
  8656. ClientRequestEntity cre = new ClientRequestEntity();
  8657. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8658. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8659. if (sre.Status == Constant.ServiceResultStatus.Success)
  8660. {
  8661. actionResult.Status = (int)Constant.PDAResult.Success;
  8662. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8663. }
  8664. else
  8665. {
  8666. actionResult.Status = (int)Constant.PDAResult.Fail;
  8667. actionResult.Message = "此模具条码不存在";
  8668. }
  8669. return actionResult;
  8670. }
  8671. #endregion
  8672. return actionResult;
  8673. }
  8674. #endregion
  8675. #region 成型线模具管理
  8676. if (module == "PC_GroutingLineMould")
  8677. {
  8678. #region 获取当前用户成型线模具管理权限
  8679. if (action == "GetGMouldStatusRight")
  8680. {
  8681. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8682. actionResult.Status = (int)Constant.PDAResult.Success;
  8683. if (right != null && right.Rows.Count > 0)
  8684. {
  8685. actionResult.Result = JsonHelper.ToJson(right);
  8686. }
  8687. return actionResult;
  8688. }
  8689. #endregion
  8690. #region 获取成型线状态等信息,和成型模具信息
  8691. if (action == "GetGroutingLineMould")
  8692. {
  8693. int? groutingLineID = null;
  8694. string groutingLineCode = null;
  8695. if (data.ContainsKey("GroutingLineID"))
  8696. {
  8697. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8698. }
  8699. else
  8700. {
  8701. groutingLineCode = data["GroutingLineCode"] + "";
  8702. }
  8703. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8704. if (lineInfo == null)
  8705. {
  8706. actionResult.Status = (int)Constant.PDAResult.Fail;
  8707. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8708. }
  8709. else
  8710. {
  8711. actionResult.Status = (int)Constant.PDAResult.Success;
  8712. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8713. }
  8714. return actionResult;
  8715. }
  8716. #endregion
  8717. #region 模具操作-画面初始化
  8718. if (action == "GetMouldOperationInit")
  8719. {
  8720. ClientRequestEntity cre = new ClientRequestEntity();
  8721. cre.Properties["MouldOperationType"] = 2;
  8722. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8723. if (sre.Status == Constant.ServiceResultStatus.Success)
  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 = sre.OtherStatus;
  8732. actionResult.Message = sre.Message;
  8733. }
  8734. return actionResult;
  8735. }
  8736. #endregion
  8737. #region 成型模具操作-画面初始化
  8738. if (action == "GetGroutingMouldOperationInit")
  8739. {
  8740. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8741. if (initData != null && initData.Rows.Count > 0)
  8742. {
  8743. actionResult.Status = (int)Constant.PDAResult.Success;
  8744. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8745. foreach (DataRow item in initData.Rows)
  8746. {
  8747. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8748. }
  8749. actionResult.Result = JsonHelper.ToJson(syssetting);
  8750. }
  8751. else
  8752. {
  8753. actionResult.Status = (int)Constant.PDAResult.Fail;
  8754. }
  8755. return actionResult;
  8756. }
  8757. #endregion
  8758. #region 模具操作-验证模具条码
  8759. if (action == "CheckMouldBarcode")
  8760. {
  8761. ClientRequestEntity cre = new ClientRequestEntity();
  8762. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8763. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8764. if (sre.Status == Constant.ServiceResultStatus.Success)
  8765. {
  8766. if (sre.Data.Tables[0].Rows.Count == 0)
  8767. {
  8768. actionResult.Status = (int)Constant.PDAResult.Fail;
  8769. actionResult.Result = -1;
  8770. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8771. return actionResult;
  8772. }
  8773. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8774. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8775. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8776. #region 上线
  8777. if (mouldOperationType == 6)
  8778. {
  8779. if (mouldStatusID == 1 || mouldStatusID == 3)
  8780. {
  8781. if (data.ContainsKey("GoodsID"))
  8782. {
  8783. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8784. {
  8785. actionResult.Status = (int)Constant.PDAResult.Fail;
  8786. actionResult.Result = -3;
  8787. actionResult.Message =
  8788. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8789. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8790. "】与当前不一致";
  8791. return actionResult;
  8792. }
  8793. }
  8794. actionResult.Status = (int)Constant.PDAResult.Success;
  8795. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8796. }
  8797. else
  8798. {
  8799. actionResult.Status = (int)Constant.PDAResult.Fail;
  8800. actionResult.Result = -2;
  8801. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8802. }
  8803. return actionResult;
  8804. }
  8805. #endregion
  8806. return actionResult;
  8807. }
  8808. }
  8809. #endregion
  8810. #region 停用
  8811. if (action == "StopGroutingLineDetail")
  8812. {
  8813. if (data == null || !data.ContainsKey("Details"))
  8814. {
  8815. actionResult.Status = (int)Constant.PDAResult.Fail;
  8816. actionResult.Message = "参数错误";
  8817. return actionResult;
  8818. }
  8819. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8820. DataTable gTable = new DataTable();
  8821. gTable.Columns.Add("GroutingLineID", typeof(int));
  8822. gTable.Columns.Add("GroutingLineCode");
  8823. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8824. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8825. gTable.Columns.Add("GroutingMouldCode");
  8826. gTable.Columns.Add("RecordRemarks");
  8827. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8828. gTable.Columns.Add("MouldID", typeof(int));
  8829. gTable.Columns.Add("MouldCode");
  8830. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8831. string groutingLineCode = data["GroutingLineCode"] + "";
  8832. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8833. foreach (Dictionary<string, object> item in details)
  8834. {
  8835. int? mouldID = null;
  8836. if (item.ContainsKey("MouldID"))
  8837. {
  8838. mouldID = Convert.ToInt32(item["MouldID"]);
  8839. if (mouldID == 0)
  8840. {
  8841. mouldID = null;
  8842. }
  8843. }
  8844. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8845. item["GLineDetailID"], item["GLineDetailCode"],
  8846. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8847. mouldID, item["MouldCode"]);
  8848. }
  8849. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8850. if (result > 0)
  8851. {
  8852. actionResult.Status = (int)Constant.PDAResult.Success;
  8853. }
  8854. else
  8855. {
  8856. actionResult.Status = (int)Constant.PDAResult.Fail;
  8857. actionResult.Result = result;
  8858. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8859. return actionResult;
  8860. }
  8861. return actionResult;
  8862. }
  8863. #endregion
  8864. #region 启用
  8865. if (action == "StartGroutingLineDetail")
  8866. {
  8867. if (data == null || !data.ContainsKey("Details"))
  8868. {
  8869. actionResult.Status = (int)Constant.PDAResult.Fail;
  8870. actionResult.Message = "参数错误";
  8871. return actionResult;
  8872. }
  8873. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8874. DataTable gTable = new DataTable();
  8875. gTable.Columns.Add("GroutingLineID", typeof(int));
  8876. gTable.Columns.Add("GroutingLineCode");
  8877. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8878. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8879. gTable.Columns.Add("GroutingMouldCode");
  8880. gTable.Columns.Add("RecordRemarks");
  8881. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8882. gTable.Columns.Add("MouldID", typeof(int));
  8883. gTable.Columns.Add("MouldCode");
  8884. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8885. string groutingLineCode = data["GroutingLineCode"] + "";
  8886. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8887. foreach (Dictionary<string, object> item in details)
  8888. {
  8889. int? mouldID = null;
  8890. if (item.ContainsKey("MouldID"))
  8891. {
  8892. mouldID = Convert.ToInt32(item["MouldID"]);
  8893. if (mouldID == 0)
  8894. {
  8895. mouldID = null;
  8896. }
  8897. }
  8898. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8899. item["GLineDetailID"], item["GLineDetailCode"],
  8900. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8901. mouldID, item["MouldCode"]);
  8902. }
  8903. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8904. if (result > 0)
  8905. {
  8906. actionResult.Status = (int)Constant.PDAResult.Success;
  8907. }
  8908. else
  8909. {
  8910. actionResult.Status = (int)Constant.PDAResult.Fail;
  8911. actionResult.Result = result;
  8912. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8913. return actionResult;
  8914. }
  8915. return actionResult;
  8916. }
  8917. #endregion
  8918. #region 维修
  8919. if (action == "RepairStartGroutingLineDetail")
  8920. {
  8921. if (data == null || !data.ContainsKey("Details"))
  8922. {
  8923. actionResult.Status = (int)Constant.PDAResult.Fail;
  8924. actionResult.Message = "参数错误";
  8925. return actionResult;
  8926. }
  8927. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8928. DataTable gTable = new DataTable();
  8929. gTable.Columns.Add("GroutingLineID", typeof(int));
  8930. gTable.Columns.Add("GroutingLineCode");
  8931. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8932. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8933. gTable.Columns.Add("GroutingMouldCode");
  8934. gTable.Columns.Add("RecordRemarks");
  8935. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8936. gTable.Columns.Add("MouldID", typeof(int));
  8937. gTable.Columns.Add("MouldCode");
  8938. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8939. string groutingLineCode = data["GroutingLineCode"] + "";
  8940. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8941. foreach (Dictionary<string, object> item in details)
  8942. {
  8943. int? mouldID = null;
  8944. if (item.ContainsKey("MouldID"))
  8945. {
  8946. mouldID = Convert.ToInt32(item["MouldID"]);
  8947. if (mouldID == 0)
  8948. {
  8949. mouldID = null;
  8950. }
  8951. }
  8952. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8953. item["GLineDetailID"], item["GLineDetailCode"],
  8954. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8955. mouldID, item["MouldCode"]);
  8956. }
  8957. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8958. if (result > 0)
  8959. {
  8960. actionResult.Status = (int)Constant.PDAResult.Success;
  8961. }
  8962. else
  8963. {
  8964. actionResult.Status = (int)Constant.PDAResult.Fail;
  8965. actionResult.Result = result;
  8966. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8967. return actionResult;
  8968. }
  8969. return actionResult;
  8970. }
  8971. #endregion
  8972. #region 结束维修
  8973. if (action == "RepairEndGroutingLineDetail")
  8974. {
  8975. if (data == null || !data.ContainsKey("Details"))
  8976. {
  8977. actionResult.Status = (int)Constant.PDAResult.Fail;
  8978. actionResult.Message = "参数错误";
  8979. return actionResult;
  8980. }
  8981. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8982. DataTable gTable = new DataTable();
  8983. gTable.Columns.Add("GroutingLineID", typeof(int));
  8984. gTable.Columns.Add("GroutingLineCode");
  8985. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8986. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8987. gTable.Columns.Add("GroutingMouldCode");
  8988. gTable.Columns.Add("RecordRemarks");
  8989. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8990. gTable.Columns.Add("MouldID", typeof(int));
  8991. gTable.Columns.Add("MouldCode");
  8992. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8993. string groutingLineCode = data["GroutingLineCode"] + "";
  8994. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8995. foreach (Dictionary<string, object> item in details)
  8996. {
  8997. int? mouldID = null;
  8998. if (item.ContainsKey("MouldID"))
  8999. {
  9000. mouldID = Convert.ToInt32(item["MouldID"]);
  9001. if (mouldID == 0)
  9002. {
  9003. mouldID = null;
  9004. }
  9005. }
  9006. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9007. item["GLineDetailID"], item["GLineDetailCode"],
  9008. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9009. mouldID, item["MouldCode"]);
  9010. }
  9011. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  9012. if (result > 0)
  9013. {
  9014. actionResult.Status = (int)Constant.PDAResult.Success;
  9015. }
  9016. else
  9017. {
  9018. actionResult.Status = (int)Constant.PDAResult.Fail;
  9019. actionResult.Result = result;
  9020. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9021. return actionResult;
  9022. }
  9023. return actionResult;
  9024. }
  9025. #endregion
  9026. #region 换模
  9027. if (action == "ChangeGMouldStartGroutingLineDetail")
  9028. {
  9029. if (data == null || !data.ContainsKey("Details"))
  9030. {
  9031. actionResult.Status = (int)Constant.PDAResult.Fail;
  9032. actionResult.Message = "参数错误";
  9033. return actionResult;
  9034. }
  9035. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9036. DataTable gTable = new DataTable();
  9037. gTable.Columns.Add("GroutingLineID", typeof(int));
  9038. gTable.Columns.Add("GroutingLineCode");
  9039. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9040. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9041. gTable.Columns.Add("GroutingMouldCode");
  9042. gTable.Columns.Add("RecordRemarks");
  9043. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9044. gTable.Columns.Add("MouldID", typeof(int));
  9045. gTable.Columns.Add("MouldCode");
  9046. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9047. gTable.Columns.Add("MouldStatus", typeof(int));
  9048. gTable.Columns.Add("ScrapReason", typeof(int));
  9049. gTable.Columns.Add("ScrapResponsibility");
  9050. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9051. string groutingLineCode = data["GroutingLineCode"] + "";
  9052. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9053. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9054. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9055. string scrapResponsibility = data["ScrapRemarks"] + "";
  9056. foreach (Dictionary<string, object> item in details)
  9057. {
  9058. int? mouldID = null;
  9059. if (item.ContainsKey("MouldID"))
  9060. {
  9061. mouldID = Convert.ToInt32(item["MouldID"]);
  9062. if (mouldID == 0)
  9063. {
  9064. mouldID = null;
  9065. }
  9066. }
  9067. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9068. item["GLineDetailID"], item["GLineDetailCode"],
  9069. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9070. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9071. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9072. }
  9073. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  9074. if (result > 0)
  9075. {
  9076. actionResult.Status = (int)Constant.PDAResult.Success;
  9077. }
  9078. else
  9079. {
  9080. actionResult.Status = (int)Constant.PDAResult.Fail;
  9081. actionResult.Result = result;
  9082. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9083. return actionResult;
  9084. }
  9085. return actionResult;
  9086. }
  9087. #endregion
  9088. #region 变产
  9089. if (action == "UpdateLineStartGroutingLineDetail")
  9090. {
  9091. if (data == null || !data.ContainsKey("Details"))
  9092. {
  9093. actionResult.Status = (int)Constant.PDAResult.Fail;
  9094. actionResult.Message = "参数错误";
  9095. return actionResult;
  9096. }
  9097. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9098. DataTable gTable = new DataTable();
  9099. gTable.Columns.Add("GroutingLineID", typeof(int));
  9100. gTable.Columns.Add("GroutingLineCode");
  9101. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9102. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9103. gTable.Columns.Add("GroutingMouldCode");
  9104. gTable.Columns.Add("RecordRemarks");
  9105. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9106. gTable.Columns.Add("MouldID", typeof(int));
  9107. gTable.Columns.Add("MouldCode");
  9108. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9109. gTable.Columns.Add("MouldStatus", typeof(int));
  9110. gTable.Columns.Add("ScrapReason", typeof(int));
  9111. gTable.Columns.Add("ScrapResponsibility");
  9112. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9113. string groutingLineCode = data["GroutingLineCode"] + "";
  9114. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9115. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9116. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9117. string scrapResponsibility = data["ScrapRemarks"] + "";
  9118. foreach (Dictionary<string, object> item in details)
  9119. {
  9120. int? mouldID = null;
  9121. if (item.ContainsKey("MouldID"))
  9122. {
  9123. mouldID = Convert.ToInt32(item["MouldID"]);
  9124. if (mouldID == 0)
  9125. {
  9126. mouldID = null;
  9127. }
  9128. }
  9129. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9130. item["GLineDetailID"], item["GLineDetailCode"],
  9131. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9132. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9133. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9134. }
  9135. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  9136. if (result > 0)
  9137. {
  9138. actionResult.Status = (int)Constant.PDAResult.Success;
  9139. }
  9140. else
  9141. {
  9142. actionResult.Status = (int)Constant.PDAResult.Fail;
  9143. actionResult.Result = result;
  9144. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9145. return actionResult;
  9146. }
  9147. return actionResult;
  9148. }
  9149. #endregion
  9150. #region 整线变产
  9151. if (action == "UpdateAllLineStartGroutingLineDetail")
  9152. {
  9153. if (data == null || !data.ContainsKey("Details"))
  9154. {
  9155. actionResult.Status = (int)Constant.PDAResult.Fail;
  9156. actionResult.Message = "参数错误";
  9157. return actionResult;
  9158. }
  9159. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9160. DataTable gTable = new DataTable();
  9161. gTable.Columns.Add("GroutingLineID", typeof(int));
  9162. gTable.Columns.Add("GroutingLineCode");
  9163. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9164. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9165. gTable.Columns.Add("GroutingMouldCode");
  9166. gTable.Columns.Add("RecordRemarks");
  9167. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9168. gTable.Columns.Add("MouldID", typeof(int));
  9169. gTable.Columns.Add("MouldCode");
  9170. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9171. gTable.Columns.Add("MouldStatus", typeof(int));
  9172. gTable.Columns.Add("ScrapReason", typeof(int));
  9173. gTable.Columns.Add("ScrapResponsibility");
  9174. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9175. string groutingLineCode = data["GroutingLineCode"] + "";
  9176. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9177. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9178. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9179. string scrapResponsibility = data["ScrapRemarks"] + "";
  9180. foreach (Dictionary<string, object> item in details)
  9181. {
  9182. int? mouldID = null;
  9183. if (item.ContainsKey("MouldID"))
  9184. {
  9185. mouldID = Convert.ToInt32(item["MouldID"]);
  9186. if (mouldID == 0)
  9187. {
  9188. mouldID = null;
  9189. }
  9190. }
  9191. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9192. item["GLineDetailID"], item["GLineDetailCode"],
  9193. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9194. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9195. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9196. }
  9197. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  9198. if (result > 0)
  9199. {
  9200. actionResult.Status = (int)Constant.PDAResult.Success;
  9201. }
  9202. else
  9203. {
  9204. actionResult.Status = (int)Constant.PDAResult.Fail;
  9205. actionResult.Result = result;
  9206. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9207. return actionResult;
  9208. }
  9209. return actionResult;
  9210. }
  9211. #endregion
  9212. #region 卸模
  9213. if (action == "UnloadGroutingLineDetail")
  9214. {
  9215. if (data == null || !data.ContainsKey("Details"))
  9216. {
  9217. actionResult.Status = (int)Constant.PDAResult.Fail;
  9218. actionResult.Message = "参数错误";
  9219. return actionResult;
  9220. }
  9221. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9222. DataTable gTable = new DataTable();
  9223. gTable.Columns.Add("GroutingLineID", typeof(int));
  9224. gTable.Columns.Add("GroutingLineCode");
  9225. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9226. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9227. gTable.Columns.Add("GroutingMouldCode");
  9228. gTable.Columns.Add("RecordRemarks");
  9229. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9230. gTable.Columns.Add("MouldID", typeof(int));
  9231. gTable.Columns.Add("MouldCode");
  9232. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9233. gTable.Columns.Add("MouldStatus", typeof(int));
  9234. gTable.Columns.Add("ScrapReason", typeof(int));
  9235. gTable.Columns.Add("ScrapResponsibility");
  9236. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9237. string groutingLineCode = data["GroutingLineCode"] + "";
  9238. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9239. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9240. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9241. string scrapResponsibility = data["ScrapRemarks"] + "";
  9242. foreach (Dictionary<string, object> item in details)
  9243. {
  9244. int? mouldID = null;
  9245. if (item.ContainsKey("MouldID"))
  9246. {
  9247. mouldID = Convert.ToInt32(item["MouldID"]);
  9248. if (mouldID == 0)
  9249. {
  9250. mouldID = null;
  9251. }
  9252. }
  9253. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9254. item["GLineDetailID"], item["GLineDetailCode"],
  9255. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9256. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9257. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9258. }
  9259. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  9260. if (result > 0)
  9261. {
  9262. actionResult.Status = (int)Constant.PDAResult.Success;
  9263. }
  9264. else
  9265. {
  9266. actionResult.Status = (int)Constant.PDAResult.Fail;
  9267. actionResult.Result = result;
  9268. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9269. return actionResult;
  9270. }
  9271. return actionResult;
  9272. }
  9273. #endregion
  9274. #region 结束换模
  9275. if (action == "ChangeGMouldEndGroutingLineDetail")
  9276. {
  9277. if (data == null || !data.ContainsKey("Details"))
  9278. {
  9279. actionResult.Status = (int)Constant.PDAResult.Fail;
  9280. actionResult.Message = "参数错误";
  9281. return actionResult;
  9282. }
  9283. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9284. DataTable gTable = new DataTable();
  9285. gTable.Columns.Add("GroutingLineID", typeof(int));
  9286. gTable.Columns.Add("GroutingLineCode");
  9287. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9288. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9289. gTable.Columns.Add("GroutingMouldCode");
  9290. gTable.Columns.Add("RreasonRemarks");
  9291. gTable.Columns.Add("RecordRemarks");
  9292. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9293. gTable.Columns.Add("MouldID", typeof(int));
  9294. gTable.Columns.Add("MouldCode");
  9295. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9296. gTable.Columns.Add("GoodsID", typeof(int));
  9297. gTable.Columns.Add("GoodsCode");
  9298. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9299. gTable.Columns.Add("GroutingCount", typeof(int));
  9300. gTable.Columns.Add("MouldSource");
  9301. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9302. string groutingLineCode = data["GroutingLineCode"] + "";
  9303. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9304. foreach (Dictionary<string, object> item in details)
  9305. {
  9306. int? mouldID = null;
  9307. if (item.ContainsKey("MouldID"))
  9308. {
  9309. mouldID = Convert.ToInt32(item["MouldID"]);
  9310. if (mouldID == 0)
  9311. {
  9312. mouldID = null;
  9313. }
  9314. }
  9315. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9316. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9317. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9318. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9319. item["GoodsID"], item["GoodsCode"],
  9320. item["StandardGroutingCount"], item["GroutingCount"],
  9321. (mouldID == null ? "0" : "1"));
  9322. }
  9323. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  9324. if (result.Status == Constant.ServiceResultStatus.Success)
  9325. {
  9326. actionResult.Status = (int)Constant.PDAResult.Success;
  9327. }
  9328. else if (result.OtherStatus == -100)
  9329. {
  9330. actionResult.Status = (int)Constant.PDAResult.Fail;
  9331. actionResult.Result = -100;
  9332. actionResult.Message = result.Message;
  9333. return actionResult;
  9334. }
  9335. else
  9336. {
  9337. actionResult.Status = (int)Constant.PDAResult.Fail;
  9338. actionResult.Result = -500;
  9339. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9340. return actionResult;
  9341. }
  9342. return actionResult;
  9343. }
  9344. #endregion
  9345. #region 结束变产
  9346. if (action == "UpdateLineEndGroutingLineDetail")
  9347. {
  9348. if (data == null || !data.ContainsKey("Details"))
  9349. {
  9350. actionResult.Status = (int)Constant.PDAResult.Fail;
  9351. actionResult.Message = "参数错误";
  9352. return actionResult;
  9353. }
  9354. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9355. DataTable gTable = new DataTable();
  9356. gTable.Columns.Add("GroutingLineID", typeof(int));
  9357. gTable.Columns.Add("GroutingLineCode");
  9358. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9359. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9360. gTable.Columns.Add("GroutingMouldCode");
  9361. gTable.Columns.Add("RreasonRemarks");
  9362. gTable.Columns.Add("RecordRemarks");
  9363. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9364. gTable.Columns.Add("MouldID", typeof(int));
  9365. gTable.Columns.Add("MouldCode");
  9366. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9367. gTable.Columns.Add("GoodsID", typeof(int));
  9368. gTable.Columns.Add("GoodsCode");
  9369. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9370. gTable.Columns.Add("GroutingCount", typeof(int));
  9371. gTable.Columns.Add("MouldSource");
  9372. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9373. string groutingLineCode = data["GroutingLineCode"] + "";
  9374. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9375. foreach (Dictionary<string, object> item in details)
  9376. {
  9377. int? mouldID = null;
  9378. if (item.ContainsKey("MouldID"))
  9379. {
  9380. mouldID = Convert.ToInt32(item["MouldID"]);
  9381. if (mouldID == 0)
  9382. {
  9383. mouldID = null;
  9384. }
  9385. }
  9386. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9387. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9388. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9389. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9390. item["GoodsID"], item["GoodsCode"],
  9391. item["StandardGroutingCount"], item["GroutingCount"],
  9392. (mouldID == null ? "0" : "1"));
  9393. }
  9394. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  9395. if (result.Status == Constant.ServiceResultStatus.Success)
  9396. {
  9397. actionResult.Status = (int)Constant.PDAResult.Success;
  9398. }
  9399. else if (result.OtherStatus == -100)
  9400. {
  9401. actionResult.Status = (int)Constant.PDAResult.Fail;
  9402. actionResult.Result = -100;
  9403. actionResult.Message = result.Message;
  9404. return actionResult;
  9405. }
  9406. else
  9407. {
  9408. actionResult.Status = (int)Constant.PDAResult.Fail;
  9409. actionResult.Result = -500;
  9410. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9411. return actionResult;
  9412. }
  9413. return actionResult;
  9414. }
  9415. #endregion
  9416. #region 结束整线变产
  9417. if (action == "UpdateAllLineEndGroutingLineDetail")
  9418. {
  9419. if (data == null || !data.ContainsKey("Details"))
  9420. {
  9421. actionResult.Status = (int)Constant.PDAResult.Fail;
  9422. actionResult.Message = "参数错误";
  9423. return actionResult;
  9424. }
  9425. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9426. DataTable gTable = new DataTable();
  9427. gTable.Columns.Add("GroutingLineID", typeof(int));
  9428. gTable.Columns.Add("GroutingLineCode");
  9429. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9430. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9431. gTable.Columns.Add("GroutingMouldCode");
  9432. gTable.Columns.Add("Remarks");
  9433. gTable.Columns.Add("RecordRemarks");
  9434. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9435. gTable.Columns.Add("MouldID", typeof(int));
  9436. gTable.Columns.Add("MouldCode");
  9437. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9438. gTable.Columns.Add("GoodsID", typeof(int));
  9439. gTable.Columns.Add("GoodsCode");
  9440. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9441. gTable.Columns.Add("GroutingCount", typeof(int));
  9442. gTable.Columns.Add("MouldSource");
  9443. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9444. string groutingLineCode = data["GroutingLineCode"] + "";
  9445. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9446. foreach (Dictionary<string, object> item in details)
  9447. {
  9448. int? mouldID = null;
  9449. if (item.ContainsKey("MouldID"))
  9450. {
  9451. mouldID = Convert.ToInt32(item["MouldID"]);
  9452. if (mouldID == 0)
  9453. {
  9454. mouldID = null;
  9455. }
  9456. }
  9457. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9458. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9459. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  9460. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9461. item["GoodsID"], item["GoodsCode"],
  9462. item["StandardGroutingCount"], item["GroutingCount"],
  9463. (mouldID == null ? "0" : "1"));
  9464. }
  9465. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  9466. if (result.Status == Constant.ServiceResultStatus.Success)
  9467. {
  9468. actionResult.Status = (int)Constant.PDAResult.Success;
  9469. }
  9470. else if (result.OtherStatus == -100)
  9471. {
  9472. actionResult.Status = (int)Constant.PDAResult.Fail;
  9473. actionResult.Result = -100;
  9474. actionResult.Message = result.Message;
  9475. return actionResult;
  9476. }
  9477. else
  9478. {
  9479. actionResult.Status = (int)Constant.PDAResult.Fail;
  9480. actionResult.Result = -500;
  9481. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9482. return actionResult;
  9483. }
  9484. return actionResult;
  9485. }
  9486. #endregion
  9487. #region 上模
  9488. if (action == "UpdateGroutingLine_AddMould")
  9489. {
  9490. if (data == null || !data.ContainsKey("Details"))
  9491. {
  9492. actionResult.Status = (int)Constant.PDAResult.Fail;
  9493. actionResult.Message = "参数错误";
  9494. return actionResult;
  9495. }
  9496. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9497. DataTable gTable = new DataTable();
  9498. gTable.Columns.Add("GroutingLineID", typeof(int));
  9499. gTable.Columns.Add("GroutingLineCode");
  9500. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9501. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9502. gTable.Columns.Add("GroutingMouldCode");
  9503. gTable.Columns.Add("Remarks");
  9504. gTable.Columns.Add("RecordRemarks");
  9505. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9506. gTable.Columns.Add("MouldID", typeof(int));
  9507. gTable.Columns.Add("MouldCode");
  9508. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9509. gTable.Columns.Add("GoodsID", typeof(int));
  9510. gTable.Columns.Add("GoodsCode");
  9511. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9512. gTable.Columns.Add("GroutingCount", typeof(int));
  9513. gTable.Columns.Add("MouldSource");
  9514. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9515. string groutingLineCode = data["GroutingLineCode"] + "";
  9516. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9517. foreach (Dictionary<string, object> item in details)
  9518. {
  9519. int? mouldID = null;
  9520. if (item.ContainsKey("MouldID"))
  9521. {
  9522. mouldID = Convert.ToInt32(item["MouldID"]);
  9523. if (mouldID == 0)
  9524. {
  9525. mouldID = null;
  9526. }
  9527. }
  9528. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  9529. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9530. gldID, item["GLineDetailCode"],
  9531. item["DetailRemarks"], item["RecordRemarks"],
  9532. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  9533. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9534. item["GoodsID"], item["GoodsCode"],
  9535. item["StandardGroutingCount"], item["GroutingCount"],
  9536. (mouldID == null ? "0" : "1"));
  9537. }
  9538. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  9539. if (result.Status == Constant.ServiceResultStatus.Success)
  9540. {
  9541. actionResult.Status = (int)Constant.PDAResult.Success;
  9542. }
  9543. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  9544. {
  9545. actionResult.Status = (int)Constant.PDAResult.Fail;
  9546. actionResult.Result = result.OtherStatus;
  9547. actionResult.Message = result.Message;
  9548. return actionResult;
  9549. }
  9550. else if (result.OtherStatus == -10001 || result.OtherStatus == -10002)
  9551. {
  9552. actionResult.Status = -99;
  9553. actionResult.Result = result.OtherStatus;
  9554. actionResult.Message = result.Message;
  9555. return actionResult;
  9556. }
  9557. else
  9558. {
  9559. actionResult.Status = (int)Constant.PDAResult.Fail;
  9560. actionResult.Result = -500;
  9561. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9562. return actionResult;
  9563. }
  9564. return actionResult;
  9565. }
  9566. #endregion
  9567. return actionResult;
  9568. }
  9569. #endregion
  9570. #region 包装装板限制
  9571. if (module == "FinishedLoadingCar")
  9572. {
  9573. if (action == "GetSetting")
  9574. {
  9575. ClientRequestEntity cre = new ClientRequestEntity();
  9576. cre.Properties["GoodsID"] = data["GoodsID"];
  9577. if (data.ContainsKey("logoID"))
  9578. {
  9579. cre.Properties["logoID"] = data["logoID"] + "";
  9580. }
  9581. else
  9582. {
  9583. cre.Properties["logoID"] = "";
  9584. }
  9585. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9586. if (sre.Status == Constant.ServiceResultStatus.Success)
  9587. {
  9588. actionResult.Status = (int)Constant.PDAResult.Success;
  9589. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9590. {
  9591. if (item["settingcode"].ToString() == "S_PM_011")
  9592. {
  9593. cre.Properties["S_PM_011"] = item["settingvalue"];
  9594. }
  9595. else if (item["settingcode"].ToString() == "S_PM_012")
  9596. {
  9597. cre.Properties["S_PM_012"] = item["settingvalue"];
  9598. }
  9599. else if (item["settingcode"].ToString() == "S_PM_013")
  9600. {
  9601. cre.Properties["S_PM_013"] = item["settingvalue"];
  9602. }
  9603. }
  9604. DataTable dt = sre.Result as DataTable;
  9605. cre.Properties["PlatelitNum"] = dt.Rows[0]["PLATELIMITNUM"];
  9606. cre.Properties["PlatelitNumNew"] = dt.Rows[0]["PLATELIMITNUMNEW"];
  9607. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9608. }
  9609. else
  9610. {
  9611. actionResult.Status = (int)Constant.PDAResult.Fail;
  9612. actionResult.Message = "";
  9613. }
  9614. return actionResult;
  9615. }
  9616. }
  9617. #endregion
  9618. #region 成型报损
  9619. if (module == "GroutingScrapProduct")
  9620. {
  9621. // 查询注浆日报明细表
  9622. if ("GetGroutingDailyDetail" == action)
  9623. {
  9624. ClientRequestEntity cre = new ClientRequestEntity();
  9625. cre.NameSpace = module;
  9626. cre.Name = action;
  9627. if (!string.IsNullOrEmpty(jsonData))
  9628. {
  9629. cre.Properties["BarCode"] = data["BarCode"];
  9630. }
  9631. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9632. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9633. actionResult.Status = (int)Constant.PDAResult.Success;
  9634. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9635. || sre.Data.Tables[0].Rows.Count == 0)
  9636. {
  9637. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9638. actionResult.Status = (int)Constant.PDAResult.Fail;
  9639. }
  9640. else
  9641. {
  9642. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9643. // 判断是否进行了注浆
  9644. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9645. {
  9646. actionResult.Message = "该产品还未进行注浆!";
  9647. actionResult.Status = (int)Constant.PDAResult.Fail;
  9648. }
  9649. // 判断是否进行了交坯
  9650. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9651. {
  9652. actionResult.Message = "该产品已经交坯!";
  9653. actionResult.Status = (int)Constant.PDAResult.Fail;
  9654. }
  9655. // 判断是否已经报损
  9656. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9657. {
  9658. actionResult.Message = "该产品已经报损!";
  9659. actionResult.Status = (int)Constant.PDAResult.Fail;
  9660. }
  9661. // 该产品已进入生产工序
  9662. if ("1".Equals(_barCodeRow["beginningflag"]))
  9663. {
  9664. actionResult.Message = "该产品已进入生产工序!";
  9665. actionResult.Status = (int)Constant.PDAResult.Fail;
  9666. }
  9667. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9668. }
  9669. }
  9670. // 获取成型报损原因
  9671. else if ("GetScrapReasonData" == action)
  9672. {
  9673. ClientRequestEntity cre = new ClientRequestEntity();
  9674. cre.NameSpace = module;
  9675. cre.Name = action;
  9676. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo, "1");
  9677. actionResult.Status = (int)Constant.PDAResult.Success;
  9678. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9679. }
  9680. // 保存成型报损
  9681. else if ("SaveGroutingScrapProduct" == action)
  9682. {
  9683. ClientRequestEntity cre = new ClientRequestEntity();
  9684. cre.NameSpace = module;
  9685. cre.Name = action;
  9686. if (!string.IsNullOrEmpty(jsonData))
  9687. {
  9688. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9689. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9690. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9691. if (dt != null && dt.Rows.Count > 0)
  9692. {
  9693. // 总单信息
  9694. DataRow properties = dt.Rows[0];
  9695. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9696. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9697. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9698. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9699. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9700. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9701. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9702. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9703. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9704. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9705. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9706. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9707. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9708. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9709. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9710. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9711. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9712. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9713. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9714. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9715. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9716. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9717. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9718. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9719. // 责任员工
  9720. cre.Data = new DataSet();
  9721. //DataTable returnTable = returnData.Tables[1].Copy();
  9722. cre.Data.Tables.Add(dtResponsible);
  9723. }
  9724. }
  9725. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9726. if (sre.Status == Constant.ServiceResultStatus.Success)
  9727. {
  9728. actionResult.Status = (int)Constant.PDAResult.Success;
  9729. actionResult.Result = sre.Result;
  9730. }
  9731. else
  9732. {
  9733. actionResult.Status = (int)Constant.PDAResult.Fail;
  9734. actionResult.Result = sre.OtherStatus;
  9735. actionResult.Message = sre.Message;
  9736. }
  9737. }
  9738. // 获取成型报损信息 用于撤销使用
  9739. else if ("GetGroutingScrapProduct" == action)
  9740. {
  9741. ClientRequestEntity cre = new ClientRequestEntity();
  9742. cre.NameSpace = module;
  9743. cre.Name = action;
  9744. if (!string.IsNullOrEmpty(jsonData))
  9745. {
  9746. cre.Properties["BarCode"] = data["BarCode"];
  9747. }
  9748. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9749. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9750. actionResult.Status = (int)Constant.PDAResult.Success;
  9751. }
  9752. //xuwei add 2020-03-23
  9753. //获取成型报损信息 用于撤销使用 支持 浆日报直接报损
  9754. else if ("GetGroutingScrap" == action)
  9755. {
  9756. ClientRequestEntity cre = new ClientRequestEntity();
  9757. cre.NameSpace = module;
  9758. cre.Name = action;
  9759. if (!string.IsNullOrEmpty(jsonData))
  9760. {
  9761. cre.Properties["BarCode"] = data["BarCode"];
  9762. }
  9763. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrap(cre, sUserInfo);
  9764. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9765. actionResult.Status = (int)Constant.PDAResult.Success;
  9766. }
  9767. // 撤销成型报损
  9768. else if ("ReverseGroutingScrapProduct" == action)
  9769. {
  9770. ClientRequestEntity cre = new ClientRequestEntity();
  9771. cre.NameSpace = module;
  9772. cre.Name = action;
  9773. if (!string.IsNullOrEmpty(jsonData))
  9774. {
  9775. cre.Properties["BarCode"] = data["BarCode"];
  9776. }
  9777. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9778. if (sre.Status == Constant.ServiceResultStatus.Success)
  9779. {
  9780. actionResult.Status = (int)Constant.PDAResult.Success;
  9781. actionResult.Result = sre.Result;
  9782. }
  9783. else
  9784. {
  9785. actionResult.Status = (int)Constant.PDAResult.Fail;
  9786. actionResult.Result = sre.OtherStatus;
  9787. actionResult.Message = sre.Message;
  9788. }
  9789. }
  9790. }
  9791. #endregion
  9792. #region 产品挂起
  9793. if (module == "ProductSuspend")
  9794. {
  9795. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9796. if (action == "GetSuspendProcedure")
  9797. {
  9798. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9799. if (sre.Status == Constant.ServiceResultStatus.Success)
  9800. {
  9801. actionResult.Status = (int)Constant.PDAResult.Success;
  9802. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9803. }
  9804. else
  9805. {
  9806. actionResult.Status = (int)Constant.PDAResult.Fail;
  9807. actionResult.Message = sre.Message;
  9808. }
  9809. return actionResult;
  9810. }
  9811. // 验证挂起条码
  9812. if (action == "CheckSuspendBarcode")
  9813. {
  9814. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9815. if (sre.Status == Constant.ServiceResultStatus.Success)
  9816. {
  9817. actionResult.Status = (int)Constant.PDAResult.Success;
  9818. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9819. }
  9820. else
  9821. {
  9822. actionResult.Status = (int)Constant.PDAResult.Fail;
  9823. actionResult.Message = sre.Message;
  9824. }
  9825. return actionResult;
  9826. }
  9827. // 挂起条码
  9828. if (action == "SaveSuspendProduct")
  9829. {
  9830. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9831. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9832. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9833. if (sre.Status == Constant.ServiceResultStatus.Success)
  9834. {
  9835. actionResult.Status = (int)Constant.PDAResult.Success;
  9836. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9837. }
  9838. else
  9839. {
  9840. actionResult.Status = (int)Constant.PDAResult.Fail;
  9841. actionResult.Message = sre.Message;
  9842. }
  9843. return actionResult;
  9844. }
  9845. // 撤销挂起条码
  9846. if (action == "DeleteSuspendProduct")
  9847. {
  9848. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9849. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9850. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9851. if (sre.Status == Constant.ServiceResultStatus.Success)
  9852. {
  9853. actionResult.Status = (int)Constant.PDAResult.Success;
  9854. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9855. }
  9856. else
  9857. {
  9858. actionResult.Status = (int)Constant.PDAResult.Fail;
  9859. actionResult.Message = sre.Message;
  9860. }
  9861. return actionResult;
  9862. }
  9863. // 查询挂起条码
  9864. if (action == "GetSuspendProduct")
  9865. {
  9866. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9867. if (sre.Status == Constant.ServiceResultStatus.Success)
  9868. {
  9869. if (sre.Data.Tables[0].Rows.Count == 0)
  9870. {
  9871. actionResult.Status = (int)Constant.PDAResult.Fail;
  9872. actionResult.Message = "此条码没有可撤销的挂起信息";
  9873. }
  9874. else
  9875. {
  9876. actionResult.Status = (int)Constant.PDAResult.Success;
  9877. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9878. }
  9879. }
  9880. else
  9881. {
  9882. actionResult.Status = (int)Constant.PDAResult.Fail;
  9883. actionResult.Message = sre.Message;
  9884. }
  9885. return actionResult;
  9886. }
  9887. }
  9888. #endregion
  9889. #region 品保抽查
  9890. if (module == "QASpotCheck")
  9891. {
  9892. if (action == "GetAllQASpotCheck")
  9893. {
  9894. ClientRequestEntity cre = new ClientRequestEntity();
  9895. cre.NameSpace = module;
  9896. cre.Name = action;
  9897. if (data != null && data.Count > 0)
  9898. {
  9899. foreach (string item in data.Keys)
  9900. {
  9901. if (item.StartsWith("checktime"))
  9902. {
  9903. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9904. }
  9905. else
  9906. {
  9907. cre.Properties.Add(item, data[item]);
  9908. }
  9909. }
  9910. }
  9911. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9912. if (sre.Status == Constant.ServiceResultStatus.Success)
  9913. {
  9914. actionResult.Status = (int)Constant.PDAResult.Success;
  9915. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9916. }
  9917. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9918. {
  9919. actionResult.Status = (int)Constant.PDAResult.Success;
  9920. }
  9921. else
  9922. {
  9923. actionResult.Status = (int)Constant.PDAResult.Fail;
  9924. actionResult.Message = sre.Message;
  9925. }
  9926. return actionResult;
  9927. }
  9928. if (action == "AutoSaveQASpotCheck")
  9929. {
  9930. string barcode = data["barcode"] + "";
  9931. string remarks = data["remarks"] + "";
  9932. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9933. if (sre.Status == Constant.ServiceResultStatus.Success)
  9934. {
  9935. actionResult.Status = (int)Constant.PDAResult.Success;
  9936. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9937. }
  9938. else
  9939. {
  9940. actionResult.Status = (int)Constant.PDAResult.Fail;
  9941. actionResult.Message = sre.Message;
  9942. }
  9943. return actionResult;
  9944. }
  9945. if (action == "CheckQASpotCheck")
  9946. {
  9947. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9948. if (sre.Status == Constant.ServiceResultStatus.Success)
  9949. {
  9950. actionResult.Status = (int)Constant.PDAResult.Success;
  9951. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9952. }
  9953. else
  9954. {
  9955. actionResult.Status = (int)Constant.PDAResult.Fail;
  9956. actionResult.Message = sre.Message;
  9957. }
  9958. return actionResult;
  9959. }
  9960. if (action == "SaveQASpotCheck")
  9961. {
  9962. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9963. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9964. if (sre.Status == Constant.ServiceResultStatus.Success)
  9965. {
  9966. actionResult.Status = (int)Constant.PDAResult.Success;
  9967. }
  9968. else
  9969. {
  9970. actionResult.Status = (int)Constant.PDAResult.Fail;
  9971. actionResult.Message = sre.Message;
  9972. }
  9973. return actionResult;
  9974. }
  9975. return null;
  9976. }
  9977. #endregion
  9978. #region 产成品交接
  9979. if (module == "FinishedProduct")
  9980. {
  9981. #region 产成品交接、整板撤销 by fubin 20200824
  9982. // 交接验证
  9983. if (action == "FinishedHandoverBarcode")
  9984. {
  9985. string barcode = data["Barcode"] + "";
  9986. ServiceResultEntity sre = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo);
  9987. if (sre.Data != null && sre.Data.Tables.Count > 0)
  9988. {
  9989. actionResult.Status = (int)Constant.PDAResult.Success;
  9990. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9991. actionResult.Message = sre.Message;
  9992. }
  9993. else
  9994. {
  9995. actionResult.Status = (int)Constant.PDAResult.Fail;
  9996. actionResult.Message = sre.Message;
  9997. }
  9998. return actionResult;
  9999. }
  10000. // 交接操作
  10001. if (action == "SaveFinishedHandover")
  10002. {
  10003. int orderID = Convert.ToInt32(data["OrderID"]);
  10004. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  10005. //切换sap地址 by fy 2022年7月5日09:15:23 开始
  10006. //ServiceResultEntity sre = PMModuleLogicDAL.SaveFinishedHandover(orderID, dt, sUserInfo);
  10007. string sapName = "";
  10008. if (data.ContainsKey("SPANAME") && data["SPANAME"] is object &&
  10009. (data["SPANAME"].Equals("APP1") || data["SPANAME"].Equals("APP2") || data["SPANAME"].Equals("APP3")))
  10010. {
  10011. sapName = "_" + data["SPANAME"].ToString();
  10012. }
  10013. else
  10014. {
  10015. sapName = "";
  10016. }
  10017. ServiceResultEntity sre = PMModuleLogicDAL.SaveFinishedHandover(orderID, dt, sUserInfo, sapName);
  10018. //结束
  10019. if (Convert.ToInt32(sre.Result) > 0)
  10020. {
  10021. actionResult.Status = (int)Constant.PDAResult.Success;
  10022. actionResult.Message = "产成品交接成功";
  10023. }
  10024. else
  10025. {
  10026. actionResult.Status = (int)Constant.PDAResult.Fail;
  10027. actionResult.Message = sre.Message;
  10028. }
  10029. return actionResult;
  10030. }
  10031. // 撤销交接验证
  10032. if (action == "BackFinishedHandoverCheck")
  10033. {
  10034. string barcode = data["Barcode"] + "";
  10035. ServiceResultEntity sre = PMModuleLogic.BackFinishedHandoverCheck(barcode, sUserInfo);
  10036. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10037. {
  10038. actionResult.Status = (int)Constant.PDAResult.Success;
  10039. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10040. actionResult.Message = sre.Message;
  10041. }
  10042. else
  10043. {
  10044. actionResult.Status = (int)Constant.PDAResult.Fail;
  10045. actionResult.Message = sre.Message;
  10046. }
  10047. return actionResult;
  10048. }
  10049. // 撤销交接操作
  10050. if (action == "BackFinishedHandover")
  10051. {
  10052. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  10053. ServiceResultEntity sre = PMModuleLogicDAL.BackFinishedHandover(dt, sUserInfo);
  10054. if (Convert.ToInt32(sre.Result) > 0)
  10055. {
  10056. actionResult.Status = (int)Constant.PDAResult.Success;
  10057. actionResult.Message = "产成品撤销交接成功";
  10058. }
  10059. else
  10060. {
  10061. actionResult.Status = (int)Constant.PDAResult.Fail;
  10062. actionResult.Message = sre.Message;
  10063. }
  10064. return actionResult;
  10065. }
  10066. #endregion
  10067. // 设定商标
  10068. if (action == "GetFinishedBarcode")
  10069. {
  10070. string barcode = data["barcode"].ToString();
  10071. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  10072. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10073. if (Convert.ToInt32(resultEntity.Result) < 0)
  10074. {
  10075. actionResult.Status = (int)Constant.PDAResult.Fail;
  10076. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  10077. actionResult.Message = resultEntity.Message;
  10078. }
  10079. else
  10080. {
  10081. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10082. actionResult.Status = (int)Constant.PDAResult.Success;
  10083. actionResult.Message = resultEntity.Message;
  10084. }
  10085. return actionResult;
  10086. }
  10087. if (action == "GetHandoveredBarcode")
  10088. {
  10089. string barcode = data["barcode"].ToString();
  10090. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  10091. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10092. if (Convert.ToInt32(resultEntity.Result) < 0)
  10093. {
  10094. actionResult.Status = (int)Constant.PDAResult.Fail;
  10095. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  10096. actionResult.Message = resultEntity.Message;
  10097. }
  10098. else
  10099. {
  10100. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10101. actionResult.Status = (int)Constant.PDAResult.Success;
  10102. actionResult.Message = resultEntity.Message;
  10103. }
  10104. return actionResult;
  10105. }
  10106. if (action == "SetFinishedLogo")
  10107. {
  10108. int logoid = Convert.ToInt32(data["logoid"]);
  10109. string[] barcodes = data["barcodes"].ToString().Split(',');
  10110. string returnMessage = "";
  10111. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo, out returnMessage);
  10112. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10113. if (result < 0)
  10114. {
  10115. actionResult.Status = (int)Constant.PDAResult.Fail;
  10116. actionResult.Message = returnMessage;
  10117. }
  10118. else
  10119. {
  10120. actionResult.Status = (int)Constant.PDAResult.Success;
  10121. }
  10122. return actionResult;
  10123. }
  10124. if (action == "SetHandoveredOrder")
  10125. {
  10126. int orderID = Convert.ToInt32(data["orderID"]);
  10127. string[] barcodes = data["barcodes"].ToString().Split(',');
  10128. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  10129. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10130. if (result < 0)
  10131. {
  10132. actionResult.Status = (int)Constant.PDAResult.Fail;
  10133. }
  10134. else
  10135. {
  10136. actionResult.Status = (int)Constant.PDAResult.Success;
  10137. }
  10138. return actionResult;
  10139. }
  10140. }
  10141. #endregion
  10142. #region 产成品装车
  10143. if (module == "SendOutGoods")
  10144. {
  10145. if (action == "GetSendOutGoodsLogs")
  10146. {
  10147. string Lgort = data["Lgort"].ToString();
  10148. string sendoutgoodslogid = data.ContainsKey("sendoutgoodslogid")&& data["sendoutgoodslogid"]!=null? data["sendoutgoodslogid"].ToString() : "";
  10149. var result = PMModuleLogicDAL.GetSendOutGoodsLogs(Lgort, sendoutgoodslogid, sUserInfo);
  10150. actionResult.Result = JsonHelper.ToJson(result);
  10151. actionResult.Status = (int)Constant.PDAResult.Success;
  10152. return actionResult;
  10153. }
  10154. if (action == "CheckSendOutBarcode")
  10155. {
  10156. var result = PMModuleLogic.CHeckFinishOutlabelCode(data["banma"].ToString(), sUserInfo);
  10157. actionResult.Result = JsonHelper.ToJson(result.Result);
  10158. actionResult.Status = (int)result.Status;
  10159. actionResult.Message = result.Message;
  10160. return actionResult;
  10161. }
  10162. if (action == "SaveSendOutGoods")
  10163. {
  10164. SendOutGoodsEntity send = JsonHelper.FromJson<SendOutGoodsEntity>(data.ElementAt(0).Value.ToString());
  10165. var sendDetail = JsonHelper.FromJson<List<SendOutGoodsDetailEntity>>(data.ElementAt(1).Value.ToString());
  10166. var result = PMModuleLogicDAL.SaveSendOutGoodsLogs(send, sendDetail, sUserInfo);
  10167. if (result.OtherStatus < 0)
  10168. {
  10169. actionResult.Status = (int)Constant.PDAResult.Fail;
  10170. actionResult.Message = result.Message;
  10171. }
  10172. else
  10173. {
  10174. actionResult.Status = (int)Constant.PDAResult.Success;
  10175. actionResult.Message = "保存成功; 【凭证单号:" + result.Message + "】" ;
  10176. }
  10177. return actionResult;
  10178. }
  10179. }
  10180. /*
  10181. if (module == "FinishedLoading")
  10182. {
  10183. // 设定商标
  10184. if (action == "GetMaxLoadingNo")
  10185. {
  10186. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  10187. actionResult.Status = (int)Constant.PDAResult.Success;
  10188. actionResult.Result = no;
  10189. return actionResult;
  10190. }
  10191. if (action == "CheckFinishedLaodingBarcode")
  10192. {
  10193. string barcode = data["barcode"].ToString();
  10194. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  10195. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  10196. {
  10197. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10198. actionResult.Status = (int)Constant.PDAResult.Success;
  10199. actionResult.Message = resultEntity.Message;
  10200. }
  10201. else
  10202. {
  10203. actionResult.Status = (int)Constant.PDAResult.Fail;
  10204. actionResult.Result = resultEntity.OtherStatus;
  10205. actionResult.Message = resultEntity.Message;
  10206. }
  10207. return actionResult;
  10208. }
  10209. if (action == "SaveFinishedLoading")
  10210. {
  10211. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  10212. string carLicense = data["carLicense"] + "";
  10213. int palletNum = Convert.ToInt32(data["palletNum"]);
  10214. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  10215. string remarks = data["remarks"] + "";
  10216. Dictionary<string, object>[] details =
  10217. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  10218. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  10219. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  10220. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  10221. if (result.Status == Constant.ServiceResultStatus.Success)
  10222. {
  10223. actionResult.Status = (int)Constant.PDAResult.Success;
  10224. actionResult.Message = result.Message;
  10225. }
  10226. else
  10227. {
  10228. actionResult.Status = (int)Constant.PDAResult.Fail;
  10229. actionResult.Result = result.OtherStatus;
  10230. actionResult.Message = result.Message;
  10231. }
  10232. return actionResult;
  10233. }
  10234. }
  10235. */
  10236. #endregion
  10237. #region 产成品质量改判
  10238. if (module == "FinishedProductTamper")
  10239. {
  10240. // 获取产成品信息及缺陷数据
  10241. if (action == "GetDefectData")
  10242. {
  10243. string barcode = data["barcode"].ToString();
  10244. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  10245. if (sre.Status == Constant.ServiceResultStatus.Success)
  10246. {
  10247. actionResult.Status = (int)Constant.PDAResult.Success;
  10248. actionResult.Result = JsonHelper.ToJson(sre.Result);
  10249. actionResult.Message = sre.Message;
  10250. }
  10251. else
  10252. {
  10253. actionResult.Status = (int)Constant.PDAResult.Fail;
  10254. actionResult.Result = sre.OtherStatus;
  10255. actionResult.Message = sre.Message;
  10256. }
  10257. return actionResult;
  10258. }
  10259. // 获取产成品信息及缺陷数据
  10260. if (action == "SaveDefectData")
  10261. {
  10262. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  10263. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  10264. if (sre.Status == Constant.ServiceResultStatus.Success)
  10265. {
  10266. actionResult.Status = (int)Constant.PDAResult.Success;
  10267. actionResult.Message = sre.Message;
  10268. }
  10269. else
  10270. {
  10271. actionResult.Status = (int)Constant.PDAResult.Fail;
  10272. actionResult.Message = sre.Message;
  10273. }
  10274. return actionResult;
  10275. }
  10276. // 通过条码查出责任工序(成品改判用)
  10277. if (action == "GetDutyProcedureByBarCodeForTamper")
  10278. {
  10279. string barcode = data["barcode"] + "";
  10280. int defectid = int.Parse(data["defectid"] + "");
  10281. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  10282. if (sre.Status == Constant.ServiceResultStatus.Success)
  10283. {
  10284. actionResult.Status = (int)Constant.PDAResult.Success;
  10285. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10286. actionResult.Message = sre.Message;
  10287. }
  10288. else
  10289. {
  10290. actionResult.Status = (int)Constant.PDAResult.Fail;
  10291. actionResult.Result = sre.OtherStatus;
  10292. actionResult.Message = sre.Message;
  10293. }
  10294. return actionResult;
  10295. }
  10296. }
  10297. #endregion
  10298. #region PDA独立功能
  10299. #region 水效标识
  10300. if (module == "WaterEffect")
  10301. {
  10302. // 获取产成品信息及水效标识
  10303. if (action == "GetGoodsByBarCode")
  10304. {
  10305. string barcode = data["barcode"].ToString();
  10306. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  10307. if (sre.Status == Constant.ServiceResultStatus.Success)
  10308. {
  10309. actionResult.Status = (int)Constant.PDAResult.Success;
  10310. actionResult.Result = JsonHelper.ToJson(sre.Result);
  10311. actionResult.Message = sre.Message;
  10312. }
  10313. else
  10314. {
  10315. actionResult.Status = (int)Constant.PDAResult.Fail;
  10316. actionResult.Result = sre.OtherStatus;
  10317. actionResult.Message = sre.Message;
  10318. }
  10319. return actionResult;
  10320. }
  10321. }
  10322. #endregion
  10323. #region 盖板型号
  10324. if (module == "SeatCoverType")
  10325. {
  10326. // 获取产成品信息及水效标识
  10327. if (action == "SendGoodsCodeToPLC")
  10328. {
  10329. string barcode = data["barcode"].ToString();
  10330. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  10331. if (sre == 0)
  10332. {
  10333. actionResult.Status = (int)Constant.PDAResult.Success;
  10334. }
  10335. else
  10336. {
  10337. actionResult.Status = (int)Constant.PDAResult.Fail;
  10338. actionResult.Result = sre;
  10339. switch (sre)
  10340. {
  10341. case 1:
  10342. case 2:
  10343. actionResult.Message = "无效条码";
  10344. break;
  10345. case 3:
  10346. actionResult.Message = "此产品型号没有设置盖板标识码";
  10347. break;
  10348. case 4:
  10349. actionResult.Message = "当前用户没有设置PLC参数";
  10350. break;
  10351. case 5:
  10352. actionResult.Message = "PLC参数设置不全";
  10353. break;
  10354. default:
  10355. actionResult.Message = "PLC通信异常";
  10356. break;
  10357. }
  10358. }
  10359. return actionResult;
  10360. }
  10361. }
  10362. #endregion
  10363. #region PDA PLC 相关功能
  10364. if (module == "PDA_FUN_PLC")
  10365. {
  10366. // PDA扫码发送到PLCServer
  10367. if (action == "SendBarcodeToPLCServer")
  10368. {
  10369. string barcode = data["barcode"].ToString();
  10370. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  10371. if (sre == 0)
  10372. {
  10373. actionResult.Status = (int)Constant.PDAResult.Success;
  10374. }
  10375. else
  10376. {
  10377. actionResult.Status = (int)Constant.PDAResult.Fail;
  10378. actionResult.Result = sre;
  10379. switch (sre)
  10380. {
  10381. case 1:
  10382. case 2:
  10383. actionResult.Message = "无效条码";
  10384. break;
  10385. case 3:
  10386. actionResult.Message = "PLC通信异常";
  10387. break;
  10388. case 4:
  10389. actionResult.Message = "当前用户没有设置PLC参数";
  10390. break;
  10391. case 5:
  10392. actionResult.Message = "PLC参数设置不全";
  10393. break;
  10394. default:
  10395. actionResult.Message = "PLC通信异常";
  10396. break;
  10397. }
  10398. }
  10399. return actionResult;
  10400. }
  10401. }
  10402. #endregion
  10403. #endregion
  10404. #region 半检返修
  10405. if (module == "SemiRework")
  10406. {
  10407. // 验证半检返修条码
  10408. if (action == "CheckSemiReworkBarcode")
  10409. {
  10410. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10411. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  10412. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10413. if (Convert.ToInt32(resultEntity.Result) < 0)
  10414. {
  10415. actionResult.Status = (int)Constant.PDAResult.Fail;
  10416. }
  10417. else
  10418. {
  10419. actionResult.Status = (int)Constant.PDAResult.Success;
  10420. }
  10421. actionResult.Message = resultEntity.Message;
  10422. return actionResult;
  10423. }
  10424. // 可以返修的工序
  10425. if (action == "GetSemiReworkProcedure")
  10426. {
  10427. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10428. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  10429. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10430. actionResult.Status = (int)Constant.PDAResult.Success;
  10431. return actionResult;
  10432. }
  10433. // 根据条码获取经过的工序,用于责任工序
  10434. if (action == "GetSemiReworkPassProcedure")
  10435. {
  10436. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10437. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  10438. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10439. actionResult.Status = (int)Constant.PDAResult.Success;
  10440. return actionResult;
  10441. }
  10442. // 根据所选生产工序(生产数据ID)查询责任员工
  10443. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  10444. {
  10445. int productionDataID = Convert.ToInt32(jsonData);
  10446. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10447. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  10448. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10449. actionResult.Status = (int)Constant.PDAResult.Success;
  10450. return actionResult;
  10451. }
  10452. // 根据所选工号,查出缺陷责任员工
  10453. if (action == "GetSemiReworkDefectStaffByUserID")
  10454. {
  10455. int userID = Convert.ToInt32(jsonData);
  10456. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10457. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  10458. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10459. actionResult.Status = (int)Constant.PDAResult.Success;
  10460. return actionResult;
  10461. }
  10462. // 新建半检返修
  10463. if (action == "AddSemiRework")
  10464. {
  10465. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10466. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10467. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  10468. actionResult.Result = resultEntity.Result;
  10469. actionResult.Message = resultEntity.Message;
  10470. if (Convert.ToInt32(resultEntity.Result) > 0)
  10471. {
  10472. actionResult.Status = (int)Constant.PDAResult.Success;
  10473. }
  10474. else
  10475. {
  10476. actionResult.Status = (int)Constant.PDAResult.Fail;
  10477. }
  10478. return actionResult;
  10479. }
  10480. // 编辑半检返修
  10481. if (action == "EditSemiRework")
  10482. {
  10483. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10484. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10485. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  10486. actionResult.Result = resultEntity.Result;
  10487. actionResult.Message = resultEntity.Message;
  10488. if (Convert.ToInt32(resultEntity.Result) > 0)
  10489. {
  10490. actionResult.Status = (int)Constant.PDAResult.Success;
  10491. }
  10492. else
  10493. {
  10494. actionResult.Status = (int)Constant.PDAResult.Fail;
  10495. }
  10496. return actionResult;
  10497. }
  10498. // 撤销半检返修
  10499. if (action == "CancelSemiRework")
  10500. {
  10501. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10502. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10503. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  10504. actionResult.Result = resultEntity.Result;
  10505. actionResult.Message = resultEntity.Message;
  10506. if (Convert.ToInt32(resultEntity.Result) > 0)
  10507. {
  10508. actionResult.Status = (int)Constant.PDAResult.Success;
  10509. }
  10510. else
  10511. {
  10512. actionResult.Status = (int)Constant.PDAResult.Fail;
  10513. }
  10514. return actionResult;
  10515. }
  10516. // 获取半检返修数据(PDA编辑用)
  10517. if (action == "GetSemiReworkByID")
  10518. {
  10519. int id = Convert.ToInt32(jsonData);
  10520. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10521. PMModuleLogic.GetSemiReworkByID(id, sUserInfo.UserCode);
  10522. DataTable data1 = resultEntity.Data.Tables[0];
  10523. DataTable data2 = resultEntity.Data.Tables[1];
  10524. DataTable data3 = resultEntity.Data.Tables[2];
  10525. if (data1.Rows.Count == 0)
  10526. {
  10527. actionResult.Status = (int)Constant.PDAResult.Fail;
  10528. actionResult.Message = "半检返修信息不存在";
  10529. return actionResult;
  10530. }
  10531. SemiReworkEntity srEntity = new SemiReworkEntity();
  10532. srEntity.SemiReworkID = id;
  10533. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  10534. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  10535. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  10536. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  10537. foreach (DataRow row2 in data2.Rows)
  10538. {
  10539. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  10540. srEntity.SemiReworkDefects.Add(defectEntity);
  10541. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  10542. defectEntity.SemiReworkID = id;
  10543. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  10544. defectEntity.DefectCode = row2["DefectCode"] + "";
  10545. defectEntity.DefectName = row2["DefectName"] + "";
  10546. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  10547. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  10548. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  10549. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  10550. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  10551. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  10552. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  10553. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  10554. defectEntity.Remarks = row2["Remarks"] + "";
  10555. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  10556. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  10557. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  10558. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  10559. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  10560. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  10561. if (row3s.Length == 0)
  10562. {
  10563. continue;
  10564. }
  10565. foreach (DataRow row3 in row3s)
  10566. {
  10567. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  10568. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  10569. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  10570. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  10571. semiReworkRPS.StaffName = row3["StaffName"] + "";
  10572. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  10573. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  10574. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  10575. semiReworkRPS.UserCode = row3["UserCode"] + "";
  10576. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  10577. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  10578. }
  10579. }
  10580. //xuwei note 总单用于显示,信息较全
  10581. actionResult.Message = JsonHelper.ToJson(data1);
  10582. //xuwei note 总单信息不全,但有明细,用于回传保存
  10583. actionResult.Result = JsonHelper.ToJson(srEntity);
  10584. actionResult.Status = (int)Constant.PDAResult.Success;
  10585. }
  10586. }
  10587. #endregion
  10588. #region 窑车漏扫补件
  10589. if (module == "F_PM_0504")
  10590. {
  10591. // 验证窑车编码是否存在
  10592. if (action == "CheckKilnCar")
  10593. {
  10594. ClientRequestEntity cre = new ClientRequestEntity();
  10595. cre.Properties["kilncarcode"] = data["KilnCarCode"];
  10596. cre.Properties["procedureID"] = data["ProcedureID"];
  10597. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo);
  10598. if (sre.Status == Constant.ServiceResultStatus.Success)
  10599. {
  10600. actionResult.Status = (int)Constant.PDAResult.Success;
  10601. actionResult.Result = sre.Result;
  10602. }
  10603. else
  10604. {
  10605. actionResult.Status = (int)Constant.PDAResult.Fail;
  10606. actionResult.Message = sre.Message;
  10607. }
  10608. return actionResult;
  10609. }
  10610. // 验证窑车烧成批次号是否存在 和 是否能补漏扫
  10611. if (action == "CheckKilnCarBatchNo")
  10612. {
  10613. ClientRequestEntity cre = new ClientRequestEntity();
  10614. cre.Properties["KilnID"] = data["KilnID"];
  10615. cre.Properties["KilnCarID"] = data["KilnCarID"];
  10616. cre.Properties["ProcedureID"] = data["ProcedureID"];
  10617. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10618. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo);
  10619. if (sre.Status == Constant.ServiceResultStatus.Success)
  10620. {
  10621. actionResult.Status = (int)Constant.PDAResult.Success;
  10622. }
  10623. else
  10624. {
  10625. actionResult.Status = (int)Constant.PDAResult.Fail;
  10626. actionResult.Message = sre.Message;
  10627. }
  10628. return actionResult;
  10629. }
  10630. // 窑车漏扫补件
  10631. if (action == "SetKilnCarMissing")
  10632. {
  10633. ClientRequestEntity cre = new ClientRequestEntity();
  10634. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10635. string carData = data["CarData"] + "";
  10636. DataTable dataTable = JsonHelper.FromJson<DataTable>(carData);
  10637. cre.Data = new DataSet();
  10638. cre.Data.Tables.Add(dataTable);
  10639. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo);
  10640. if (sre.Status == Constant.ServiceResultStatus.Success)
  10641. {
  10642. actionResult.Status = (int)Constant.PDAResult.Success;
  10643. }
  10644. else
  10645. {
  10646. actionResult.Status = (int)Constant.PDAResult.Fail;
  10647. actionResult.Message = sre.Message;
  10648. }
  10649. return actionResult;
  10650. }
  10651. }
  10652. #endregion
  10653. #region 梭式窑入窑
  10654. else if (module == "F_PM_0505")
  10655. {
  10656. // 验证窑车编码是否存在
  10657. if (action == "GetAllKilntInfo")
  10658. {
  10659. DataSet dsKilntInfo = SystemModuleLogic.GetAllKilntInfo(sUserInfo);
  10660. if (dsKilntInfo != null && dsKilntInfo.Tables.Count > 0)
  10661. {
  10662. actionResult.Status = (int)Constant.PDAResult.Success;
  10663. actionResult.Result = JsonHelper.ToJson(dsKilntInfo.Tables[0]);
  10664. }
  10665. else
  10666. {
  10667. actionResult.Status = (int)Constant.PDAResult.Fail;
  10668. }
  10669. return actionResult;
  10670. }
  10671. // 保存梭式窑入窑计数
  10672. if (action == "SaveSKBatchNo")
  10673. {
  10674. ClientRequestEntity cre = new ClientRequestEntity();
  10675. cre.Properties["KilnCode"] = data["KilnCode"];
  10676. cre.Properties["Remarks"] = data["Remarks"];
  10677. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SaveSKBatchNo(cre, sUserInfo);
  10678. if (sre.Status == Constant.ServiceResultStatus.Success)
  10679. {
  10680. if (sre.OtherStatus > 0)
  10681. {
  10682. actionResult.Status = (int)Constant.PDAResult.Success;
  10683. }
  10684. else
  10685. {
  10686. actionResult.Status = (int)Constant.PDAResult.Fail;
  10687. actionResult.Message = sre.Message;
  10688. }
  10689. }
  10690. else
  10691. {
  10692. actionResult.Status = (int)Constant.PDAResult.Fail;
  10693. actionResult.Message = sre.Message;
  10694. }
  10695. return actionResult;
  10696. }
  10697. }
  10698. #endregion
  10699. #region 重启3#高压注浆
  10700. else if (module == "F_PM_0107")
  10701. {
  10702. // 查询3#高压注浆线
  10703. if (action == "GetGroutingLine3")
  10704. {
  10705. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.GetGroutingLine3(sUserInfo);
  10706. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10707. {
  10708. actionResult.Status = (int)Constant.PDAResult.Success;
  10709. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  10710. }
  10711. else
  10712. {
  10713. actionResult.Status = (int)Constant.PDAResult.Fail;
  10714. }
  10715. return actionResult;
  10716. }
  10717. // 重置注浆批次
  10718. if (action == "SaveGroutingLine3")
  10719. {
  10720. ClientRequestEntity cre = new ClientRequestEntity();
  10721. cre.Properties["GroutingLineID"] = data["GroutingLineID"];
  10722. cre.Properties["H_BatchNo"] = data["H_BatchNo"];
  10723. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SaveGroutingLine3(cre, sUserInfo);
  10724. if (sre.Status == Constant.ServiceResultStatus.Success)
  10725. {
  10726. if (sre.OtherStatus > 0)
  10727. {
  10728. actionResult.Status = (int)Constant.PDAResult.Success;
  10729. }
  10730. else
  10731. {
  10732. actionResult.Status = (int)Constant.PDAResult.Fail;
  10733. actionResult.Message = sre.Message;
  10734. }
  10735. }
  10736. else
  10737. {
  10738. actionResult.Status = (int)Constant.PDAResult.Fail;
  10739. actionResult.Message = sre.Message;
  10740. }
  10741. return actionResult;
  10742. }
  10743. }
  10744. #endregion
  10745. #region 3#条码打印机(PDA用)
  10746. // 3#配置工位打印机
  10747. else if (module == "01070804")
  10748. {
  10749. // 获取3#条码打印机配置(PDA用)
  10750. if (action == "GetWorkStationPrinter3")
  10751. {
  10752. ServiceResultEntity sre = SystemModuleLogic.GetWorkStationPrinter3(sUserInfo);
  10753. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10754. {
  10755. actionResult.Status = (int)Constant.PDAResult.Success;
  10756. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10757. }
  10758. else
  10759. {
  10760. actionResult.Status = (int)Constant.PDAResult.Fail;
  10761. }
  10762. return actionResult;
  10763. }
  10764. // 保存3#条码打印机配置(PDA用)
  10765. else if (action == "SaveWorkStationPrinter3")
  10766. {
  10767. ClientRequestEntity cre = new ClientRequestEntity();
  10768. cre.Properties["WorkStationID"] = data["WorkStationID"];
  10769. cre.Properties["PrinterID1"] = data["PrinterID1"];
  10770. cre.Properties["PrinterID2"] = data["PrinterID2"];
  10771. cre.Properties["PrinterID3"] = data["PrinterID3"];
  10772. ServiceResultEntity sre = SystemModuleLogic.SaveWorkStationPrinter3(cre, sUserInfo);
  10773. if (sre.Status == Constant.ServiceResultStatus.Success)
  10774. {
  10775. if (sre.OtherStatus > 0)
  10776. {
  10777. actionResult.Status = (int)Constant.PDAResult.Success;
  10778. }
  10779. else
  10780. {
  10781. actionResult.Status = (int)Constant.PDAResult.Fail;
  10782. actionResult.Message = sre.Message;
  10783. }
  10784. }
  10785. else
  10786. {
  10787. actionResult.Status = (int)Constant.PDAResult.Fail;
  10788. actionResult.Message = sre.Message;
  10789. }
  10790. return actionResult;
  10791. }
  10792. }
  10793. // 3#条码打印
  10794. else if (module == "01070805")
  10795. {
  10796. // 获取3#条码打印机配置(PDA用)
  10797. if (action == "GetWorkStationPrinter3")
  10798. {
  10799. ServiceResultEntity sre = SystemModuleLogic.GetWorkStationPrinter3(sUserInfo);
  10800. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10801. {
  10802. actionResult.Status = (int)Constant.PDAResult.Success;
  10803. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10804. }
  10805. else
  10806. {
  10807. actionResult.Status = (int)Constant.PDAResult.Fail;
  10808. }
  10809. return actionResult;
  10810. }
  10811. // 条码打印(PDA用)
  10812. else if (action == "PrintBarcode_3BL")
  10813. {
  10814. ClientRequestEntity cre = new ClientRequestEntity();
  10815. cre.Properties["Barcode"] = data["Barcode"];
  10816. cre.Properties["WorkStationID"] = data["WorkStationID"];
  10817. ServiceResultEntity sre = SystemModuleLogic.PrintBarcode_3BL(cre, sUserInfo);
  10818. if (sre.Status == Constant.ServiceResultStatus.Success)
  10819. {
  10820. if (sre.Result != null)
  10821. {
  10822. actionResult.Status = (int)Constant.PDAResult.Success;
  10823. }
  10824. else
  10825. {
  10826. actionResult.Status = (int)Constant.PDAResult.Fail;
  10827. actionResult.Message = sre.Message;
  10828. }
  10829. }
  10830. else
  10831. {
  10832. actionResult.Status = (int)Constant.PDAResult.Fail;
  10833. actionResult.Message = sre.Message;
  10834. }
  10835. return actionResult;
  10836. }
  10837. }
  10838. // 3#条码补打
  10839. else if (module == "01070806")
  10840. {
  10841. // 获取3#条码打印机配置(PDA用)
  10842. if (action == "GetWorkStationPrinter3")
  10843. {
  10844. ServiceResultEntity sre = SystemModuleLogic.GetWorkStationPrinter3(sUserInfo);
  10845. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10846. {
  10847. actionResult.Status = (int)Constant.PDAResult.Success;
  10848. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10849. }
  10850. else
  10851. {
  10852. actionResult.Status = (int)Constant.PDAResult.Fail;
  10853. }
  10854. return actionResult;
  10855. }
  10856. // 补打3#条码(PDA用)
  10857. else if (action == "PrintBarcode_3BL_B")
  10858. {
  10859. ClientRequestEntity cre = new ClientRequestEntity();
  10860. cre.Properties["Barcode"] = data["Barcode"];
  10861. if (data.ContainsKey("PrinterID1"))
  10862. cre.Properties["PrinterID1"] = data["PrinterID1"];
  10863. if (data.ContainsKey("PrinterID2"))
  10864. cre.Properties["PrinterID2"] = data["PrinterID2"];
  10865. if (data.ContainsKey("PrinterID3"))
  10866. cre.Properties["PrinterID3"] = data["PrinterID3"];
  10867. ServiceResultEntity sre = SystemModuleLogic.PrintBarcode_3BL_B(cre, sUserInfo);
  10868. if (sre.Status == Constant.ServiceResultStatus.Success)
  10869. {
  10870. if (sre.Result != null)
  10871. {
  10872. actionResult.Status = (int)Constant.PDAResult.Success;
  10873. }
  10874. else
  10875. {
  10876. actionResult.Status = (int)Constant.PDAResult.Fail;
  10877. actionResult.Message = sre.Message;
  10878. }
  10879. }
  10880. else
  10881. {
  10882. actionResult.Status = (int)Constant.PDAResult.Fail;
  10883. actionResult.Message = sre.Message;
  10884. }
  10885. return actionResult;
  10886. }
  10887. }
  10888. #endregion
  10889. #region 获取3#成检二检PLC重量
  10890. else if (module == "GetPLCWeight")
  10891. {
  10892. // 获取3#条码打印机配置(PDA用)
  10893. if (action == "GetPLCWeight")
  10894. {
  10895. actionResult.Result = PMModuleLogic.Get3PLCWeight(sUserInfo);
  10896. actionResult.Status = (int)Constant.PDAResult.Success;
  10897. return actionResult;
  10898. }
  10899. }
  10900. #endregion
  10901. #region 注浆绑码时,验证成型线是否能绑码
  10902. else if (module == "CheckGroutingLine")
  10903. {
  10904. if (action == "CheckGroutingLine")
  10905. {
  10906. ServiceResultEntity sre = PDAModuleLogic.CheckGroutingLine(data["GroutingLineCode"] + "");
  10907. if (sre.OtherStatus < 0)
  10908. {
  10909. actionResult.Status = (int)Constant.PDAResult.Fail;
  10910. actionResult.Message = sre.Message;
  10911. }
  10912. else
  10913. {
  10914. actionResult.Status = (int)Constant.PDAResult.Success;
  10915. }
  10916. return actionResult;
  10917. }
  10918. }
  10919. #endregion
  10920. #region 注浆绑码选批次查询最小启用的模具编码
  10921. else if (module == "GetGroutingMouldByBatchNo")
  10922. {
  10923. if (action == "GetGroutingMouldByBatchNo")
  10924. {
  10925. string groutingLineCode = data["groutingLineCode"] + "";
  10926. string groutingDay = data["groutingDay"] + "";
  10927. string groutingBatchNo = data["groutingBatchNo"] + "";
  10928. string groutingMouldCode = data["groutingMouldCode"] + "";
  10929. ServiceResultEntity sre = PDAModuleLogic.GetGroutingMouldByBatchNo(groutingMouldCode, groutingLineCode, groutingDay, groutingBatchNo);
  10930. if (sre.Status == Constant.ServiceResultStatus.Success)
  10931. {
  10932. actionResult.Status = (int)Constant.PDAResult.Success;
  10933. actionResult.Result = JsonHelper.ToJson(sre.Result);
  10934. actionResult.Message = sre.Message;
  10935. }
  10936. else
  10937. {
  10938. actionResult.Status = (int)Constant.PDAResult.Fail;
  10939. actionResult.Result = sre.OtherStatus;
  10940. actionResult.Message = sre.Message;
  10941. }
  10942. return actionResult;
  10943. }
  10944. }
  10945. #endregion
  10946. #region 3#半检一检交坯
  10947. else if (module == "SemiQualityStatistics")
  10948. {
  10949. if (action == "SemiQualityStatisticsDeliver3")
  10950. {
  10951. ServiceResultEntity sre = PMModuleLogicDAL.SemiQualityStatisticsDeliver3(data, sUserInfo);
  10952. if (sre.OtherStatus < 0)
  10953. {
  10954. actionResult.Status = (int)Constant.PDAResult.Fail;
  10955. actionResult.Message = sre.Message;
  10956. }
  10957. else
  10958. {
  10959. actionResult.Status = (int)Constant.PDAResult.Success;
  10960. }
  10961. return actionResult;
  10962. }
  10963. }
  10964. #endregion
  10965. #region 产品分级(3车间)
  10966. else if (module == "0628")
  10967. {
  10968. if (action == "CheckOneLevelType")
  10969. {
  10970. string barcode = data["Barcode"] + "";
  10971. ServiceResultEntity sre = PDAModuleLogic.CheckOneLevelType(barcode);
  10972. if (sre.OtherStatus < 0)
  10973. {
  10974. actionResult.Status = (int)Constant.PDAResult.Fail;
  10975. actionResult.Message = sre.Message;
  10976. }
  10977. else
  10978. {
  10979. actionResult.Status = (int)Constant.PDAResult.Success;
  10980. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  10981. }
  10982. return actionResult;
  10983. }
  10984. if (action == "SaveOneLevelType")
  10985. {
  10986. int? levelTypeID = data["LevelTypeID"].ToNullableInt32();
  10987. string barcode = data["Barcode"] + "";
  10988. ServiceResultEntity sre = PDAModuleLogic.SaveOneLevelType(levelTypeID, barcode);
  10989. if (sre.OtherStatus < 0)
  10990. {
  10991. actionResult.Status = (int)Constant.PDAResult.Fail;
  10992. actionResult.Message = sre.Message;
  10993. }
  10994. else
  10995. {
  10996. actionResult.Status = (int)Constant.PDAResult.Success;
  10997. }
  10998. return actionResult;
  10999. }
  11000. }
  11001. #endregion
  11002. #region 半检查询责任工序(3车间)
  11003. else if (module == "GetDutyProcedureByBarCode3")
  11004. {
  11005. if (action == "GetDutyProcedureByBarCode3")
  11006. {
  11007. string barcode = data["barcode"] + "";
  11008. int defectid = Convert.ToInt32(data["defectid"] + "");
  11009. int procedureid = Convert.ToInt32(data["procedureid"] + "");
  11010. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  11011. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID, procedureid));
  11012. if (dutyProcedureDs != null)
  11013. {
  11014. actionResult.Status = (int)Constant.PDAResult.Success;
  11015. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  11016. }
  11017. else
  11018. {
  11019. actionResult.Status = (int)Constant.PDAResult.Fail;
  11020. }
  11021. return actionResult;
  11022. }
  11023. }
  11024. #endregion
  11025. #region 成品检验
  11026. if (module == "ProductionData")
  11027. {
  11028. //扫码查询
  11029. if (action == "CheckBarcode")
  11030. {
  11031. string barcode = data["barcode"] + "";
  11032. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.GetProductionID(barcode);
  11033. int procedureID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["finishedcheckprocedureid"]);
  11034. sre = Service.PCModuleService.FinishedCheckLogic.CheckBarcode(procedureID, barcode, sUserInfo);
  11035. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  11036. if (Convert.ToInt32(sre.Result) < 0)
  11037. {
  11038. actionResult.Status = (int)Constant.PDAResult.Fail;
  11039. actionResult.Result = sre.OtherStatus; //漏扫1,反之0
  11040. actionResult.Message = sre.Message;
  11041. }
  11042. else
  11043. {
  11044. actionResult.Result = JsonHelper.ToJson(sre.Data);
  11045. actionResult.Status = (int)Constant.PDAResult.Success;
  11046. actionResult.Message = sre.Message;
  11047. }
  11048. return actionResult;
  11049. }
  11050. //撤销查询
  11051. if (action == "GetFinishedCancleData")
  11052. {
  11053. string barcode = data["barcode"] + "";
  11054. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.GetFinishedCancleData(barcode, sUserInfo);
  11055. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  11056. if (Convert.ToInt32(sre.Result) < 0)
  11057. {
  11058. actionResult.Status = (int)Constant.PDAResult.Fail;
  11059. actionResult.Result = sre.OtherStatus; //漏扫1,反之0
  11060. actionResult.Message = sre.Message;
  11061. }
  11062. else
  11063. {
  11064. actionResult.Result = JsonHelper.ToJson(sre.Data);
  11065. actionResult.Status = (int)Constant.PDAResult.Success;
  11066. actionResult.Message = sre.Message;
  11067. }
  11068. return actionResult;
  11069. }
  11070. //保存成品检验
  11071. if (action == "AddCheckBarcode")
  11072. {
  11073. int procedureID = Convert.ToInt32(data["procedureID"]);
  11074. //DataTable TableProductionData = JsonHelper.FromJson<DataTable>(data["productionData"] + "");
  11075. //缺陷
  11076. //DataTable productionDefectTable = JsonHelper.FromJson<DataTable>(data["productionDefectTable"] + "");
  11077. //责任员工
  11078. //DataTable DSTableStaff = JsonHelper.FromJson<DataTable>(data["dSTableStaff"] + "");
  11079. //漏检员工
  11080. //DataTable DSTableMissedStaff = JsonHelper.FromJson<DataTable>(data["dSTableMissedStaff"] + "");
  11081. //图片
  11082. //DataTable DSTableImage = JsonHelper.FromJson<DataTable>(data["dSTableImage"] + "");
  11083. //ProductionDataEntity[] productionDataEntitys = new ProductionDataEntity[TableProductionData.Rows.Count];
  11084. #region 转换实体
  11085. //for (int i = 0; i < TableProductionData.Rows.Count; i++)
  11086. //{
  11087. // if (TableProductionData.Rows[i]["ReadOnly"].ToString() == "1") //只读数据不进行保存
  11088. // {
  11089. // continue;
  11090. // }
  11091. // ProductionDataEntity productionDataEntity = new ProductionDataEntity();
  11092. // if (TableProductionData.Rows[i]["ProductionDataID"].ToString() != "")
  11093. // {
  11094. // productionDataEntity.ProductionDataID = Convert.ToInt32(TableProductionData.Rows[i]["ProductionDataID"]);
  11095. // }
  11096. // productionDataEntity.Barcode = TableProductionData.Rows[i]["BarCode"].ToString();
  11097. // productionDataEntity.UserID = sUserInfo.UserID;
  11098. // productionDataEntity.UserCode = sUserInfo.UserCode;
  11099. // productionDataEntity.UserName = sUserInfo.UserName; ;
  11100. // productionDataEntity.DefectFlag = Convert.ToInt32(TableProductionData.Rows[i]["GoodsLevelTypeID"]) == 4 ? 1 : 2;
  11101. // productionDataEntity.GoodsLevelID = Convert.ToInt32(TableProductionData.Rows[i]["DefectFlagID"]);
  11102. // productionDataEntity.GoodsLevelTypeID = Convert.ToInt32(TableProductionData.Rows[i]["GoodsLevelTypeID"]);
  11103. // productionDataEntity.Remarks = TableProductionData.Rows[i]["Remarks"].ToString();
  11104. // if (TableProductionData.Rows[i]["LogoID"].ToString() != "")
  11105. // {
  11106. // productionDataEntity.LogoID = Convert.ToInt32(TableProductionData.Rows[i]["LogoID"]);
  11107. // }
  11108. // if (TableProductionData.Rows[i]["OPTimeStamp"].ToString() != "")
  11109. // {
  11110. // productionDataEntity.OPTimeStamp = Convert.ToDateTime(TableProductionData.Rows[i]["OPTimeStamp"]);
  11111. // }
  11112. // if (TableProductionData.Rows[i]["CheckTime"].ToString() != "")
  11113. // {
  11114. // productionDataEntity.CheckTime = Convert.ToDateTime(TableProductionData.Rows[i]["CheckTime"]);
  11115. // }
  11116. // if (TableProductionData.Rows[i]["OrgGoodsLevelTypeID"].ToString() != "-1")
  11117. // {
  11118. // productionDataEntity.OrgGoodsLevelTypeID = Convert.ToInt32(TableProductionData.Rows[i]["OrgGoodsLevelTypeID"]);
  11119. // }
  11120. // if (!string.IsNullOrEmpty(TableProductionData.Rows[i]["ReworkProcedureID"].ToString()))
  11121. // {
  11122. // productionDataEntity.ReworkProcedureID = int.Parse(TableProductionData.Rows[i]["ReworkProcedureID"].ToString());
  11123. // productionDataEntity.IsReworked = 1;
  11124. // }
  11125. // productionDataEntitys[i] = productionDataEntity;
  11126. // List<ProductionDefectEntity> productionDefectEntitys = new List<ProductionDefectEntity>();
  11127. // ProductionDefectEntity productionDefectEntity = null;
  11128. // for (int j = 0; j < productionDefectTable.Rows.Count; j++) //缺陷列表
  11129. // {
  11130. // productionDefectEntity = new ProductionDefectEntity();
  11131. // productionDefectEntity.SpecialDefect = productionDefectTable.Rows[j]["IsOtherDefect"].ToString();
  11132. // //if (productionDefectTable.Rows[j]["DefectDeductionID"].ToString() != "-1"
  11133. // // && productionDefectTable.Rows[j]["DefectDeductionID"].ToString() != string.Empty)
  11134. // //{
  11135. // // productionDefectEntity.DefectDeductionNum = Convert.ToDecimal(productionDefectTable.Rows[j]["DefectDeductionNum"]);
  11136. // //}
  11137. // if (!string.IsNullOrEmpty(productionDefectTable.Rows[j]["DefectDeductionNum"] + ""))
  11138. // {
  11139. // productionDefectEntity.DefectDeductionNum = Convert.ToDecimal(productionDefectTable.Rows[j]["DefectDeductionNum"]);
  11140. // }
  11141. // productionDefectEntity.ScrapResponFlag = "0";
  11142. // productionDefectEntity.DefectID =
  11143. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectID"]);
  11144. // productionDefectEntity.DefectCode =
  11145. // productionDefectTable.Rows[j]["DefectCode"].ToString();
  11146. // productionDefectEntity.DefectName =
  11147. // productionDefectTable.Rows[j]["DefectName"].ToString().Replace(productionDefectEntity.DefectCode + "->", "");
  11148. // productionDefectEntity.DefectPositionID =
  11149. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectPositionID"]);
  11150. // productionDefectEntity.DefectPositionCode =
  11151. // productionDefectTable.Rows[j]["DefectPositionCode"].ToString();
  11152. // productionDefectEntity.DefectPositionName =
  11153. // productionDefectTable.Rows[j]["DefectPositionName"].ToString().Replace(productionDefectEntity.DefectPositionCode + "->", "");
  11154. // productionDefectEntity.DefectProductionDataID =
  11155. // Convert.ToInt32(productionDefectTable.Rows[j]["ProductionDataID"] + "");
  11156. // if (productionDefectEntity.DefectProductionDataID == 0)
  11157. // {
  11158. // productionDefectEntity.DefectProductionDataID = null;
  11159. // }
  11160. // if (productionDefectTable.Rows[j]["DefectProcedureID"].ToString() != string.Empty &&
  11161. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectProcedureID"] + "") > Constant.INT_IS_ZERO)
  11162. // {
  11163. // productionDefectEntity.DefectProcedureID =
  11164. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectProcedureID"]);
  11165. // }
  11166. // productionDefectEntity.DefectProcedureCode =
  11167. // productionDefectTable.Rows[j]["DefectProcedureCode"].ToString();
  11168. // productionDefectEntity.DefectProcedureName =
  11169. // productionDefectTable.Rows[j]["DefectProcedureName"].ToString();
  11170. // productionDefectEntity.DefectUserID =
  11171. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectUserID"]);
  11172. // productionDefectEntity.DefectUserCode =
  11173. // productionDefectTable.Rows[j]["DefectUserCode"].ToString();
  11174. // productionDefectEntity.DefectUserName =
  11175. // productionDefectTable.Rows[j]["DefectUserName"].ToString();
  11176. // productionDefectEntity.DefectJobs =
  11177. // Convert.ToInt32(productionDefectTable.Rows[j]["Jobs"].ToString());
  11178. // productionDefectEntity.Remarks =
  11179. // productionDefectTable.Rows[j]["DefectRemarks"].ToString();
  11180. // productionDefectEntity.Remarks =
  11181. // productionDefectTable.Rows[j]["DefectRemarks"].ToString();
  11182. // if (productionDefectTable.Rows[j]["DefectFineID"].ToString() != "-1"
  11183. // && productionDefectTable.Rows[j]["DefectFineID"].ToString() != string.Empty)
  11184. // {
  11185. // productionDefectEntity.DefectFine = Convert.ToInt32(productionDefectTable.Rows[j]["DefectFineID"]);
  11186. // }
  11187. // if (productionDefectTable.Rows[j]["CheckTime"].ToString() != string.Empty)
  11188. // {
  11189. // //if (Convert.ToInt32(this.TableProductionData.Rows[i]["OrgGoodsLevelTypeID"]) == Convert.ToInt32(this.TableProductionData.Rows[i]["GoodsLevelTypeID"]))
  11190. // //{
  11191. // productionDefectEntity.CheckTime = Convert.ToDateTime(productionDefectTable.Rows[j]["CheckTime"]);
  11192. // //}
  11193. // }
  11194. // if (productionDefectTable.Rows[j]["MissedUserID"].ToString() != "-1"
  11195. // && productionDefectTable.Rows[j]["MissedUserID"].ToString() != string.Empty)
  11196. // {
  11197. // productionDefectEntity.MissedUserID = Convert.ToInt32(productionDefectTable.Rows[j]["MissedUserID"]);
  11198. // productionDefectEntity.MissedUserCode = productionDefectTable.Rows[j]["MissedUserCode"].ToString();
  11199. // productionDefectEntity.MissedUserName = productionDefectTable.Rows[j]["MissedUserName"].ToString();
  11200. // }
  11201. // // 遍历责任员工
  11202. // List<DefectResponsibleEntity> DefectResponsibles = new List<DefectResponsibleEntity>();
  11203. // if (DSTableStaff != null && DSTableStaff.Rows.Count > 0)
  11204. // {
  11205. // DefectResponsibleEntity defectResponsibleEntity = null;
  11206. // foreach (DataRow drStaff in DSTableStaff.Rows)
  11207. // {
  11208. // if (Convert.ToInt32(drStaff["IsSelected"]) == Constant.INT_IS_ONE)
  11209. // {
  11210. // defectResponsibleEntity = new DefectResponsibleEntity();
  11211. // defectResponsibleEntity.StaffID = Convert.ToInt32(drStaff["StaffID"]);
  11212. // defectResponsibleEntity.UserID = Convert.ToInt32(productionDefectEntity.DefectUserID);
  11213. // defectResponsibleEntity.UserCode = productionDefectEntity.DefectUserCode;
  11214. // defectResponsibleEntity.UJobsID =
  11215. // Convert.ToInt32(productionDefectTable.Rows[j]["Jobs"].ToString());
  11216. // defectResponsibleEntity.SJobsID =
  11217. // Convert.ToInt32(productionDefectTable.Rows[j]["Jobs"].ToString());
  11218. // defectResponsibleEntity.StaffStatus = Convert.ToInt32(drStaff["StaffStatus"]);
  11219. // DefectResponsibles.Add(defectResponsibleEntity);
  11220. // }
  11221. // }
  11222. // //productionDefectEntity.DefectResponsibles = DefectResponsibles.ToArray();//每个缺陷对应的责任员工
  11223. // productionDefectEntity.DefectResponsibles = DefectResponsibles;//每个缺陷对应的责任员工
  11224. // }
  11225. // // 遍历漏检责任员工
  11226. // List<DefectMissedResponsibleEntity> DefectMissedResponsibles = new List<DefectMissedResponsibleEntity>();
  11227. // if (DSTableMissedStaff != null && DSTableMissedStaff.Rows.Count > 0)
  11228. // {
  11229. // DefectMissedResponsibleEntity defectMissedResponsibleEntity = null;
  11230. // foreach (DataRow drStaff in DSTableMissedStaff.Rows)
  11231. // {
  11232. // if (Convert.ToInt32(drStaff["IsSelected"]) == Constant.INT_IS_ONE)
  11233. // {
  11234. // defectMissedResponsibleEntity = new DefectMissedResponsibleEntity();
  11235. // defectMissedResponsibleEntity.StaffID = Convert.ToInt32(drStaff["StaffID"]);
  11236. // defectMissedResponsibleEntity.UserID = Convert.ToInt32(productionDefectEntity.DefectUserID);
  11237. // defectMissedResponsibleEntity.UserCode = productionDefectEntity.DefectUserCode;
  11238. // defectMissedResponsibleEntity.UJobsID = Convert.ToInt32(drStaff["UJobsID"]);
  11239. // defectMissedResponsibleEntity.SJobsID = Convert.ToInt32(drStaff["SJobsID"]);
  11240. // defectMissedResponsibleEntity.StaffStatus = Convert.ToInt32(drStaff["StaffStatus"]);
  11241. // DefectMissedResponsibles.Add(defectMissedResponsibleEntity);
  11242. // }
  11243. // }
  11244. // //productionDefectEntity.DefectMissedResponsibles = DefectMissedResponsibles.ToArray();
  11245. // productionDefectEntity.DefectMissedResponsibles = DefectMissedResponsibles;
  11246. // }
  11247. // // 遍历缺陷图片
  11248. // if (DSTableImage != null && DSTableImage.Rows.Count > 0)
  11249. // {
  11250. // List<DefectImageEntity> defectImageEntitys = new List<DefectImageEntity>();
  11251. // DefectImageEntity defectImageEntity = null;
  11252. // foreach (DataRow drImage in DSTableImage.Rows)
  11253. // {
  11254. // defectImageEntity = new DefectImageEntity();
  11255. // defectImageEntity.Thumbnail = (byte[])drImage["ImageByte"];
  11256. // defectImageEntity.Image = (byte[])drImage["orgImageByte"];
  11257. // defectImageEntitys.Add(defectImageEntity);
  11258. // }
  11259. // productionDefectEntity.DefectImages = defectImageEntitys;
  11260. // }
  11261. // productionDefectEntitys.Add(productionDefectEntity);
  11262. // }
  11263. // productionDataEntitys[i].ProductionDefects = productionDefectEntitys;
  11264. // }
  11265. #endregion
  11266. ProductionDataEntity[] productionDataEntitys = JsonHelper.FromJson<ProductionDataEntity[]>(data["productionDataEntitys"] + "");
  11267. DataTable bomDetailTable = new DataTable();
  11268. if (data["bomDetailTable"] != null)
  11269. {
  11270. bomDetailTable = JsonHelper.FromJson<DataTable>(data["bomDetailTable"] + "");
  11271. }
  11272. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.AddCheckBarcode(procedureID, productionDataEntitys, bomDetailTable, sUserInfo);
  11273. if (Convert.ToInt32(sre.Result) > 0)
  11274. {
  11275. actionResult.Status = (int)Constant.PDAResult.Success;
  11276. actionResult.Message = "保存成功";
  11277. }
  11278. else
  11279. {
  11280. actionResult.Status = (int)Constant.PDAResult.Fail;
  11281. actionResult.Message = sre.Message;
  11282. }
  11283. return actionResult;
  11284. }
  11285. //撤销
  11286. if (action == "FinishedCancleData")
  11287. {
  11288. int productionDataID = Convert.ToInt32(data["productionDataID"]);
  11289. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.FinishedCancleData(productionDataID, sUserInfo);
  11290. if (Convert.ToInt32(sre.OtherStatus) > 0)
  11291. {
  11292. actionResult.Status = (int)Constant.PDAResult.Success;
  11293. actionResult.Message = "撤销成功";
  11294. }
  11295. else
  11296. {
  11297. actionResult.Status = (int)Constant.PDAResult.Fail;
  11298. actionResult.Message = sre.Message;
  11299. }
  11300. return actionResult;
  11301. }
  11302. //查询用户
  11303. if (action == "CheckProcedureUser")
  11304. {
  11305. string userCode1 = data["UserCode"] + "";
  11306. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.CheckProcedureUser(userCode1, sUserInfo);
  11307. if (Convert.ToInt32(sre.Result) < 0)
  11308. {
  11309. actionResult.Status = (int)Constant.PDAResult.Fail;
  11310. actionResult.Result = sre.OtherStatus;
  11311. actionResult.Message = sre.Message;
  11312. }
  11313. else
  11314. {
  11315. actionResult.Result = JsonHelper.ToJson(sre.Data);
  11316. actionResult.Status = (int)Constant.PDAResult.Success;
  11317. actionResult.Message = sre.Message;
  11318. }
  11319. return actionResult;
  11320. }
  11321. }
  11322. #endregion
  11323. #region BPM同步日志 add xiacm 2022-11-17
  11324. else if (module == "BARCODEIDNRKSCRAP")
  11325. {
  11326. if (action == "GetBarcodeIdnrkScrap")
  11327. {
  11328. //组件唯一编码
  11329. string IdnrkOnlyCode = data["IdnrkOnlyCode"].ToString();
  11330. // 确认日期
  11331. DateTime createTime = DateTime.Now.Date;
  11332. if (data.ContainsKey("CreateTime") && !string.IsNullOrEmpty(data["CreateTime"] + ""))
  11333. {
  11334. createTime = Convert.ToDateTime(data["CreateTime"].ToString());
  11335. }
  11336. // 确认标识(1:确认;2:撤销)
  11337. string confirmFlag = data["ConfirmFlag"].ToString();
  11338. string message = string.Empty;
  11339. DataSet IdnrkOnlyCodeDs = ServiceInvoker.Invoke(this,
  11340. () => PMModuleLogic.GetIdnrkOnlyCode(IdnrkOnlyCode, createTime, confirmFlag, sUserInfo, out message));
  11341. if (IdnrkOnlyCodeDs != null)
  11342. {
  11343. if (string.IsNullOrEmpty(message))
  11344. {
  11345. actionResult.Status = (int)Constant.PDAResult.Success;
  11346. actionResult.Result = JsonHelper.ToJson(IdnrkOnlyCodeDs);
  11347. }
  11348. else
  11349. {
  11350. actionResult.Status = (int)Constant.PDAResult.Fail;
  11351. actionResult.Message = message;
  11352. }
  11353. }
  11354. else
  11355. {
  11356. actionResult.Status = (int)Constant.PDAResult.Fail;
  11357. actionResult.Message = message;
  11358. }
  11359. return actionResult;
  11360. }
  11361. if (action == "ConfirmBarcodeIdnrkScrap")
  11362. {
  11363. ClientRequestEntity cre = new ClientRequestEntity();
  11364. DataTable dtBarcodeIdnrkScrap = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  11365. DateTime createTime = DateTime.Now.Date;
  11366. if (data.ContainsKey("CreateTime") && !string.IsNullOrEmpty(data["CreateTime"] + ""))
  11367. {
  11368. createTime = Convert.ToDateTime(data["CreateTime"].ToString());
  11369. }
  11370. cre.Data = new DataSet();
  11371. cre.Data.Tables.Add(dtBarcodeIdnrkScrap);
  11372. // 确认日期
  11373. cre.Properties["CreateTime"] = createTime;
  11374. // 确认标识(1:确认;2:撤销)
  11375. cre.Properties["ConfirmFlag"] = data["ConfirmFlag"].ToString();
  11376. if (dtBarcodeIdnrkScrap != null && dtBarcodeIdnrkScrap.Rows.Count > 0)
  11377. {
  11378. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11379. () => PMModuleLogic.ConfirmBarcodeIdnrkScrap(cre, sUserInfo));
  11380. if (Convert.ToInt32(sre.Result) <= 0)
  11381. {
  11382. actionResult.Status = (int)Constant.PDAResult.Fail;
  11383. actionResult.Message = sre.Message;
  11384. }
  11385. else
  11386. {
  11387. actionResult.Status = (int)Constant.PDAResult.Success;
  11388. actionResult.Message = "保存成功";
  11389. }
  11390. }
  11391. else
  11392. {
  11393. actionResult.Status = (int)Constant.PDAResult.Fail;
  11394. }
  11395. return actionResult;
  11396. }
  11397. }
  11398. #endregion
  11399. #region 次品扫描功能 20230406 by qq
  11400. if (module == "Recycling")
  11401. {
  11402. //扫码查询
  11403. if (action == "RecyclingAddBarcode")
  11404. {
  11405. string barcode = data["barcode"] + "";
  11406. string type = data["type"] + "";
  11407. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11408. () => PMModuleLogic.RecyclingAddBarcode(barcode, type, sUserInfo));
  11409. if (Convert.ToInt32(sre.Result) <= 0)
  11410. {
  11411. actionResult.Status = (int)Constant.PDAResult.Fail;
  11412. actionResult.Message = sre.Message;
  11413. }
  11414. else
  11415. {
  11416. actionResult.Status = (int)Constant.PDAResult.Success;
  11417. actionResult.Message = "保存成功";
  11418. }
  11419. return actionResult;
  11420. }
  11421. }
  11422. #endregion
  11423. #region 裸瓷包装状态撤销(非工序) by qq
  11424. if (module == "LuociRevoke")
  11425. {
  11426. //扫码查询
  11427. if (action == "CheckLuoci")
  11428. {
  11429. string barcode = data["barcode"] + "";
  11430. int procedureID = 159;
  11431. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11432. () => PMModuleLogic.CheckLuoci(procedureID, barcode, sUserInfo));
  11433. if (sre.OtherStatus < 0)
  11434. {
  11435. actionResult.Status = (int)Constant.PDAResult.Fail;
  11436. actionResult.Message = sre.Message;
  11437. }
  11438. else
  11439. {
  11440. actionResult.Status = (int)Constant.PDAResult.Success;
  11441. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  11442. }
  11443. return actionResult;
  11444. }
  11445. //撤销保存
  11446. else if (action == "AddChancelLuoci")
  11447. {
  11448. DataTable detailTable = new DataTable();
  11449. if (data["detailTable"] != null)
  11450. {
  11451. detailTable = JsonHelper.FromJson<DataTable>(data["detailTable"] + "");
  11452. }
  11453. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11454. () => PMModuleLogic.AddChancelLuoci(detailTable, sUserInfo));
  11455. if (Convert.ToInt32(sre.Result) < 0)
  11456. {
  11457. actionResult.Status = (int)Constant.PDAResult.Fail;
  11458. actionResult.Message = sre.Message;
  11459. }
  11460. else
  11461. {
  11462. actionResult.Status = (int)Constant.PDAResult.Success;
  11463. }
  11464. return actionResult;
  11465. }
  11466. }
  11467. #endregion
  11468. #region 裸瓷产成品交接 by qq
  11469. if (module == "LCFinishedProduct")
  11470. {
  11471. #region 裸瓷交接、整板撤销 by qq 20250521
  11472. // 交接验证
  11473. if (action == "LCFinishedHandoverBarcode")
  11474. {
  11475. string barcode = data["Barcode"] + "";
  11476. ServiceResultEntity sre = PMModuleLogic.LCFinishedHandoverBarcode(barcode, sUserInfo);
  11477. if (sre.Data != null && sre.Data.Tables.Count > 0)
  11478. {
  11479. actionResult.Status = (int)Constant.PDAResult.Success;
  11480. actionResult.Result = JsonHelper.ToJson(sre.Data);
  11481. actionResult.Message = sre.Message;
  11482. }
  11483. else
  11484. {
  11485. actionResult.Status = (int)Constant.PDAResult.Fail;
  11486. actionResult.Message = sre.Message;
  11487. }
  11488. return actionResult;
  11489. }
  11490. // 交接操作
  11491. if (action == "LCSaveFinishedHandover")
  11492. {
  11493. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  11494. ServiceResultEntity sre = PMModuleLogicDAL.LCSaveFinishedHandover(dt, sUserInfo);
  11495. //结束
  11496. if (Convert.ToInt32(sre.Result) > 0)
  11497. {
  11498. actionResult.Status = (int)Constant.PDAResult.Success;
  11499. actionResult.Message = "裸瓷交接成功";
  11500. }
  11501. else
  11502. {
  11503. actionResult.Status = (int)Constant.PDAResult.Fail;
  11504. actionResult.Message = sre.Message;
  11505. }
  11506. return actionResult;
  11507. }
  11508. // 撤销交接验证
  11509. if (action == "LCBackFinishedHandoverCheck")
  11510. {
  11511. string barcode = data["Barcode"] + "";
  11512. ServiceResultEntity sre = PMModuleLogic.LCBackFinishedHandoverCheck(barcode, sUserInfo);
  11513. if (sre.Data != null && sre.Data.Tables.Count > 0)
  11514. {
  11515. actionResult.Status = (int)Constant.PDAResult.Success;
  11516. actionResult.Result = JsonHelper.ToJson(sre.Data);
  11517. actionResult.Message = sre.Message;
  11518. }
  11519. else
  11520. {
  11521. actionResult.Status = (int)Constant.PDAResult.Fail;
  11522. actionResult.Message = sre.Message;
  11523. }
  11524. return actionResult;
  11525. }
  11526. // 撤销交接操作
  11527. if (action == "LCBackFinishedHandover")
  11528. {
  11529. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  11530. ServiceResultEntity sre = PMModuleLogicDAL.LCBackFinishedHandover(dt, sUserInfo);
  11531. if (Convert.ToInt32(sre.Result) > 0)
  11532. {
  11533. actionResult.Status = (int)Constant.PDAResult.Success;
  11534. actionResult.Message = "产成品撤销交接成功";
  11535. }
  11536. else
  11537. {
  11538. actionResult.Status = (int)Constant.PDAResult.Fail;
  11539. actionResult.Message = sre.Message;
  11540. }
  11541. return actionResult;
  11542. }
  11543. #endregion
  11544. }
  11545. #endregion
  11546. return actionResult;
  11547. }
  11548. catch (Exception ex)
  11549. {
  11550. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11551. OutputLog.TraceLog(LogPriority.Error,
  11552. this.ToString(),
  11553. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  11554. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  11555. " module:" + module + " action:" + action + " json:" + jsonData,
  11556. ex.ToString(),
  11557. LocalPath.LogExePath);
  11558. actionResult.Status = (int)Constant.PDAResult.Exception;
  11559. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11560. }
  11561. return actionResult;
  11562. }
  11563. #endregion
  11564. #region 发货单一览
  11565. /// <summary>
  11566. /// 发货单信息查询
  11567. /// </summary>
  11568. /// <param name="accountCode"></param>
  11569. /// <param name="userCode"></param>
  11570. /// <param name="userPassword"></param>
  11571. /// <param name="sessionKey"></param>
  11572. /// <param name="ementy"></param>
  11573. /// <returns></returns>
  11574. public ActionResult SelectDeliveryNoteInquiry(string accountCode, string userCode, string userPassword, string sessionKey, DeliveryNoteInquiry ementy)
  11575. {
  11576. ActionResult actionResult = new ActionResult();
  11577. try
  11578. {
  11579. // 验证请求头信息
  11580. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  11581. // 验证失败
  11582. if (actionResult.Status != (int)Constant.PDAResult.Success)
  11583. {
  11584. return actionResult;
  11585. }
  11586. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11587. () => PMModuleLogicDAL.GetDetails(ementy));
  11588. if (resultEntity.OtherStatus == -1)
  11589. {
  11590. actionResult.Status = (int)Constant.PDAResult.Fail;
  11591. }
  11592. else
  11593. {
  11594. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  11595. actionResult.Status = (int)Constant.PDAResult.Success;
  11596. }
  11597. actionResult.Message = resultEntity.Message;
  11598. }
  11599. catch (Exception ex)
  11600. {
  11601. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11602. OutputLog.TraceLog(LogPriority.Error,
  11603. this.ToString(),
  11604. System.Reflection.MethodBase.GetCurrentMethod().Name,
  11605. ex.ToString(),
  11606. LocalPath.LogExePath);
  11607. actionResult.Status = (int)Constant.PDAResult.Exception;
  11608. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11609. }
  11610. return actionResult;
  11611. }
  11612. /// <summary>
  11613. /// 查询发出仓库,接收仓库,车牌号
  11614. /// </summary>
  11615. /// <param name="type"></param>
  11616. /// <returns></returns>
  11617. public ActionResult SelectCARPLATENAMES(string type)
  11618. {
  11619. ActionResult actionResult = new ActionResult();
  11620. try
  11621. {
  11622. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11623. () => PMModuleLogicDAL.GetDATA(type));
  11624. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  11625. if (resultEntity.Data.Tables[0].Rows.Count == 0)
  11626. {
  11627. actionResult.Status = (int)Constant.PDAResult.Fail;
  11628. }
  11629. else
  11630. {
  11631. actionResult.Status = (int)Constant.PDAResult.Success;
  11632. }
  11633. actionResult.Message = resultEntity.Message;
  11634. }
  11635. catch (Exception ex)
  11636. {
  11637. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11638. OutputLog.TraceLog(LogPriority.Error,
  11639. this.ToString(),
  11640. System.Reflection.MethodBase.GetCurrentMethod().Name,
  11641. ex.ToString(),
  11642. LocalPath.LogExePath);
  11643. actionResult.Status = (int)Constant.PDAResult.Exception;
  11644. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11645. }
  11646. return actionResult;
  11647. }
  11648. /// <summary>
  11649. /// 刪除订单
  11650. /// </summary>
  11651. /// <param name="accountCode"></param>
  11652. /// <param name="userCode"></param>
  11653. /// <param name="userPassword"></param>
  11654. /// <param name="sessionKey"></param>
  11655. /// <param name="ementy"></param>
  11656. /// <returns></returns>
  11657. public ActionResult DestroyInvoice(string accountCode, string userCode, string userPassword, string sessionKey, string ementy)
  11658. {
  11659. ActionResult actionResult = new ActionResult();
  11660. try
  11661. {
  11662. // 验证请求头信息
  11663. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  11664. // 验证失败
  11665. if (actionResult.Status != (int)Constant.PDAResult.Success)
  11666. {
  11667. return actionResult;
  11668. }
  11669. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11670. () => PMModuleLogicDAL.DestroyInvoice(ementy, userCode, userPassword));
  11671. actionResult.Result = JsonHelper.ToJson(resultEntity.Result);
  11672. actionResult.Status = (int)Constant.PDAResult.Success;
  11673. actionResult.Message = resultEntity.Message;
  11674. }
  11675. catch (Exception ex)
  11676. {
  11677. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11678. OutputLog.TraceLog(LogPriority.Error,
  11679. this.ToString(),
  11680. System.Reflection.MethodBase.GetCurrentMethod().Name,
  11681. ex.ToString(),
  11682. LocalPath.LogExePath);
  11683. actionResult.Status = (int)Constant.PDAResult.Exception;
  11684. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11685. }
  11686. return actionResult;
  11687. }
  11688. /// <summary>
  11689. /// 撤销订单
  11690. /// </summary>
  11691. /// <param name="accountCode"></param>
  11692. /// <param name="userCode"></param>
  11693. /// <param name="userPassword"></param>
  11694. /// <param name="sessionKey"></param>
  11695. /// <param name="ementy"></param>
  11696. /// <returns></returns>
  11697. public ActionResult RevokeInvoice(string accountCode, string userCode, string userPassword, string sessionKey, string ementy)
  11698. {
  11699. ActionResult actionResult = new ActionResult();
  11700. try
  11701. {
  11702. // 验证请求头信息
  11703. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  11704. // 验证失败
  11705. if (actionResult.Status != (int)Constant.PDAResult.Success)
  11706. {
  11707. return actionResult;
  11708. }
  11709. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11710. () => PMModuleLogicDAL.RevokeInvoice(ementy, userCode, userPassword));
  11711. if (resultEntity.OtherStatus == -1)
  11712. {
  11713. actionResult.Status = (int)Constant.PDAResult.Fail;
  11714. }
  11715. else
  11716. {
  11717. actionResult.Result = JsonHelper.ToJson(resultEntity.Result);
  11718. actionResult.Status = (int)Constant.PDAResult.Success;
  11719. }
  11720. actionResult.Message = resultEntity.Message;
  11721. }
  11722. catch (Exception ex)
  11723. {
  11724. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11725. OutputLog.TraceLog(LogPriority.Error,
  11726. this.ToString(),
  11727. System.Reflection.MethodBase.GetCurrentMethod().Name,
  11728. ex.ToString(),
  11729. LocalPath.LogExePath);
  11730. actionResult.Status = (int)Constant.PDAResult.Exception;
  11731. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11732. }
  11733. return actionResult;
  11734. }
  11735. /// <summary>
  11736. /// 补推订单
  11737. /// </summary>
  11738. /// <param name="accountCode"></param>
  11739. /// <param name="userCode"></param>
  11740. /// <param name="userPassword"></param>
  11741. /// <param name="sessionKey"></param>
  11742. /// <param name="ementy"></param>
  11743. /// <returns></returns>
  11744. public ActionResult SupplementaryPush(string accountCode, string userCode, string userPassword, string sessionKey, string ementy)
  11745. {
  11746. ActionResult actionResult = new ActionResult();
  11747. try
  11748. {
  11749. // 验证请求头信息
  11750. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  11751. // 验证失败
  11752. if (actionResult.Status != (int)Constant.PDAResult.Success)
  11753. {
  11754. return actionResult;
  11755. }
  11756. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11757. () => PMModuleLogicDAL.SupplementaryPush(ementy, userCode));
  11758. if (resultEntity.OtherStatus == -1)
  11759. {
  11760. actionResult.Status = (int)Constant.PDAResult.Fail;
  11761. }
  11762. else
  11763. {
  11764. actionResult.Result = JsonHelper.ToJson(resultEntity.Result);
  11765. actionResult.Status = (int)Constant.PDAResult.Success;
  11766. }
  11767. actionResult.Message = resultEntity.Message;
  11768. }
  11769. catch (Exception ex)
  11770. {
  11771. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11772. OutputLog.TraceLog(LogPriority.Error,
  11773. this.ToString(),
  11774. System.Reflection.MethodBase.GetCurrentMethod().Name,
  11775. ex.ToString(),
  11776. LocalPath.LogExePath);
  11777. actionResult.Status = (int)Constant.PDAResult.Exception;
  11778. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11779. }
  11780. return actionResult;
  11781. }
  11782. #endregion
  11783. #region PDA 包装 校验板码
  11784. /// <summary>
  11785. /// 托盘下有没有产品未交接的
  11786. /// </summary>
  11787. /// <param name="accountCode"></param>
  11788. /// <param name="userCode"></param>
  11789. /// <param name="userPassword"></param>
  11790. /// <param name="sessionKey"></param>
  11791. /// <param name="ementy"></param>
  11792. /// <returns></returns>
  11793. public ActionResult CheckBanma(string accountCode, string userCode, string userPassword, string sessionKey, string banma)
  11794. {
  11795. ActionResult actionResult = new ActionResult();
  11796. try
  11797. {
  11798. // 验证请求头信息
  11799. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  11800. // 验证失败
  11801. if (actionResult.Status != (int)Constant.PDAResult.Success)
  11802. {
  11803. return actionResult;
  11804. }
  11805. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11806. () => PMModuleLogicDAL.ToCheckBanma(banma));
  11807. if (resultEntity.OtherStatus == -1)
  11808. {
  11809. actionResult.Status = (int)Constant.PDAResult.Fail;
  11810. }
  11811. else
  11812. {
  11813. actionResult.Result = JsonHelper.ToJson(resultEntity.Result);
  11814. actionResult.Status = (int)Constant.PDAResult.Success;
  11815. }
  11816. actionResult.Message = resultEntity.Message;
  11817. }
  11818. catch (Exception ex)
  11819. {
  11820. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11821. OutputLog.TraceLog(LogPriority.Error,
  11822. this.ToString(),
  11823. System.Reflection.MethodBase.GetCurrentMethod().Name,
  11824. ex.ToString(),
  11825. LocalPath.LogExePath);
  11826. actionResult.Status = (int)Constant.PDAResult.Exception;
  11827. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11828. }
  11829. return actionResult;
  11830. }
  11831. #endregion
  11832. }
  11833. }