PDAModuleService.cs 374 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:PDAModuleService.cs
  5. * 2.功能描述:PDA模块WCF服务
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 陈晓野 2014/09/16 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.IO;
  14. using System.ServiceModel;
  15. using System.ServiceModel.Activation;
  16. using Dongke.IBOSS.PRD.Basics.BaseResources;
  17. using Dongke.IBOSS.PRD.Basics.DataAccess;
  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.HRModuleLogic;
  24. using Dongke.IBOSS.PRD.Service.PCModuleLogic;
  25. using Dongke.IBOSS.PRD.Service.PDAModuleLogic;
  26. using Dongke.IBOSS.PRD.Service.PMModuleLogic;
  27. using Dongke.IBOSS.PRD.Service.PublicModuleService;
  28. using Dongke.IBOSS.PRD.Service.ReportModuleLogic;
  29. using Dongke.IBOSS.PRD.Service.SmartDeviceService;
  30. using Dongke.IBOSS.PRD.Service.SystemModuleLogic;
  31. using Dongke.IBOSS.PRD.WCF.Contracts;
  32. using Dongke.IBOSS.PRD.WCF.DataModels;
  33. using Dongke.IBOSS.PRD.WCF.DataModels.ConfigModule;
  34. using Dongke.IBOSS.PRD.WCF.DataModels.HRModule;
  35. using Dongke.IBOSS.PRD.WCF.DataModels.PCModule;
  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. #endregion
  256. #region 取得展示数据
  257. /// <summary>
  258. /// 获得生产线菜单
  259. /// </summary>
  260. /// <param name="accountCode">帐套code</param>
  261. /// <param name="userCode">用户code</param>
  262. /// <param name="userPassword">用户密码</param>
  263. /// <param name="sessionKey">本次登陆密钥</param>
  264. /// <returns></returns>
  265. /// <remarks>
  266. /// 陈冰 2014.09.18 新建
  267. /// </remarks>
  268. public ActionResult GetProductionLineMenu(string accountCode, string userCode, string userPassword, string sessionKey)
  269. {
  270. ActionResult actionResult = new ActionResult();
  271. try
  272. {
  273. // 验证请求头信息
  274. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  275. // 验证失败
  276. if (actionResult.Status != (int)Constant.PDAResult.Success)
  277. {
  278. return actionResult;
  279. }
  280. // 查询菜单
  281. DataTable dtPLM = ServiceInvoker.Invoke<DataTable>(this,
  282. () => PDAModuleLogic.GetProductionLineMenu(sUserInfo));
  283. PDAFunctionResult pdaFunction = new PDAFunctionResult();
  284. pdaFunction.MenuCode = "Root";
  285. DataRow[] navigationRows = dtPLM.Select("LEN(MenuCode) = " + Constant.INT_IS_TWO.ToString(), "MenuCode ASC"); // 编号2为一级菜单
  286. foreach (DataRow newRow in navigationRows)
  287. {
  288. #region 插入子节点数据
  289. int? intProcedureID = null;
  290. int? intModelType = null;
  291. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  292. {
  293. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  294. }
  295. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  296. {
  297. intModelType = Convert.ToInt32(newRow["ModelType"]);
  298. }
  299. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  300. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  301. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  302. pdaFunctionChild.ProcedureID = intProcedureID;
  303. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  304. pdaFunctionChild.ModelType = intModelType;
  305. pdaFunction.PDAFunctions.Add(pdaFunctionChild);
  306. #endregion
  307. InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild);
  308. }
  309. //actionResult.Result = JsonHelper.ToJson(dtPLM);
  310. actionResult.Result = JsonHelper.ToJson(pdaFunction);
  311. actionResult.Status = (int)Constant.PDAResult.Success;
  312. }
  313. catch (Exception ex)
  314. {
  315. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  316. OutputLog.TraceLog(LogPriority.Error,
  317. this.ToString(),
  318. System.Reflection.MethodBase.GetCurrentMethod().Name,
  319. ex.ToString(),
  320. LocalPath.LogExePath);
  321. actionResult.Status = (int)Constant.PDAResult.Exception;
  322. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  323. }
  324. return actionResult;
  325. }
  326. /// <summary>
  327. /// 初始化树形控件
  328. /// </summary>
  329. /// <param name="treeTable">菜单数据表</param>
  330. /// <param name="rows">待处理的菜单集合</param>
  331. /// <param name="node">当前树节点</param>
  332. private void InitTreeView(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions)
  333. {
  334. string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = "
  335. + (pFuncCode.Length + Constant.INT_IS_TWO);
  336. DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC");
  337. //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC");
  338. foreach (DataRow newRow in subRows)
  339. {
  340. #region 插入子节点数据
  341. int? intProcedureID = null;
  342. int? intModelType = null;
  343. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  344. {
  345. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  346. }
  347. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  348. {
  349. intModelType = Convert.ToInt32(newRow["ModelType"]);
  350. }
  351. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  352. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  353. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  354. pdaFunctionChild.ProcedureID = intProcedureID;
  355. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  356. pdaFunctionChild.ModelType = intModelType;
  357. pFunctions.PDAFunctions.Add(pdaFunctionChild);
  358. #endregion
  359. // 递归方法
  360. InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild);
  361. }
  362. }
  363. #endregion
  364. #region 获得工序信息
  365. /// <summary>
  366. /// 获得工序信息
  367. /// </summary>
  368. /// <param name="accountCode">帐套code</param>
  369. /// <param name="userCode">用户code</param>
  370. /// <param name="userPassword">用户密码</param>
  371. /// <param name="sessionKey">本次登陆密钥</param>
  372. /// <param name="procedureID">工序ID</param>
  373. /// <returns></returns>
  374. /// <remarks>
  375. /// 陈冰 2014.09.18 新建
  376. /// </remarks>
  377. public ActionResult GetProcedureByID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  378. {
  379. ActionResult actionResult = new ActionResult();
  380. try
  381. {
  382. // 验证请求头信息
  383. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  384. // 验证失败
  385. if (actionResult.Status != (int)Constant.PDAResult.Success)
  386. {
  387. return actionResult;
  388. }
  389. ProcedureEntity procedureEntity = ServiceInvoker.Invoke<ProcedureEntity>(this,
  390. () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo));
  391. actionResult.Result = JsonHelper.ToJson(procedureEntity);
  392. actionResult.Status = (int)Constant.PDAResult.Success;
  393. }
  394. catch (Exception ex)
  395. {
  396. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  397. OutputLog.TraceLog(LogPriority.Error,
  398. this.ToString(),
  399. System.Reflection.MethodBase.GetCurrentMethod().Name,
  400. ex.ToString(),
  401. LocalPath.LogExePath);
  402. actionResult.Status = (int)Constant.PDAResult.Exception;
  403. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  404. }
  405. return actionResult;
  406. }
  407. #endregion
  408. #region 校验
  409. /// <summary>
  410. /// 校验产品条码是否可以走到该工序
  411. /// </summary>
  412. /// <param name="accountCode">帐套code</param>
  413. /// <param name="userCode">用户code</param>
  414. /// <param name="userPassword">用户密码</param>
  415. /// <param name="sessionKey">本次登陆密钥</param>
  416. /// <param name="procedureID">工序ID</param>
  417. /// <param name="barcode">条码</param>
  418. /// <returns></returns>
  419. /// <remarks>
  420. /// 陈冰 2014.09.18 新建
  421. /// </remarks>
  422. public ActionResult CheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  423. {
  424. ActionResult actionResult = new ActionResult();
  425. try
  426. {
  427. // 验证请求头信息
  428. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  429. // 验证失败
  430. if (actionResult.Status != (int)Constant.PDAResult.Success)
  431. {
  432. return actionResult;
  433. }
  434. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  435. () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo));
  436. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  437. {
  438. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  439. actionResult.Status = (int)Constant.PDAResult.Success;
  440. }
  441. else
  442. {
  443. actionResult.Status = (int)Constant.PDAResult.Fail;
  444. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  445. }
  446. }
  447. catch (Exception ex)
  448. {
  449. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  450. OutputLog.TraceLog(LogPriority.Error,
  451. this.ToString(),
  452. System.Reflection.MethodBase.GetCurrentMethod().Name,
  453. ex.ToString(),
  454. LocalPath.LogExePath);
  455. actionResult.Status = (int)Constant.PDAResult.Exception;
  456. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  457. }
  458. return actionResult;
  459. }
  460. /// <summary>
  461. /// 校验产品条码是否可以进行干补
  462. /// </summary>
  463. /// <param name="accountCode">帐套code</param>
  464. /// <param name="userCode">用户code</param>
  465. /// <param name="userPassword">用户密码</param>
  466. /// <param name="sessionKey">本次登陆密钥</param>
  467. /// <param name="procedureID">工序ID</param>
  468. /// <param name="barcode">条码</param>
  469. /// <returns></returns>
  470. /// <remarks>
  471. /// 袁新成 2015.4.1 新建
  472. /// </remarks>
  473. public ActionResult CheckDryRepairBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  474. {
  475. ActionResult actionResult = new ActionResult();
  476. try
  477. {
  478. // 验证请求头信息
  479. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  480. // 验证失败
  481. if (actionResult.Status != (int)Constant.PDAResult.Success)
  482. {
  483. return actionResult;
  484. }
  485. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  486. () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
  487. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  488. {
  489. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  490. actionResult.Status = (int)Constant.PDAResult.Success;
  491. }
  492. else
  493. {
  494. actionResult.Status = (int)Constant.PDAResult.Fail;
  495. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  496. }
  497. }
  498. catch (Exception ex)
  499. {
  500. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  501. OutputLog.TraceLog(LogPriority.Error,
  502. this.ToString(),
  503. System.Reflection.MethodBase.GetCurrentMethod().Name,
  504. ex.ToString(),
  505. LocalPath.LogExePath);
  506. actionResult.Status = (int)Constant.PDAResult.Exception;
  507. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  508. }
  509. return actionResult;
  510. }
  511. /// <summary>
  512. /// 检验生产工号
  513. /// </summary>
  514. /// <param name="accountCode">帐套code</param>
  515. /// <param name="userCode">用户code</param>
  516. /// <param name="userPassword">用户密码</param>
  517. /// <param name="sessionKey">本次登陆密钥</param>
  518. /// <param name="procedureID">工序ID</param>
  519. /// <param name="procedureUserCode">生产工号</param>
  520. /// <remarks>
  521. /// 陈冰 2014.09.18 新建
  522. /// </remarks>
  523. public ActionResult CheckProcedureUser(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
  524. {
  525. ActionResult actionResult = new ActionResult();
  526. try
  527. {
  528. // 验证请求头信息
  529. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  530. // 验证失败
  531. if (actionResult.Status != (int)Constant.PDAResult.Success)
  532. {
  533. return actionResult;
  534. }
  535. CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
  536. () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
  537. actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
  538. actionResult.Status = (int)Constant.PDAResult.Success;
  539. }
  540. catch (Exception ex)
  541. {
  542. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  543. OutputLog.TraceLog(LogPriority.Error,
  544. this.ToString(),
  545. System.Reflection.MethodBase.GetCurrentMethod().Name,
  546. ex.ToString(),
  547. LocalPath.LogExePath);
  548. actionResult.Status = (int)Constant.PDAResult.Exception;
  549. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  550. }
  551. return actionResult;
  552. }
  553. /// <summary>
  554. /// 校验窑车是否可装车并返回窑车信息
  555. /// </summary>
  556. /// <param name="accountCode">帐套code</param>
  557. /// <param name="userCode">用户code</param>
  558. /// <param name="userPassword">用户密码</param>
  559. /// <param name="sessionKey">本次登陆密钥</param>
  560. /// <param name="kilnCarCode">窑车号</param>
  561. /// <param name="modelType">工序类别</param>
  562. /// <returns></returns>
  563. /// <remarks>
  564. /// 陈冰 2014.10.04 新建
  565. /// </remarks>
  566. public ActionResult CheckKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
  567. {
  568. ActionResult actionResult = new ActionResult();
  569. try
  570. {
  571. // 验证请求头信息
  572. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  573. // 验证失败
  574. if (actionResult.Status != (int)Constant.PDAResult.Success)
  575. {
  576. return actionResult;
  577. }
  578. CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
  579. () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
  580. actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
  581. actionResult.Status = (int)Constant.PDAResult.Success;
  582. }
  583. catch (Exception ex)
  584. {
  585. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  586. OutputLog.TraceLog(LogPriority.Error,
  587. this.ToString(),
  588. System.Reflection.MethodBase.GetCurrentMethod().Name,
  589. ex.ToString(),
  590. LocalPath.LogExePath);
  591. actionResult.Status = (int)Constant.PDAResult.Exception;
  592. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  593. }
  594. return actionResult;
  595. }
  596. #endregion
  597. #region 保存条码信息
  598. /// <summary>
  599. /// 保存条码信息
  600. /// </summary>
  601. /// <param name="accountCode">帐套code</param>
  602. /// <param name="userCode">用户code</param>
  603. /// <param name="userPassword">用户密码</param>
  604. /// <param name="sessionKey">本次登陆密钥</param>
  605. /// <param name="procedureID">工序ID</param>
  606. /// <param name="productionDataEntitys">条码信息</param>
  607. public ActionResult AddWorkPiece(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  608. {
  609. ActionResult actionResult = new ActionResult();
  610. try
  611. {
  612. // 验证请求头信息
  613. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  614. // 验证失败
  615. if (actionResult.Status != (int)Constant.PDAResult.Success)
  616. {
  617. return actionResult;
  618. }
  619. DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
  620. if (!dtProductionData.Columns.Contains("IsPDA"))
  621. {
  622. dtProductionData.Columns.Add("IsPDA");
  623. }
  624. ProcedureEntity procedureInfo = null;
  625. DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
  626. () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
  627. actionResult.Result = JsonHelper.ToJson(resultDT);
  628. actionResult.Status = (int)Constant.PDAResult.Success;
  629. if (resultDT != null)
  630. {
  631. DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
  632. if (drs != null && drs.Length > 0)
  633. {
  634. return actionResult;
  635. }
  636. }
  637. #region PDA条码打印
  638. if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
  639. procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
  640. {
  641. try
  642. {
  643. if (procedureInfo.CollectType == 1)
  644. {
  645. //foreach (DataRow item in dtProductionData.Rows)
  646. //{
  647. // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
  648. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  649. // if (sre.Status != Constant.ServiceResultStatus.Success)
  650. // {
  651. // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  652. // actionResult.Message = sre.Message;
  653. // return actionResult;
  654. // }
  655. //}
  656. }
  657. else
  658. {
  659. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
  660. procedureInfo.BarCodePrintCopies, null, sUserInfo);
  661. if (sre.Status != Constant.ServiceResultStatus.Success)
  662. {
  663. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  664. actionResult.Message = sre.Message;
  665. return actionResult;
  666. }
  667. }
  668. }
  669. catch (Exception ex)
  670. {
  671. OutputLog.TraceLog(LogPriority.Error,
  672. this.ToString(),
  673. System.Reflection.MethodBase.GetCurrentMethod().Name,
  674. ex.ToString(),
  675. LocalPath.LogExePath);
  676. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  677. actionResult.Message = "条码打印异常";
  678. return actionResult;
  679. }
  680. }
  681. #endregion PDA条码打印
  682. }
  683. catch (Exception ex)
  684. {
  685. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  686. OutputLog.TraceLog(LogPriority.Error,
  687. this.ToString(),
  688. System.Reflection.MethodBase.GetCurrentMethod().Name,
  689. ex.ToString(),
  690. LocalPath.LogExePath);
  691. actionResult.Status = (int)Constant.PDAResult.Exception;
  692. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  693. }
  694. return actionResult;
  695. }
  696. #endregion
  697. #region 获得系统/基数数据
  698. /// <summary>
  699. /// 获得数据字典
  700. /// </summary>
  701. /// <param name="accountCode">帐套code</param>
  702. /// <param name="userCode">用户code</param>
  703. /// <param name="userPassword">用户密码</param>
  704. /// <param name="sessionKey">本次登陆密钥</param>
  705. /// <param name="dicType">字典类型</param>
  706. /// <returns></returns>
  707. public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  708. {
  709. ActionResult actionResult = new ActionResult();
  710. try
  711. {
  712. // 验证请求头信息
  713. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  714. // 验证失败
  715. if (actionResult.Status != (int)Constant.PDAResult.Success)
  716. {
  717. return actionResult;
  718. }
  719. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  720. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  721. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  722. actionResult.Status = (int)Constant.PDAResult.Success;
  723. }
  724. catch (Exception ex)
  725. {
  726. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  727. OutputLog.TraceLog(LogPriority.Error,
  728. this.ToString(),
  729. System.Reflection.MethodBase.GetCurrentMethod().Name,
  730. ex.ToString(),
  731. LocalPath.LogExePath);
  732. actionResult.Status = (int)Constant.PDAResult.Exception;
  733. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  734. }
  735. return actionResult;
  736. }
  737. #endregion
  738. #region 检验工序接口
  739. /// <summary>
  740. /// 获得检验标识
  741. /// </summary>
  742. /// <param name="accountCode">帐套code</param>
  743. /// <param name="userCode">用户code</param>
  744. /// <param name="userPassword">用户密码</param>
  745. /// <param name="sessionKey">本次登陆密钥</param>
  746. /// <returns></returns>
  747. /// <remarks>
  748. /// 陈冰 2014.10.04 新建
  749. /// </remarks>
  750. public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey)
  751. {
  752. ActionResult actionResult = new ActionResult();
  753. try
  754. {
  755. // 验证请求头信息
  756. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  757. // 验证失败
  758. if (actionResult.Status != (int)Constant.PDAResult.Success)
  759. {
  760. return actionResult;
  761. }
  762. #region 构造缺陷标识的数据源
  763. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  764. #endregion
  765. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  766. actionResult.Status = (int)Constant.PDAResult.Success;
  767. }
  768. catch (Exception ex)
  769. {
  770. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  771. OutputLog.TraceLog(LogPriority.Error,
  772. this.ToString(),
  773. System.Reflection.MethodBase.GetCurrentMethod().Name,
  774. ex.ToString(),
  775. LocalPath.LogExePath);
  776. actionResult.Status = (int)Constant.PDAResult.Exception;
  777. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  778. }
  779. return actionResult;
  780. }
  781. /// <summary>
  782. /// 由条码和当前检验工序获取返工工序
  783. /// </summary>
  784. /// <param name="accountCode">帐套code</param>
  785. /// <param name="userCode">用户code</param>
  786. /// <param name="userPassword">用户密码</param>
  787. /// <param name="sessionKey">本次登陆密钥</param>
  788. /// <param name="procedureID">当前检验工序ID</param>
  789. /// <param name="barcode">条码</param>
  790. /// <returns></returns>
  791. /// <remarks>
  792. /// 陈冰 2014.10.04 新建
  793. /// </remarks>
  794. public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  795. {
  796. ActionResult actionResult = new ActionResult();
  797. try
  798. {
  799. // 验证请求头信息
  800. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  801. // 验证失败
  802. if (actionResult.Status != (int)Constant.PDAResult.Success)
  803. {
  804. return actionResult;
  805. }
  806. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  807. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  808. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  809. {
  810. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  811. actionResult.Status = (int)Constant.PDAResult.Success;
  812. }
  813. else
  814. {
  815. actionResult.Status = (int)Constant.PDAResult.Fail;
  816. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  817. }
  818. }
  819. catch (Exception ex)
  820. {
  821. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  822. OutputLog.TraceLog(LogPriority.Error,
  823. this.ToString(),
  824. System.Reflection.MethodBase.GetCurrentMethod().Name,
  825. ex.ToString(),
  826. LocalPath.LogExePath);
  827. actionResult.Status = (int)Constant.PDAResult.Exception;
  828. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  829. }
  830. return actionResult;
  831. }
  832. /// <summary>
  833. /// 由当前检验工序获取缺陷列表
  834. /// </summary>
  835. /// <param name="accountCode">帐套code</param>
  836. /// <param name="userCode">用户code</param>
  837. /// <param name="userPassword">用户密码</param>
  838. /// <param name="sessionKey">本次登陆密钥</param>
  839. /// <param name="procedureID">当前检验工序ID</param>
  840. /// <param name="defectCode">缺陷编码</param>
  841. /// <returns></returns>
  842. /// <remarks>
  843. /// 陈冰 2014.10.04 新建
  844. /// </remarks>
  845. public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  846. {
  847. ActionResult actionResult = new ActionResult();
  848. try
  849. {
  850. // 验证请求头信息
  851. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  852. // 验证失败
  853. if (actionResult.Status != (int)Constant.PDAResult.Success)
  854. {
  855. return actionResult;
  856. }
  857. object defectDs = ServiceInvoker.Invoke<object>(this,
  858. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  859. if (defectDs != null)
  860. {
  861. actionResult.Result = JsonHelper.ToJson(defectDs);
  862. actionResult.Status = (int)Constant.PDAResult.Success;
  863. }
  864. else
  865. {
  866. actionResult.Status = (int)Constant.PDAResult.Fail;
  867. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  868. }
  869. }
  870. catch (Exception ex)
  871. {
  872. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  873. OutputLog.TraceLog(LogPriority.Error,
  874. this.ToString(),
  875. System.Reflection.MethodBase.GetCurrentMethod().Name,
  876. ex.ToString(),
  877. LocalPath.LogExePath);
  878. actionResult.Status = (int)Constant.PDAResult.Exception;
  879. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  880. }
  881. return actionResult;
  882. }
  883. /// <summary>
  884. /// 根据产品ID查出缺陷位置
  885. /// </summary>
  886. /// <param name="accountCode">帐套code</param>
  887. /// <param name="userCode">用户code</param>
  888. /// <param name="userPassword">用户密码</param>
  889. /// <param name="sessionKey">本次登陆密钥</param>
  890. /// <param name="goodsID">产品ID</param>
  891. /// <param name="positionCode">位置编码</param>
  892. /// <returns></returns>
  893. /// <remarks>
  894. /// 陈冰 2014.10.04 新建
  895. /// </remarks>
  896. public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  897. {
  898. ActionResult actionResult = new ActionResult();
  899. try
  900. {
  901. // 验证请求头信息
  902. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  903. // 验证失败
  904. if (actionResult.Status != (int)Constant.PDAResult.Success)
  905. {
  906. return actionResult;
  907. }
  908. // 缺陷位置已经不用在关联产品
  909. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  910. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  911. if (defectDs != null)
  912. {
  913. actionResult.Result = JsonHelper.ToJson(defectDs);
  914. actionResult.Status = (int)Constant.PDAResult.Success;
  915. }
  916. else
  917. {
  918. actionResult.Status = (int)Constant.PDAResult.Fail;
  919. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  920. }
  921. }
  922. catch (Exception ex)
  923. {
  924. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  925. OutputLog.TraceLog(LogPriority.Error,
  926. this.ToString(),
  927. System.Reflection.MethodBase.GetCurrentMethod().Name,
  928. ex.ToString(),
  929. LocalPath.LogExePath);
  930. actionResult.Status = (int)Constant.PDAResult.Exception;
  931. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  932. }
  933. return actionResult;
  934. }
  935. /// <summary>
  936. /// 通过条码和缺陷查出责任工序
  937. /// </summary>
  938. /// <param name="accountCode">帐套code</param>
  939. /// <param name="userCode">用户code</param>
  940. /// <param name="userPassword">用户密码</param>
  941. /// <param name="sessionKey">本次登陆密钥</param>
  942. /// <param name="barcode">条码</param>
  943. /// <param name="defectid">缺陷ID</param>
  944. /// <returns></returns>
  945. /// <remarks>
  946. /// 陈冰 2014.10.04 新建
  947. /// </remarks>
  948. public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  949. {
  950. ActionResult actionResult = new ActionResult();
  951. try
  952. {
  953. // 验证请求头信息
  954. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  955. // 验证失败
  956. if (actionResult.Status != (int)Constant.PDAResult.Success)
  957. {
  958. return actionResult;
  959. }
  960. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  961. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  962. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  963. {
  964. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  965. actionResult.Status = (int)Constant.PDAResult.Success;
  966. }
  967. else
  968. {
  969. actionResult.Status = (int)Constant.PDAResult.Fail;
  970. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  971. }
  972. }
  973. catch (Exception ex)
  974. {
  975. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  976. OutputLog.TraceLog(LogPriority.Error,
  977. this.ToString(),
  978. System.Reflection.MethodBase.GetCurrentMethod().Name,
  979. ex.ToString(),
  980. LocalPath.LogExePath);
  981. actionResult.Status = (int)Constant.PDAResult.Exception;
  982. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  983. }
  984. return actionResult;
  985. }
  986. /// <summary>
  987. /// 通过条码与工序查出责任工号(己废)
  988. /// </summary>
  989. /// <param name="accountCode">帐套code</param>
  990. /// <param name="userCode">用户code</param>
  991. /// <param name="userPassword">用户密码</param>
  992. /// <param name="sessionKey">本次登陆密钥</param>
  993. /// <param name="barcode">条码</param>
  994. /// <param name="dutyProcedureID">责任工序</param>
  995. /// <returns></returns>
  996. /// <remarks>
  997. /// 陈冰 2014.10.04 新建
  998. /// </remarks>
  999. public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  1000. {
  1001. ActionResult actionResult = new ActionResult();
  1002. try
  1003. {
  1004. // 验证请求头信息
  1005. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1006. // 验证失败
  1007. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1008. {
  1009. return actionResult;
  1010. }
  1011. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1012. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  1013. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1014. {
  1015. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1016. actionResult.Status = (int)Constant.PDAResult.Success;
  1017. }
  1018. else
  1019. {
  1020. actionResult.Status = (int)Constant.PDAResult.Fail;
  1021. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1022. }
  1023. }
  1024. catch (Exception ex)
  1025. {
  1026. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1027. OutputLog.TraceLog(LogPriority.Error,
  1028. this.ToString(),
  1029. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1030. ex.ToString(),
  1031. LocalPath.LogExePath);
  1032. actionResult.Status = (int)Constant.PDAResult.Exception;
  1033. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1034. }
  1035. return actionResult;
  1036. }
  1037. /// <summary>
  1038. /// 通过条码与工序查出责任工号
  1039. /// </summary>
  1040. /// <param name="accountCode"></param>
  1041. /// <param name="userCode"></param>
  1042. /// <param name="userPassword"></param>
  1043. /// <param name="sessionKey"></param>
  1044. /// <param name="ProductionDataID">生产数据ID</param>
  1045. /// <returns></returns>
  1046. public ActionResult GetDutyProcedureCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1047. {
  1048. ActionResult actionResult = new ActionResult();
  1049. try
  1050. {
  1051. // 验证请求头信息
  1052. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1053. // 验证失败
  1054. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1055. {
  1056. return actionResult;
  1057. }
  1058. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1059. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1060. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1061. {
  1062. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1063. actionResult.Status = (int)Constant.PDAResult.Success;
  1064. }
  1065. else
  1066. {
  1067. actionResult.Status = (int)Constant.PDAResult.Fail;
  1068. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1069. }
  1070. }
  1071. catch (Exception ex)
  1072. {
  1073. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1074. OutputLog.TraceLog(LogPriority.Error,
  1075. this.ToString(),
  1076. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1077. ex.ToString(),
  1078. LocalPath.LogExePath);
  1079. actionResult.Status = (int)Constant.PDAResult.Exception;
  1080. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1081. }
  1082. return actionResult;
  1083. }
  1084. /// <summary>
  1085. /// 通过生产数据与工号ID查询工种
  1086. /// </summary>
  1087. /// <param name="accountCode">帐套code</param>
  1088. /// <param name="userCode">用户code</param>
  1089. /// <param name="userPassword">用户密码</param>
  1090. /// <param name="sessionKey">本次登陆密钥</param>
  1091. /// <param name="productionDataID">生产数据ID</param>
  1092. /// <param name="userID">工号ID</param>
  1093. /// <returns></returns>
  1094. /// <remarks>
  1095. /// 陈冰 2014.10.08 新建
  1096. /// </remarks>
  1097. public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey,
  1098. //int productionDataID, int userID)
  1099. int classesSettingID, int defectid, int procedureID)
  1100. {
  1101. ActionResult actionResult = new ActionResult();
  1102. try
  1103. {
  1104. // 验证请求头信息
  1105. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1106. // 验证失败
  1107. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1108. {
  1109. return actionResult;
  1110. }
  1111. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1112. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1113. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  1114. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1115. {
  1116. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1117. actionResult.Status = (int)Constant.PDAResult.Success;
  1118. }
  1119. else
  1120. {
  1121. actionResult.Status = (int)Constant.PDAResult.Fail;
  1122. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1123. }
  1124. }
  1125. catch (Exception ex)
  1126. {
  1127. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1128. OutputLog.TraceLog(LogPriority.Error,
  1129. this.ToString(),
  1130. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1131. ex.ToString(),
  1132. LocalPath.LogExePath);
  1133. actionResult.Status = (int)Constant.PDAResult.Exception;
  1134. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1135. }
  1136. return actionResult;
  1137. }
  1138. /// <summary>
  1139. /// 根据生产数据ID,用户ID及工种选出责任员工
  1140. /// </summary>
  1141. /// <param name="accountCode">帐套code</param>
  1142. /// <param name="userCode">用户code</param>
  1143. /// <param name="userPassword">用户密码</param>
  1144. /// <param name="sessionKey">本次登陆密钥</param>
  1145. /// <param name="productionDataID">生产数据ID</param>
  1146. /// <param name="userID">工号ID</param>
  1147. /// <param name="jobsID">工种ID</param>
  1148. /// <returns></returns>
  1149. /// <remarks>
  1150. /// 陈冰 2014.10.08 新建
  1151. /// </remarks>
  1152. public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey,
  1153. //int productionDataID, int userID, int jobsID)
  1154. int classesSettingID, int jobsID)
  1155. {
  1156. ActionResult actionResult = new ActionResult();
  1157. try
  1158. {
  1159. // 验证请求头信息
  1160. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1161. // 验证失败
  1162. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1163. {
  1164. return actionResult;
  1165. }
  1166. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1167. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1168. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1169. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1170. {
  1171. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1172. actionResult.Status = (int)Constant.PDAResult.Success;
  1173. }
  1174. else
  1175. {
  1176. actionResult.Status = (int)Constant.PDAResult.Fail;
  1177. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1178. }
  1179. }
  1180. catch (Exception ex)
  1181. {
  1182. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1183. OutputLog.TraceLog(LogPriority.Error,
  1184. this.ToString(),
  1185. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1186. ex.ToString(),
  1187. LocalPath.LogExePath);
  1188. actionResult.Status = (int)Constant.PDAResult.Exception;
  1189. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1190. }
  1191. return actionResult;
  1192. }
  1193. /// <summary>
  1194. /// 获得产品分级
  1195. /// </summary>
  1196. /// <param name="accountCode">帐套code</param>
  1197. /// <param name="userCode">用户code</param>
  1198. /// <param name="userPassword">用户密码</param>
  1199. /// <param name="sessionKey">本次登陆密钥</param>
  1200. /// <returns></returns>
  1201. /// <remarks>
  1202. /// 陈冰 2014.10.08 新建
  1203. /// </remarks>
  1204. public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey)
  1205. {
  1206. ActionResult actionResult = new ActionResult();
  1207. try
  1208. {
  1209. // 验证请求头信息
  1210. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1211. // 验证失败
  1212. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1213. {
  1214. return actionResult;
  1215. }
  1216. #region 构造产品分级的数据源
  1217. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1218. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2, sUserInfo);
  1219. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1220. {
  1221. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1222. actionResult.Status = (int)Constant.PDAResult.Success;
  1223. }
  1224. else
  1225. {
  1226. actionResult.Status = (int)Constant.PDAResult.Fail;
  1227. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1228. }
  1229. #endregion
  1230. }
  1231. catch (Exception ex)
  1232. {
  1233. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1234. OutputLog.TraceLog(LogPriority.Error,
  1235. this.ToString(),
  1236. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1237. ex.ToString(),
  1238. LocalPath.LogExePath);
  1239. OutputLog.TraceLog(LogPriority.Error,
  1240. this.ToString(),
  1241. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1242. ex.ToString(),
  1243. LocalPath.LogExePath);
  1244. actionResult.Status = (int)Constant.PDAResult.Exception;
  1245. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1246. }
  1247. return actionResult;
  1248. }
  1249. #endregion
  1250. #region 保存检验条码
  1251. /// <summary>
  1252. /// 保存检验条码
  1253. /// </summary>
  1254. /// <param name="accountCode">帐套code</param>
  1255. /// <param name="userCode">用户code</param>
  1256. /// <param name="userPassword">用户密码</param>
  1257. /// <param name="sessionKey">本次登陆密钥</param>
  1258. /// <param name="procedureID">工序ID</param>
  1259. /// <param name="productionDataEntitys">条码信息</param>
  1260. /// <returns></returns>
  1261. public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1262. {
  1263. ActionResult actionResult = new ActionResult();
  1264. try
  1265. {
  1266. // 验证请求头信息
  1267. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1268. // 验证失败
  1269. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1270. {
  1271. return actionResult;
  1272. }
  1273. //if(productionDataEntitys.Length>0)
  1274. //{
  1275. // if(productionDataEntitys[0].ProductionDataID>0)
  1276. // {
  1277. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1278. // }
  1279. //}
  1280. string err = ServiceInvoker.Invoke<string>(this,
  1281. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1282. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1283. if (err == null)
  1284. {
  1285. err = "";
  1286. }
  1287. //actionResult.Result = JsonHelper.ToJson(err);
  1288. actionResult.Result = err;// JsonHelper.ToJson(err);
  1289. actionResult.Status = (int)Constant.PDAResult.Success;
  1290. }
  1291. catch (Exception ex)
  1292. {
  1293. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1294. OutputLog.TraceLog(LogPriority.Error,
  1295. this.ToString(),
  1296. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1297. ex.ToString(),
  1298. LocalPath.LogExePath);
  1299. actionResult.Status = (int)Constant.PDAResult.Exception;
  1300. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1301. }
  1302. return actionResult;
  1303. }
  1304. #endregion
  1305. #region 文件上传下载
  1306. /// <summary>
  1307. /// 软件更新
  1308. /// </summary>
  1309. /// <param name="accountCode">帐套code</param>
  1310. /// <param name="userCode">用户code</param>
  1311. /// <param name="userPassword">用户密码</param>
  1312. /// <param name="sessionKey">本次登陆密钥</param>
  1313. /// <returns></returns>
  1314. public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey)
  1315. {
  1316. try
  1317. {
  1318. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1319. }
  1320. catch (Exception ex)
  1321. {
  1322. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1323. OutputLog.TraceLog(LogPriority.Error,
  1324. this.ToString(),
  1325. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1326. ex.ToString(),
  1327. LocalPath.LogExePath);
  1328. return null;
  1329. }
  1330. }
  1331. /// <summary>
  1332. /// 上传临时文件
  1333. /// </summary>
  1334. /// <param name="imgStream"></param>
  1335. /// <returns></returns>
  1336. public ActionResult SaveImg(Stream mageStream)
  1337. {
  1338. ActionResult actionResult = new ActionResult();
  1339. try
  1340. {
  1341. string err = PDAModuleLogic.SaveImg(mageStream);
  1342. if (err == null)
  1343. {
  1344. err = "";
  1345. }
  1346. actionResult.Result = err;
  1347. actionResult.Status = (int)Constant.PDAResult.Success;
  1348. }
  1349. catch (Exception ex)
  1350. {
  1351. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1352. OutputLog.TraceLog(LogPriority.Error,
  1353. this.ToString(),
  1354. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1355. ex.ToString(),
  1356. LocalPath.LogExePath);
  1357. actionResult.Status = (int)Constant.PDAResult.Exception;
  1358. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1359. }
  1360. return actionResult;
  1361. }
  1362. public Stream GetFileTest(string path)
  1363. {
  1364. return PDAModuleLogic.GetImg(path);
  1365. }
  1366. public Stream GetFileStream()
  1367. {
  1368. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1369. long l = fs.Length;
  1370. return fs;
  1371. }
  1372. public byte[] GetFileTestByte(string path)
  1373. {
  1374. FileStream stream = new FileInfo(path).OpenRead();
  1375. Byte[] buffer = new Byte[stream.Length];
  1376. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1377. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1378. return buffer;
  1379. }
  1380. public string GetFile(string path)
  1381. {
  1382. string imgFilePath = path;
  1383. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1384. int i = (int)fs.Length;
  1385. byte[] content = new byte[i];
  1386. fs.Read(content, 0, i);
  1387. string result = Convert.ToBase64String(content);
  1388. fs.Close();
  1389. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1390. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1391. sw.Write(result);
  1392. sw.Close();
  1393. fsTxt.Close();
  1394. return result;
  1395. }
  1396. #endregion
  1397. /// <summary>
  1398. /// 获得产品分级
  1399. /// </summary>
  1400. /// <param name="accountCode">帐套code</param>
  1401. /// <param name="userCode">用户code</param>
  1402. /// <param name="userPassword">用户密码</param>
  1403. /// <param name="sessionKey">本次登陆密钥</param>
  1404. /// <param name="procedureID">当前工序ID</param>
  1405. /// <returns></returns>
  1406. /// <remarks>
  1407. /// 陈冰 2014.10.22 新建
  1408. /// </remarks>
  1409. public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1410. {
  1411. ActionResult actionResult = new ActionResult();
  1412. try
  1413. {
  1414. // 验证请求头信息
  1415. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1416. // 验证失败
  1417. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1418. {
  1419. return actionResult;
  1420. }
  1421. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1422. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1423. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1424. {
  1425. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1426. actionResult.Status = (int)Constant.PDAResult.Success;
  1427. }
  1428. else
  1429. {
  1430. actionResult.Status = (int)Constant.PDAResult.Fail;
  1431. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1432. }
  1433. }
  1434. catch (Exception ex)
  1435. {
  1436. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1437. OutputLog.TraceLog(LogPriority.Error,
  1438. this.ToString(),
  1439. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1440. ex.ToString(),
  1441. LocalPath.LogExePath);
  1442. actionResult.Status = (int)Constant.PDAResult.Exception;
  1443. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1444. }
  1445. return actionResult;
  1446. }
  1447. /// <summary>
  1448. /// 获得产品分级
  1449. /// </summary>
  1450. /// <param name="accountCode">帐套code</param>
  1451. /// <param name="userCode">用户code</param>
  1452. /// <param name="userPassword">用户密码</param>
  1453. /// <param name="sessionKey">本次登陆密钥</param>
  1454. /// <param name="barcode">条码</param>
  1455. /// <returns></returns>
  1456. public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1457. {
  1458. ActionResult actionResult = new ActionResult();
  1459. try
  1460. {
  1461. // 验证请求头信息
  1462. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1463. // 验证失败
  1464. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1465. {
  1466. return actionResult;
  1467. }
  1468. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1469. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1470. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1471. {
  1472. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1473. actionResult.Status = (int)Constant.PDAResult.Success;
  1474. }
  1475. else
  1476. {
  1477. actionResult.Status = (int)Constant.PDAResult.Fail;
  1478. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1479. }
  1480. }
  1481. catch (Exception ex)
  1482. {
  1483. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1484. OutputLog.TraceLog(LogPriority.Error,
  1485. this.ToString(),
  1486. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1487. ex.ToString(),
  1488. LocalPath.LogExePath);
  1489. actionResult.Status = (int)Constant.PDAResult.Exception;
  1490. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1491. }
  1492. return actionResult;
  1493. }
  1494. #region 统计
  1495. /// <summary>
  1496. /// 统计当日计数数量
  1497. /// </summary>
  1498. /// <param name="accountCode">帐套code</param>
  1499. /// <param name="userCode">用户code</param>
  1500. /// <param name="userPassword">用户密码</param>
  1501. /// <param name="sessionKey">本次登陆密钥</param>
  1502. /// <param name="procedureID">工序ID</param>
  1503. /// <returns></returns>
  1504. public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1505. {
  1506. ActionResult actionResult = new ActionResult();
  1507. try
  1508. {
  1509. // 验证请求头信息
  1510. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1511. // 验证失败
  1512. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1513. {
  1514. return actionResult;
  1515. }
  1516. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1517. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1518. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1519. {
  1520. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1521. actionResult.Status = (int)Constant.PDAResult.Success;
  1522. }
  1523. else
  1524. {
  1525. actionResult.Status = (int)Constant.PDAResult.Fail;
  1526. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1527. }
  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. /// <summary>
  1543. /// 统计当日计数数量
  1544. /// </summary>
  1545. /// <param name="accountCode">帐套code</param>
  1546. /// <param name="userCode">用户code</param>
  1547. /// <param name="userPassword">用户密码</param>
  1548. /// <param name="sessionKey">本次登陆密钥</param>
  1549. /// <param name="procedureID">工序ID</param>
  1550. /// <returns></returns>
  1551. public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1552. {
  1553. ActionResult actionResult = new ActionResult();
  1554. try
  1555. {
  1556. // 验证请求头信息
  1557. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1558. // 验证失败
  1559. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1560. {
  1561. return actionResult;
  1562. }
  1563. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1564. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1565. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1566. {
  1567. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1568. actionResult.Status = (int)Constant.PDAResult.Success;
  1569. }
  1570. else
  1571. {
  1572. actionResult.Status = (int)Constant.PDAResult.Fail;
  1573. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1574. }
  1575. }
  1576. catch (Exception ex)
  1577. {
  1578. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1579. OutputLog.TraceLog(LogPriority.Error,
  1580. this.ToString(),
  1581. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1582. ex.ToString(),
  1583. LocalPath.LogExePath);
  1584. actionResult.Status = (int)Constant.PDAResult.Exception;
  1585. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1586. }
  1587. return actionResult;
  1588. }
  1589. /// <summary>
  1590. /// 统计产品跟踪
  1591. /// </summary>
  1592. /// <param name="accountCode">帐套code</param>
  1593. /// <param name="userCode">用户code</param>
  1594. /// <param name="userPassword">用户密码</param>
  1595. /// <param name="sessionKey">本次登陆密钥</param>
  1596. /// <param name="procedureID">工序ID</param>
  1597. /// <returns></returns>
  1598. public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1599. {
  1600. ActionResult actionResult = new ActionResult();
  1601. try
  1602. {
  1603. // 验证请求头信息
  1604. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1605. // 验证失败
  1606. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1607. {
  1608. return actionResult;
  1609. }
  1610. RPT020101_SE se = new RPT020101_SE();
  1611. se.Barcode = barcode;
  1612. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1613. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1614. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1615. {
  1616. actionResult.Status = (int)Constant.PDAResult.Fail;
  1617. actionResult.Message = Messages.MSG_CMN_I002;
  1618. }
  1619. else
  1620. {
  1621. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1622. actionResult.Status = (int)Constant.PDAResult.Success;
  1623. }
  1624. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1625. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1626. //if (productionDataEntity != null)
  1627. //{
  1628. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1629. // actionResult.Status = (int)Constant.PDAResult.Success;
  1630. //}
  1631. //else
  1632. //{
  1633. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1634. // actionResult.Message = Messages.MSG_CMN_I002;
  1635. //}
  1636. }
  1637. catch (Exception ex)
  1638. {
  1639. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1640. OutputLog.TraceLog(LogPriority.Error,
  1641. this.ToString(),
  1642. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1643. ex.ToString() + ex.HelpLink,
  1644. LocalPath.LogExePath);
  1645. actionResult.Status = (int)Constant.PDAResult.Exception;
  1646. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1647. }
  1648. return actionResult;
  1649. }
  1650. #endregion
  1651. #region 撤销装车及成检
  1652. /// <summary>
  1653. /// 检验条码是否可以撤销装车
  1654. /// </summary>
  1655. /// <param name="accountCode">帐套code</param>
  1656. /// <param name="userCode">用户code</param>
  1657. /// <param name="userPassword">用户密码</param>
  1658. /// <param name="sessionKey">本次登陆密钥</param>
  1659. /// <param name="procedureID">当前工序ID</param>
  1660. /// <param name="barcode">条码</param>
  1661. /// <returns></returns>
  1662. public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1663. {
  1664. ActionResult actionResult = new ActionResult();
  1665. try
  1666. {
  1667. // 验证请求头信息
  1668. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1669. // 验证失败
  1670. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1671. {
  1672. return actionResult;
  1673. }
  1674. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1675. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1676. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1677. actionResult.Status = (int)Constant.PDAResult.Success;
  1678. }
  1679. catch (Exception ex)
  1680. {
  1681. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1682. OutputLog.TraceLog(LogPriority.Error,
  1683. this.ToString(),
  1684. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1685. ex.ToString(),
  1686. LocalPath.LogExePath);
  1687. actionResult.Status = (int)Constant.PDAResult.Exception;
  1688. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1689. }
  1690. return actionResult;
  1691. }
  1692. /// <summary>
  1693. /// 保存撤销装车的条码
  1694. /// </summary>
  1695. /// <param name="accountCode">帐套code</param>
  1696. /// <param name="userCode">用户code</param>
  1697. /// <param name="userPassword">用户密码</param>
  1698. /// <param name="sessionKey">本次登陆密钥</param>
  1699. /// <param name="procedureID">当前工序ID</param>
  1700. /// <param name="barcode">条码</param>
  1701. /// <returns></returns>
  1702. public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1703. {
  1704. ActionResult actionResult = new ActionResult();
  1705. try
  1706. {
  1707. // 验证请求头信息
  1708. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1709. // 验证失败
  1710. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1711. {
  1712. return actionResult;
  1713. }
  1714. string err = ServiceInvoker.Invoke<string>(this,
  1715. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1716. if (err == null)
  1717. {
  1718. err = "";
  1719. }
  1720. actionResult.Result = JsonHelper.ToJson(err);
  1721. actionResult.Status = (int)Constant.PDAResult.Success;
  1722. }
  1723. catch (Exception ex)
  1724. {
  1725. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1726. OutputLog.TraceLog(LogPriority.Error,
  1727. this.ToString(),
  1728. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1729. ex.ToString(),
  1730. LocalPath.LogExePath);
  1731. actionResult.Status = (int)Constant.PDAResult.Exception;
  1732. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1733. }
  1734. return actionResult;
  1735. }
  1736. /// <summary>
  1737. /// 由产品条码获取注浆信息
  1738. /// </summary>
  1739. /// <param name="barcode"></param>
  1740. /// <returns></returns>
  1741. public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1742. {
  1743. ActionResult actionResult = new ActionResult();
  1744. try
  1745. {
  1746. // 验证请求头信息
  1747. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1748. // 验证失败
  1749. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1750. {
  1751. return actionResult;
  1752. }
  1753. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1754. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1755. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1756. {
  1757. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1758. actionResult.Status = (int)Constant.PDAResult.Success;
  1759. }
  1760. else
  1761. {
  1762. actionResult.Status = (int)Constant.PDAResult.Fail;
  1763. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1764. }
  1765. }
  1766. catch (Exception ex)
  1767. {
  1768. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1769. OutputLog.TraceLog(LogPriority.Error,
  1770. this.ToString(),
  1771. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1772. ex.ToString(),
  1773. LocalPath.LogExePath);
  1774. actionResult.Status = (int)Constant.PDAResult.Exception;
  1775. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1776. }
  1777. return actionResult;
  1778. }
  1779. /// <summary>
  1780. /// 获取工号下的所有工种信息
  1781. /// </summary>
  1782. /// <param name="UserID">工号ID</param>
  1783. /// <returns></returns>
  1784. public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1785. {
  1786. ActionResult actionResult = new ActionResult();
  1787. try
  1788. {
  1789. // 验证请求头信息
  1790. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1791. // 验证失败
  1792. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1793. {
  1794. return actionResult;
  1795. }
  1796. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1797. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1798. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1799. {
  1800. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1801. actionResult.Status = (int)Constant.PDAResult.Success;
  1802. }
  1803. else
  1804. {
  1805. actionResult.Status = (int)Constant.PDAResult.Fail;
  1806. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1807. }
  1808. }
  1809. catch (Exception ex)
  1810. {
  1811. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1812. OutputLog.TraceLog(LogPriority.Error,
  1813. this.ToString(),
  1814. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1815. ex.ToString(),
  1816. LocalPath.LogExePath);
  1817. actionResult.Status = (int)Constant.PDAResult.Exception;
  1818. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1819. }
  1820. return actionResult;
  1821. }
  1822. /// <summary>
  1823. /// 根据所选工号对应的工种,查出缺陷责任员工
  1824. /// </summary>
  1825. /// <param name="jobs">工种ID</param>
  1826. /// <returns></returns>
  1827. public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  1828. {
  1829. ActionResult actionResult = new ActionResult();
  1830. try
  1831. {
  1832. // 验证请求头信息
  1833. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1834. // 验证失败
  1835. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1836. {
  1837. return actionResult;
  1838. }
  1839. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1840. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  1841. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1842. {
  1843. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1844. actionResult.Status = (int)Constant.PDAResult.Success;
  1845. }
  1846. else
  1847. {
  1848. actionResult.Status = (int)Constant.PDAResult.Fail;
  1849. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1850. }
  1851. }
  1852. catch (Exception ex)
  1853. {
  1854. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1855. OutputLog.TraceLog(LogPriority.Error,
  1856. this.ToString(),
  1857. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1858. ex.ToString(),
  1859. LocalPath.LogExePath);
  1860. actionResult.Status = (int)Constant.PDAResult.Exception;
  1861. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1862. }
  1863. return actionResult;
  1864. }
  1865. /// <summary>
  1866. /// 根据所选工号,查出漏检责任员工
  1867. /// </summary>
  1868. /// <param name="userid">工号</param>
  1869. /// <returns></returns>
  1870. public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  1871. {
  1872. ActionResult actionResult = new ActionResult();
  1873. try
  1874. {
  1875. // 验证请求头信息
  1876. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1877. // 验证失败
  1878. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1879. {
  1880. return actionResult;
  1881. }
  1882. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1883. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  1884. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1885. {
  1886. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1887. actionResult.Status = (int)Constant.PDAResult.Success;
  1888. }
  1889. else
  1890. {
  1891. actionResult.Status = (int)Constant.PDAResult.Fail;
  1892. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1893. }
  1894. }
  1895. catch (Exception ex)
  1896. {
  1897. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1898. OutputLog.TraceLog(LogPriority.Error,
  1899. this.ToString(),
  1900. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1901. ex.ToString(),
  1902. LocalPath.LogExePath);
  1903. actionResult.Status = (int)Constant.PDAResult.Exception;
  1904. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1905. }
  1906. return actionResult;
  1907. }
  1908. /// <summary>
  1909. /// 获取用户列表
  1910. /// </summary>
  1911. /// <param name="requestEntity">用户实体</param>
  1912. /// <returns></returns>
  1913. public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  1914. {
  1915. ActionResult actionResult = new ActionResult();
  1916. try
  1917. {
  1918. // 验证请求头信息
  1919. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1920. // 验证失败
  1921. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1922. {
  1923. return actionResult;
  1924. }
  1925. SUserEntity requestEntity = new SUserEntity();
  1926. requestEntity.IsWorker = IsWorker;
  1927. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1928. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  1929. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1930. {
  1931. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1932. actionResult.Status = (int)Constant.PDAResult.Success;
  1933. }
  1934. else
  1935. {
  1936. actionResult.Status = (int)Constant.PDAResult.Fail;
  1937. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1938. }
  1939. }
  1940. catch (Exception ex)
  1941. {
  1942. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1943. OutputLog.TraceLog(LogPriority.Error,
  1944. this.ToString(),
  1945. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1946. ex.ToString(),
  1947. LocalPath.LogExePath);
  1948. actionResult.Status = (int)Constant.PDAResult.Exception;
  1949. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1950. }
  1951. return actionResult;
  1952. }
  1953. /// <summary>
  1954. /// 获取数据字典管理的数据
  1955. /// </summary>
  1956. /// <param name="Pvalue">显示停用标识</param>
  1957. /// <param name="dictionaryType">字典类别</param>
  1958. /// <returns></returns>
  1959. /// <remarks>
  1960. /// 2014.12.03 新建
  1961. /// </remarks>
  1962. public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  1963. {
  1964. ActionResult actionResult = new ActionResult();
  1965. try
  1966. {
  1967. // 验证请求头信息
  1968. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1969. // 验证失败
  1970. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1971. {
  1972. return actionResult;
  1973. }
  1974. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1975. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  1976. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1977. {
  1978. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1979. actionResult.Status = (int)Constant.PDAResult.Success;
  1980. }
  1981. else
  1982. {
  1983. actionResult.Status = (int)Constant.PDAResult.Fail;
  1984. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1985. }
  1986. }
  1987. catch (Exception ex)
  1988. {
  1989. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1990. OutputLog.TraceLog(LogPriority.Error,
  1991. this.ToString(),
  1992. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1993. ex.ToString(),
  1994. LocalPath.LogExePath);
  1995. actionResult.Status = (int)Constant.PDAResult.Exception;
  1996. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1997. }
  1998. return actionResult;
  1999. }
  2000. #endregion
  2001. #region 保存半检数据
  2002. /// <summary>
  2003. /// 保存半检数据
  2004. /// </summary>
  2005. /// <param name="accountCode">帐套code</param>
  2006. /// <param name="userCode">用户code</param>
  2007. /// <param name="userPassword">用户密码</param>
  2008. /// <param name="sessionKey">本次登陆密钥</param>
  2009. /// <param name="productionDataEntitys">半检信息</param>
  2010. /// <returns></returns>
  2011. public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  2012. {
  2013. ActionResult actionResult = new ActionResult();
  2014. try
  2015. {
  2016. // 验证请求头信息
  2017. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2018. // 验证失败
  2019. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2020. {
  2021. return actionResult;
  2022. }
  2023. string err = ServiceInvoker.Invoke<string>(this,
  2024. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2025. if (err == null)
  2026. {
  2027. err = "";
  2028. }
  2029. actionResult.Result = JsonHelper.ToJson(err);
  2030. actionResult.Status = (int)Constant.PDAResult.Success;
  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. #endregion
  2046. /// <summary>
  2047. /// 获取产品列表
  2048. /// </summary>
  2049. /// <returns></returns>
  2050. public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  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. GoodsEntity goodsEntity = new GoodsEntity();
  2063. goodsEntity.ValueFlag = 1;//有效标记
  2064. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2065. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2066. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2067. {
  2068. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2069. actionResult.Status = (int)Constant.PDAResult.Success;
  2070. }
  2071. else
  2072. {
  2073. actionResult.Status = (int)Constant.PDAResult.Fail;
  2074. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2075. }
  2076. }
  2077. catch (Exception ex)
  2078. {
  2079. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2080. OutputLog.TraceLog(LogPriority.Error,
  2081. this.ToString(),
  2082. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2083. ex.ToString(),
  2084. LocalPath.LogExePath);
  2085. actionResult.Status = (int)Constant.PDAResult.Exception;
  2086. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2087. }
  2088. return actionResult;
  2089. }
  2090. /// <summary>
  2091. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2092. /// </summary>
  2093. /// <param name="searchEntity">生产数据实体类</param>
  2094. /// <returns>DataTable</returns>
  2095. public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2096. {
  2097. ActionResult actionResult = new ActionResult();
  2098. try
  2099. {
  2100. // 验证请求头信息
  2101. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2102. // 验证失败
  2103. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2104. {
  2105. return actionResult;
  2106. }
  2107. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2108. searchEntity.ProcedureID = ProcedureID;
  2109. searchEntity.BarCode = BarCode;
  2110. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2111. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2112. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2113. {
  2114. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2115. actionResult.Status = (int)Constant.PDAResult.Success;
  2116. }
  2117. else
  2118. {
  2119. actionResult.Status = (int)Constant.PDAResult.Fail;
  2120. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2121. }
  2122. }
  2123. catch (Exception ex)
  2124. {
  2125. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2126. OutputLog.TraceLog(LogPriority.Error,
  2127. this.ToString(),
  2128. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2129. ex.ToString(),
  2130. LocalPath.LogExePath);
  2131. actionResult.Status = (int)Constant.PDAResult.Exception;
  2132. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2133. }
  2134. return actionResult;
  2135. }
  2136. /// <summary>
  2137. /// 根据所选生产数据ID,显示成检数据信息
  2138. /// </summary>
  2139. /// <param name="productionDataID">生产数据ID</param>
  2140. /// <returns>DataSet</returns>
  2141. public ActionResult GetProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2142. {
  2143. ActionResult actionResult = new ActionResult();
  2144. try
  2145. {
  2146. // 验证请求头信息
  2147. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2148. // 验证失败
  2149. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2150. {
  2151. return actionResult;
  2152. }
  2153. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2154. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2155. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2156. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2157. {
  2158. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2159. {
  2160. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2161. {
  2162. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2163. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2164. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2165. {
  2166. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2167. }
  2168. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2169. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2170. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2171. {
  2172. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2173. }
  2174. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2175. {
  2176. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2177. }
  2178. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2179. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2180. {
  2181. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2182. }
  2183. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2184. {
  2185. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2186. }
  2187. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2188. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2189. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2190. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2191. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2192. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2193. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2194. {
  2195. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2196. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2197. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2198. }
  2199. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2200. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2201. {
  2202. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2203. }
  2204. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2205. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2206. DataTable dtDefect = dvDefect.ToTable();
  2207. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2208. {
  2209. // 产品缺陷
  2210. PDADefectResult defect = new PDADefectResult();
  2211. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2212. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2213. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2214. {
  2215. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2216. }
  2217. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2218. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2219. {
  2220. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2221. }
  2222. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2223. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2224. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2225. {
  2226. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2227. }
  2228. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2229. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2230. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2231. {
  2232. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2233. }
  2234. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2235. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2236. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2237. {
  2238. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2239. }
  2240. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2241. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2242. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2243. {
  2244. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2245. }
  2246. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2247. {
  2248. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2249. }
  2250. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2251. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2252. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2253. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2254. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2255. {
  2256. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2257. }
  2258. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2259. {
  2260. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2261. }
  2262. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2263. {
  2264. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2265. }
  2266. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2267. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2268. //--------责任员工-------------------
  2269. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2270. if (drRow.Length > Constant.INT_IS_ZERO)
  2271. {
  2272. foreach (DataRow r in drRow)
  2273. {
  2274. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2275. if (r["ProductionDefectID"].ToString() != "")
  2276. {
  2277. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2278. }
  2279. if (r["StaffID"].ToString() != "")
  2280. {
  2281. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2282. }
  2283. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2284. defectResponsible.StaffName = r["StaffName"].ToString();
  2285. if (r["StaffStatus"].ToString() != "")
  2286. {
  2287. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2288. }
  2289. if (r["UJobsID"].ToString() != "")
  2290. {
  2291. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2292. }
  2293. if (r["SJobsID"].ToString() != "")
  2294. {
  2295. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2296. }
  2297. defect.PDADefectResponsibles.Add(defectResponsible);
  2298. }
  2299. }
  2300. //------------------------------
  2301. //--------漏检员工-------------------
  2302. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2303. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2304. {
  2305. foreach (DataRow r in drMissedRow)
  2306. {
  2307. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2308. if (r["ProductionDefectID"].ToString() != "")
  2309. {
  2310. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2311. }
  2312. if (r["StaffID"].ToString() != "")
  2313. {
  2314. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2315. }
  2316. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2317. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2318. if (r["StaffStatus"].ToString() != "")
  2319. {
  2320. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2321. }
  2322. if (r["UJobsID"].ToString() != "")
  2323. {
  2324. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2325. }
  2326. if (r["SJobsID"].ToString() != "")
  2327. {
  2328. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2329. }
  2330. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2331. }
  2332. }
  2333. //------------------------------
  2334. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2335. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2336. {
  2337. foreach (DataRow r in drImageRow)
  2338. {
  2339. PDADefectImageResult defectImage = new PDADefectImageResult();
  2340. if (r["ProductionDefectID"].ToString() != "")
  2341. {
  2342. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2343. }
  2344. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2345. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2346. //{
  2347. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2348. //}
  2349. defect.PDADefectImageResults.Add(defectImage);
  2350. }
  2351. }
  2352. productionData.PDADefects.Add(defect);
  2353. }
  2354. if (productionDatas.PDAProductionData == null)
  2355. {
  2356. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2357. }
  2358. productionDatas.PDAProductionData.Add(productionData);
  2359. //---------------------------------------------------------------------------------
  2360. }
  2361. }
  2362. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2363. actionResult.Status = (int)Constant.PDAResult.Success;
  2364. }
  2365. else
  2366. {
  2367. actionResult.Status = (int)Constant.PDAResult.Fail;
  2368. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2369. }
  2370. }
  2371. catch (Exception ex)
  2372. {
  2373. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2374. OutputLog.TraceLog(LogPriority.Error,
  2375. this.ToString(),
  2376. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2377. ex.ToString(),
  2378. LocalPath.LogExePath);
  2379. actionResult.Status = (int)Constant.PDAResult.Exception;
  2380. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2381. }
  2382. return actionResult;
  2383. }
  2384. /// <summary>
  2385. /// 编辑后删除生产数据
  2386. /// </summary>
  2387. /// <param name="productionDataID">生产数据ID</param>
  2388. /// <returns>int</returns>
  2389. public ActionResult DeleteProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2390. {
  2391. ActionResult actionResult = new ActionResult();
  2392. try
  2393. {
  2394. // 验证请求头信息
  2395. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2396. // 验证失败
  2397. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2398. {
  2399. return actionResult;
  2400. }
  2401. int row = ServiceInvoker.Invoke<int>(this,
  2402. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2403. actionResult.Result = JsonHelper.ToJson(row);
  2404. actionResult.Status = (int)Constant.PDAResult.Success;
  2405. }
  2406. catch (Exception ex)
  2407. {
  2408. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2409. OutputLog.TraceLog(LogPriority.Error,
  2410. this.ToString(),
  2411. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2412. ex.ToString(),
  2413. LocalPath.LogExePath);
  2414. actionResult.Status = (int)Constant.PDAResult.Exception;
  2415. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2416. }
  2417. return actionResult;
  2418. }
  2419. /// <summary>
  2420. /// 获取产品完成工序的ID
  2421. /// </summary>
  2422. /// <param name="barcode">产品条码</param>
  2423. /// <returns>int</returns>
  2424. public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2425. {
  2426. ActionResult actionResult = new ActionResult();
  2427. try
  2428. {
  2429. // 验证请求头信息
  2430. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2431. // 验证失败
  2432. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2433. {
  2434. return actionResult;
  2435. }
  2436. int row = ServiceInvoker.Invoke<int>(this,
  2437. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2438. actionResult.Result = JsonHelper.ToJson(row);
  2439. actionResult.Status = (int)Constant.PDAResult.Success;
  2440. }
  2441. catch (Exception ex)
  2442. {
  2443. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2444. OutputLog.TraceLog(LogPriority.Error,
  2445. this.ToString(),
  2446. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2447. ex.ToString(),
  2448. LocalPath.LogExePath);
  2449. actionResult.Status = (int)Constant.PDAResult.Exception;
  2450. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2451. }
  2452. return actionResult;
  2453. }
  2454. /// <summary>
  2455. /// 绑定图片
  2456. /// </summary>
  2457. /// <param name="accountCode">帐套code</param>
  2458. /// <param name="userCode">用户code</param>
  2459. /// <param name="userPassword">用户密码</param>
  2460. /// <param name="sessionKey">本次登陆密钥</param>
  2461. /// <param name="imagePath">图片路径</param>
  2462. /// <returns></returns>
  2463. public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2464. {
  2465. try
  2466. {
  2467. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2468. }
  2469. catch (Exception ex)
  2470. {
  2471. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2472. OutputLog.TraceLog(LogPriority.Error,
  2473. this.ToString(),
  2474. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2475. ex.ToString(),
  2476. LocalPath.LogExePath);
  2477. return null;
  2478. }
  2479. }
  2480. /// <summary>
  2481. /// 根据所选工号对应的工种,查出缺陷责任员工
  2482. /// </summary>
  2483. /// <param name="jobs">工种ID</param>
  2484. /// <returns></returns>
  2485. public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2486. {
  2487. ActionResult actionResult = new ActionResult();
  2488. try
  2489. {
  2490. // 验证请求头信息
  2491. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2492. // 验证失败
  2493. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2494. {
  2495. return actionResult;
  2496. }
  2497. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2498. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2499. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2500. {
  2501. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2502. actionResult.Status = (int)Constant.PDAResult.Success;
  2503. }
  2504. else
  2505. {
  2506. actionResult.Status = (int)Constant.PDAResult.Fail;
  2507. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2508. }
  2509. }
  2510. catch (Exception ex)
  2511. {
  2512. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2513. OutputLog.TraceLog(LogPriority.Error,
  2514. this.ToString(),
  2515. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2516. ex.ToString(),
  2517. LocalPath.LogExePath);
  2518. actionResult.Status = (int)Constant.PDAResult.Exception;
  2519. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2520. }
  2521. return actionResult;
  2522. }
  2523. #region 产品报废
  2524. /// <summary>
  2525. /// 验证废弃产品唯一性
  2526. /// </summary>
  2527. /// <param name="barcode">产品条码</param>
  2528. /// <returns>int</returns>
  2529. public ActionResult ScrapProductChack(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2530. {
  2531. ActionResult actionResult = new ActionResult();
  2532. try
  2533. {
  2534. // 验证请求头信息
  2535. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2536. // 验证失败
  2537. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2538. {
  2539. return actionResult;
  2540. }
  2541. string row = ServiceInvoker.Invoke<string>(this,
  2542. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2543. string[] rm = row.Split(':');
  2544. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2545. if (rm.Length > 1)
  2546. {
  2547. actionResult.Message = rm[1];
  2548. }
  2549. actionResult.Status = (int)Constant.PDAResult.Success;
  2550. }
  2551. catch (Exception ex)
  2552. {
  2553. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2554. OutputLog.TraceLog(LogPriority.Error,
  2555. this.ToString(),
  2556. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2557. ex.ToString(),
  2558. LocalPath.LogExePath);
  2559. actionResult.Status = (int)Constant.PDAResult.Exception;
  2560. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2561. }
  2562. return actionResult;
  2563. }
  2564. /// <summary>
  2565. /// 根据条码获取该产品的在产信息以及生产数据
  2566. /// </summary>
  2567. /// <param name="Barcode">产品条码</param>
  2568. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2569. public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2570. {
  2571. ActionResult actionResult = new ActionResult();
  2572. try
  2573. {
  2574. // 验证请求头信息
  2575. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2576. // 验证失败
  2577. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2578. {
  2579. return actionResult;
  2580. }
  2581. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2582. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2583. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2584. {
  2585. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2586. actionResult.Status = (int)Constant.PDAResult.Success;
  2587. }
  2588. else
  2589. {
  2590. actionResult.Status = (int)Constant.PDAResult.Fail;
  2591. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2592. }
  2593. }
  2594. catch (Exception ex)
  2595. {
  2596. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2597. OutputLog.TraceLog(LogPriority.Error,
  2598. this.ToString(),
  2599. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2600. ex.ToString(),
  2601. LocalPath.LogExePath);
  2602. actionResult.Status = (int)Constant.PDAResult.Exception;
  2603. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2604. }
  2605. return actionResult;
  2606. }
  2607. /// <summary>
  2608. /// 根据工号查询员工档案信息
  2609. /// </summary>
  2610. /// <param name="accountCode"></param>
  2611. /// <param name="userCode"></param>
  2612. /// <param name="userPassword"></param>
  2613. /// <param name="sessionKey"></param>
  2614. /// <param name="userId"></param>
  2615. /// <returns></returns>
  2616. public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2617. {
  2618. ActionResult actionResult = new ActionResult();
  2619. try
  2620. {
  2621. // 验证请求头信息
  2622. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2623. // 验证失败
  2624. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2625. {
  2626. return actionResult;
  2627. }
  2628. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2629. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2630. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2631. {
  2632. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2633. actionResult.Status = (int)Constant.PDAResult.Success;
  2634. }
  2635. else
  2636. {
  2637. actionResult.Status = (int)Constant.PDAResult.Fail;
  2638. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2639. }
  2640. }
  2641. catch (Exception ex)
  2642. {
  2643. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2644. OutputLog.TraceLog(LogPriority.Error,
  2645. this.ToString(),
  2646. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2647. ex.ToString(),
  2648. LocalPath.LogExePath);
  2649. actionResult.Status = (int)Constant.PDAResult.Exception;
  2650. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2651. }
  2652. return actionResult;
  2653. }
  2654. /// <summary>
  2655. /// 添加废弃产品记录
  2656. /// </summary>
  2657. /// <param name="SProductEntity">废弃产品实体</param>
  2658. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2659. /// <param name="SResponsibleList">责任者集合</param>
  2660. /// <param name="userInfo">用户基本信息</param>
  2661. /// <returns>int结果返回值</returns>
  2662. /// <remarks>
  2663. /// 庄天威 2014.09.24 新建
  2664. /// </remarks>
  2665. public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey,
  2666. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2667. ScrapResponsibleEntity[] SResponsibleList)
  2668. {
  2669. ActionResult actionResult = new ActionResult();
  2670. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2671. {
  2672. actionResult.Status = (int)Constant.PDAResult.Fail;
  2673. actionResult.Message = "没有选择责任人";
  2674. }
  2675. try
  2676. {
  2677. // 验证请求头信息
  2678. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2679. // 验证失败
  2680. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2681. {
  2682. return actionResult;
  2683. }
  2684. int addRow = ServiceInvoker.Invoke<int>(this,
  2685. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  2686. actionResult.Result = JsonHelper.ToJson(addRow);
  2687. actionResult.Status = (int)Constant.PDAResult.Success;
  2688. }
  2689. catch (Exception ex)
  2690. {
  2691. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2692. OutputLog.TraceLog(LogPriority.Error,
  2693. this.ToString(),
  2694. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2695. ex.ToString(),
  2696. LocalPath.LogExePath);
  2697. actionResult.Status = (int)Constant.PDAResult.Exception;
  2698. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2699. // TODO 空指针异常问题检测
  2700. try
  2701. {
  2702. OutputLog.TraceLog(LogPriority.Error,
  2703. this.ToString(),
  2704. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2705. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  2706. LocalPath.LogExePath);
  2707. string json1 = JsonHelper.ToJson(SProductEntity);
  2708. OutputLog.TraceLog(LogPriority.Error,
  2709. this.ToString(),
  2710. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2711. "SProductEntity:" + json1,
  2712. LocalPath.LogExePath);
  2713. string json2 = JsonHelper.ToJson(RProcedureEntity);
  2714. OutputLog.TraceLog(LogPriority.Error,
  2715. this.ToString(),
  2716. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2717. "RProcedureEntity:" + json2,
  2718. LocalPath.LogExePath);
  2719. string json3 = JsonHelper.ToJson(SResponsibleList);
  2720. OutputLog.TraceLog(LogPriority.Error,
  2721. this.ToString(),
  2722. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2723. "SResponsibleList:" + json3,
  2724. LocalPath.LogExePath);
  2725. }
  2726. catch (Exception exc)
  2727. {
  2728. OutputLog.TraceLog(LogPriority.Error,
  2729. this.ToString(),
  2730. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2731. "参数输入异常:" + exc.Message,
  2732. LocalPath.LogExePath);
  2733. }
  2734. }
  2735. return actionResult;
  2736. }
  2737. /// <summary>
  2738. /// 获取产品分级的数据(根据ID)
  2739. /// </summary>
  2740. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  2741. /// <param name="GoodsLevelID">分类ID</param>
  2742. /// <param name="sUserInfo">用户基本信息</param>
  2743. /// <returns>DataSet</returns>
  2744. /// <remarks>
  2745. /// 2014.10.22 庄天威 新建
  2746. public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  2747. {
  2748. ActionResult actionResult = new ActionResult();
  2749. try
  2750. {
  2751. // 验证请求头信息
  2752. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2753. // 验证失败
  2754. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2755. {
  2756. return actionResult;
  2757. }
  2758. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2759. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  2760. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2761. {
  2762. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2763. actionResult.Status = (int)Constant.PDAResult.Success;
  2764. }
  2765. else
  2766. {
  2767. actionResult.Status = (int)Constant.PDAResult.Fail;
  2768. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2769. }
  2770. }
  2771. catch (Exception ex)
  2772. {
  2773. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2774. OutputLog.TraceLog(LogPriority.Error,
  2775. this.ToString(),
  2776. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2777. ex.ToString(),
  2778. LocalPath.LogExePath);
  2779. actionResult.Status = (int)Constant.PDAResult.Exception;
  2780. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2781. }
  2782. return actionResult;
  2783. }
  2784. /// <summary>
  2785. /// 获取账务日期
  2786. /// </summary>
  2787. /// <param name="accountCode"></param>
  2788. /// <param name="userCode"></param>
  2789. /// <param name="userPassword"></param>
  2790. /// <param name="sessionKey"></param>
  2791. /// <returns></returns>
  2792. public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey)
  2793. {
  2794. ActionResult actionResult = new ActionResult();
  2795. try
  2796. {
  2797. // 验证请求头信息
  2798. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2799. // 验证失败
  2800. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2801. {
  2802. return actionResult;
  2803. }
  2804. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  2805. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  2806. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2807. actionResult.Status = (int)Constant.PDAResult.Success;
  2808. }
  2809. catch (Exception ex)
  2810. {
  2811. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2812. OutputLog.TraceLog(LogPriority.Error,
  2813. this.ToString(),
  2814. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2815. ex.ToString(),
  2816. LocalPath.LogExePath);
  2817. actionResult.Status = (int)Constant.PDAResult.Exception;
  2818. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2819. }
  2820. return actionResult;
  2821. }
  2822. /// <summary>
  2823. /// 获取登陆帐户有无报损权限
  2824. /// </summary>
  2825. /// <param name="accountCode"></param>
  2826. /// <param name="userCode"></param>
  2827. /// <param name="userPassword"></param>
  2828. /// <param name="sessionKey"></param>
  2829. /// <param name="usercode">工号编码</param>
  2830. /// <returns></returns>
  2831. public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  2832. {
  2833. ActionResult actionResult = new ActionResult();
  2834. try
  2835. {
  2836. // 验证请求头信息
  2837. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2838. // 验证失败
  2839. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2840. {
  2841. return actionResult;
  2842. }
  2843. int returnValue = ServiceInvoker.Invoke<int>(this,
  2844. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  2845. actionResult.Result = JsonHelper.ToJson(returnValue);
  2846. actionResult.Status = (int)Constant.PDAResult.Success;
  2847. }
  2848. catch (Exception ex)
  2849. {
  2850. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2851. OutputLog.TraceLog(LogPriority.Error,
  2852. this.ToString(),
  2853. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2854. ex.ToString(),
  2855. LocalPath.LogExePath);
  2856. actionResult.Status = (int)Constant.PDAResult.Exception;
  2857. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2858. }
  2859. return actionResult;
  2860. }
  2861. #endregion
  2862. /// <summary>
  2863. /// 获取是否存在报损未审核产品
  2864. /// </summary>
  2865. /// <param name="barcode">产品条码</param>
  2866. /// <returns>int</returns>
  2867. public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2868. {
  2869. ActionResult actionResult = new ActionResult();
  2870. try
  2871. {
  2872. // 验证请求头信息
  2873. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2874. // 验证失败
  2875. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2876. {
  2877. return actionResult;
  2878. }
  2879. int row = ServiceInvoker.Invoke<int>(this,
  2880. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  2881. actionResult.Result = JsonHelper.ToJson(row);
  2882. actionResult.Status = (int)Constant.PDAResult.Success;
  2883. }
  2884. catch (Exception ex)
  2885. {
  2886. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2887. OutputLog.TraceLog(LogPriority.Error,
  2888. this.ToString(),
  2889. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2890. ex.ToString(),
  2891. LocalPath.LogExePath);
  2892. actionResult.Status = (int)Constant.PDAResult.Exception;
  2893. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2894. }
  2895. return actionResult;
  2896. }
  2897. /// <summary>
  2898. /// 查询报废产品信息
  2899. /// </summary>
  2900. /// <param name="accountCode"></param>
  2901. /// <param name="userCode"></param>
  2902. /// <param name="userPassword"></param>
  2903. /// <param name="sessionKey"></param>
  2904. /// <param name="barCode">产品条码</param>
  2905. /// <param name="scrapProductID">报废产品ID</param>
  2906. /// <returns></returns>
  2907. public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  2908. {
  2909. ActionResult actionResult = new ActionResult();
  2910. try
  2911. {
  2912. // 验证请求头信息
  2913. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2914. // 验证失败
  2915. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2916. {
  2917. return actionResult;
  2918. }
  2919. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  2920. selectProEntity.BarCode = barCode;
  2921. selectProEntity.ScrapProductID = scrapProductID;
  2922. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2923. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  2924. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2925. {
  2926. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2927. actionResult.Status = (int)Constant.PDAResult.Success;
  2928. }
  2929. else
  2930. {
  2931. actionResult.Status = (int)Constant.PDAResult.Fail;
  2932. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2933. }
  2934. }
  2935. catch (Exception ex)
  2936. {
  2937. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2938. OutputLog.TraceLog(LogPriority.Error,
  2939. this.ToString(),
  2940. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2941. ex.ToString(),
  2942. LocalPath.LogExePath);
  2943. actionResult.Status = (int)Constant.PDAResult.Exception;
  2944. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2945. }
  2946. return actionResult;
  2947. }
  2948. /// <summary>
  2949. /// 根据废弃产品ID获取责任工序
  2950. /// </summary>
  2951. /// <param name="accountCode"></param>
  2952. /// <param name="userCode"></param>
  2953. /// <param name="userPassword"></param>
  2954. /// <param name="sessionKey"></param>
  2955. /// <param name="scrapProductID">报废产品ID</param>
  2956. /// <returns></returns>
  2957. public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  2958. {
  2959. ActionResult actionResult = new ActionResult();
  2960. try
  2961. {
  2962. // 验证请求头信息
  2963. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2964. // 验证失败
  2965. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2966. {
  2967. return actionResult;
  2968. }
  2969. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2970. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  2971. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2972. {
  2973. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2974. actionResult.Status = (int)Constant.PDAResult.Success;
  2975. }
  2976. else
  2977. {
  2978. actionResult.Status = (int)Constant.PDAResult.Fail;
  2979. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2980. }
  2981. }
  2982. catch (Exception ex)
  2983. {
  2984. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2985. OutputLog.TraceLog(LogPriority.Error,
  2986. this.ToString(),
  2987. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2988. ex.ToString(),
  2989. LocalPath.LogExePath);
  2990. actionResult.Status = (int)Constant.PDAResult.Exception;
  2991. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2992. }
  2993. return actionResult;
  2994. }
  2995. /// <summary>
  2996. /// 根据废弃产品ID获取责任人列表
  2997. /// </summary>
  2998. /// <param name="accountCode"></param>
  2999. /// <param name="userCode"></param>
  3000. /// <param name="userPassword"></param>
  3001. /// <param name="sessionKey"></param>
  3002. /// <param name="scrapProductID">报废产品ID</param>
  3003. /// <returns></returns>
  3004. public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3005. {
  3006. ActionResult actionResult = new ActionResult();
  3007. try
  3008. {
  3009. // 验证请求头信息
  3010. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3011. // 验证失败
  3012. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3013. {
  3014. return actionResult;
  3015. }
  3016. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3017. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  3018. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3019. {
  3020. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3021. actionResult.Status = (int)Constant.PDAResult.Success;
  3022. }
  3023. else
  3024. {
  3025. actionResult.Status = (int)Constant.PDAResult.Fail;
  3026. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3027. }
  3028. }
  3029. catch (Exception ex)
  3030. {
  3031. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3032. OutputLog.TraceLog(LogPriority.Error,
  3033. this.ToString(),
  3034. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3035. ex.ToString(),
  3036. LocalPath.LogExePath);
  3037. actionResult.Status = (int)Constant.PDAResult.Exception;
  3038. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3039. }
  3040. return actionResult;
  3041. }
  3042. /// <summary>
  3043. /// 添加废弃产品记录
  3044. /// </summary>
  3045. /// <param name="SProductEntity">废弃产品实体</param>
  3046. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3047. /// <param name="SResponsibleList">责任者集合</param>
  3048. /// <param name="userInfo">用户基本信息</param>
  3049. /// <returns>int结果返回值</returns>
  3050. /// <remarks>
  3051. /// 庄天威 2014.09.24 新建
  3052. /// </remarks>
  3053. public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3054. ResponProcedureEntity UpdateRProcedureEntity,
  3055. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3056. {
  3057. ActionResult actionResult = new ActionResult();
  3058. try
  3059. {
  3060. // 验证请求头信息
  3061. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3062. // 验证失败
  3063. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3064. {
  3065. return actionResult;
  3066. }
  3067. int addRow = ServiceInvoker.Invoke<int>(this,
  3068. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3069. actionResult.Result = JsonHelper.ToJson(addRow);
  3070. actionResult.Status = (int)Constant.PDAResult.Success;
  3071. }
  3072. catch (Exception ex)
  3073. {
  3074. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3075. OutputLog.TraceLog(LogPriority.Error,
  3076. this.ToString(),
  3077. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3078. ex.ToString(),
  3079. LocalPath.LogExePath);
  3080. actionResult.Status = (int)Constant.PDAResult.Exception;
  3081. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3082. }
  3083. return actionResult;
  3084. }
  3085. /// <summary>
  3086. /// 获取产品窑炉
  3087. /// </summary>
  3088. /// <param name="accountCode"></param>
  3089. /// <param name="userCode"></param>
  3090. /// <param name="userPassword"></param>
  3091. /// <param name="sessionKey"></param>
  3092. /// <returns>Datase</returns>
  3093. public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  3094. {
  3095. ActionResult actionResult = new ActionResult();
  3096. try
  3097. {
  3098. // 验证请求头信息
  3099. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3100. // 验证失败
  3101. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3102. {
  3103. return actionResult;
  3104. }
  3105. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3106. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3107. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3108. {
  3109. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3110. actionResult.Status = (int)Constant.PDAResult.Success;
  3111. }
  3112. else
  3113. {
  3114. actionResult.Status = (int)Constant.PDAResult.Fail;
  3115. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3116. }
  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. /// <returns>Datase</returns>
  3140. public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3141. {
  3142. ActionResult actionResult = new ActionResult();
  3143. try
  3144. {
  3145. // 验证请求头信息
  3146. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3147. // 验证失败
  3148. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3149. {
  3150. return actionResult;
  3151. }
  3152. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3153. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3154. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3155. {
  3156. actionResult.Result = JsonHelper.ToJson(1);
  3157. actionResult.Status = (int)Constant.PDAResult.Success;
  3158. }
  3159. else
  3160. {
  3161. actionResult.Result = JsonHelper.ToJson(0);
  3162. actionResult.Status = (int)Constant.PDAResult.Fail;
  3163. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3164. }
  3165. }
  3166. catch (Exception ex)
  3167. {
  3168. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3169. OutputLog.TraceLog(LogPriority.Error,
  3170. this.ToString(),
  3171. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3172. ex.ToString(),
  3173. LocalPath.LogExePath);
  3174. actionResult.Status = (int)Constant.PDAResult.Exception;
  3175. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3176. }
  3177. return actionResult;
  3178. }
  3179. /// <summary>
  3180. /// 获取产品条码是否重烧
  3181. /// </summary>
  3182. /// <param name="accountCode"></param>
  3183. /// <param name="userCode"></param>
  3184. /// <param name="userPassword"></param>
  3185. /// <param name="sessionKey"></param>
  3186. /// <param name="barcode">产品条码</param>
  3187. /// <returns>Datase</returns>
  3188. public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3189. {
  3190. ActionResult actionResult = new ActionResult();
  3191. try
  3192. {
  3193. // 验证请求头信息
  3194. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3195. // 验证失败
  3196. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3197. {
  3198. return actionResult;
  3199. }
  3200. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3201. () => PDAModuleLogic.GetReFine(barcode));
  3202. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3203. {
  3204. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3205. }
  3206. else
  3207. {
  3208. actionResult.Result = JsonHelper.ToJson(0);
  3209. }
  3210. actionResult.Status = (int)Constant.PDAResult.Success;
  3211. }
  3212. catch (Exception ex)
  3213. {
  3214. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3215. OutputLog.TraceLog(LogPriority.Error,
  3216. this.ToString(),
  3217. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3218. ex.ToString(),
  3219. LocalPath.LogExePath);
  3220. actionResult.Status = (int)Constant.PDAResult.Exception;
  3221. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3222. }
  3223. return actionResult;
  3224. }
  3225. /// <summary>
  3226. /// 获取登陆帐户有无成检编辑权限
  3227. /// </summary>
  3228. /// <param name="accountCode"></param>
  3229. /// <param name="userCode"></param>
  3230. /// <param name="userPassword"></param>
  3231. /// <param name="sessionKey"></param>
  3232. /// <param name="usercode">工号编码</param>
  3233. /// <returns></returns>
  3234. public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3235. {
  3236. ActionResult actionResult = new ActionResult();
  3237. try
  3238. {
  3239. // 验证请求头信息
  3240. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3241. // 验证失败
  3242. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3243. {
  3244. return actionResult;
  3245. }
  3246. int returnValue = ServiceInvoker.Invoke<int>(this,
  3247. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3248. actionResult.Result = JsonHelper.ToJson(returnValue);
  3249. actionResult.Status = (int)Constant.PDAResult.Success;
  3250. }
  3251. catch (Exception ex)
  3252. {
  3253. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3254. OutputLog.TraceLog(LogPriority.Error,
  3255. this.ToString(),
  3256. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3257. ex.ToString(),
  3258. LocalPath.LogExePath);
  3259. actionResult.Status = (int)Constant.PDAResult.Exception;
  3260. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3261. }
  3262. return actionResult;
  3263. }
  3264. /// <summary>
  3265. /// 根据条码及工序判断是否漏扫
  3266. /// </summary>
  3267. /// <param name="accountCode"></param>
  3268. /// <param name="userCode"></param>
  3269. /// <param name="userPassword"></param>
  3270. /// <param name="sessionKey"></param>
  3271. /// <param name="usercode">工号编码</param>
  3272. /// <param name="barcode">产品条码</param>
  3273. /// <param name="produceid">工序ID</param>
  3274. /// <returns></returns>
  3275. public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3276. {
  3277. ActionResult actionResult = new ActionResult();
  3278. try
  3279. {
  3280. // 验证请求头信息
  3281. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3282. // 验证失败
  3283. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3284. {
  3285. return actionResult;
  3286. }
  3287. int returnValue = 1;
  3288. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3289. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3290. actionResult.Result = JsonHelper.ToJson(returnValue);
  3291. actionResult.Status = (int)Constant.PDAResult.Success;
  3292. }
  3293. catch (Exception ex)
  3294. {
  3295. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3296. OutputLog.TraceLog(LogPriority.Error,
  3297. this.ToString(),
  3298. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3299. ex.ToString(),
  3300. LocalPath.LogExePath);
  3301. actionResult.Status = (int)Constant.PDAResult.Exception;
  3302. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3303. }
  3304. return actionResult;
  3305. }
  3306. /// <summary>
  3307. /// 获取登陆帐户有无报损审批权限
  3308. /// </summary>
  3309. /// <param name="accountCode"></param>
  3310. /// <param name="userCode"></param>
  3311. /// <param name="userPassword"></param>
  3312. /// <param name="sessionKey"></param>
  3313. /// <param name="usercode">工号编码</param>
  3314. /// <returns></returns>
  3315. public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3316. {
  3317. ActionResult actionResult = new ActionResult();
  3318. try
  3319. {
  3320. // 验证请求头信息
  3321. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3322. // 验证失败
  3323. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3324. {
  3325. return actionResult;
  3326. }
  3327. int returnValue = ServiceInvoker.Invoke<int>(this,
  3328. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3329. actionResult.Result = JsonHelper.ToJson(returnValue);
  3330. actionResult.Status = (int)Constant.PDAResult.Success;
  3331. }
  3332. catch (Exception ex)
  3333. {
  3334. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3335. OutputLog.TraceLog(LogPriority.Error,
  3336. this.ToString(),
  3337. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3338. ex.ToString(),
  3339. LocalPath.LogExePath);
  3340. actionResult.Status = (int)Constant.PDAResult.Exception;
  3341. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3342. }
  3343. return actionResult;
  3344. }
  3345. /// <summary>
  3346. /// 获取登陆帐户有无报损审批权限
  3347. /// </summary>
  3348. /// <param name="accountCode"></param>
  3349. /// <param name="userCode"></param>
  3350. /// <param name="userPassword"></param>
  3351. /// <param name="sessionKey"></param>
  3352. /// <param name="usercode">工号编码</param>
  3353. /// <returns></returns>
  3354. public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3355. {
  3356. ActionResult actionResult = new ActionResult();
  3357. try
  3358. {
  3359. // 验证请求头信息
  3360. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3361. // 验证失败
  3362. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3363. {
  3364. return actionResult;
  3365. }
  3366. int returnValue = ServiceInvoker.Invoke<int>(this,
  3367. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3368. actionResult.Result = JsonHelper.ToJson(returnValue);
  3369. actionResult.Status = (int)Constant.PDAResult.Success;
  3370. }
  3371. catch (Exception ex)
  3372. {
  3373. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3374. OutputLog.TraceLog(LogPriority.Error,
  3375. this.ToString(),
  3376. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3377. ex.ToString(),
  3378. LocalPath.LogExePath);
  3379. actionResult.Status = (int)Constant.PDAResult.Exception;
  3380. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3381. }
  3382. return actionResult;
  3383. }
  3384. /// <summary>
  3385. /// 获取窑车对应产品列表
  3386. /// </summary>
  3387. /// <param name="accountCode"></param>
  3388. /// <param name="userCode"></param>
  3389. /// <param name="userPassword"></param>
  3390. /// <param name="sessionKey"></param>
  3391. /// <param name="KilnCarID">窑车ID</param>
  3392. /// <returns>Dataset</returns>
  3393. public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  3394. {
  3395. ActionResult actionResult = new ActionResult();
  3396. try
  3397. {
  3398. // 验证请求头信息
  3399. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3400. // 验证失败
  3401. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3402. {
  3403. return actionResult;
  3404. }
  3405. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3406. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3407. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3408. {
  3409. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3410. actionResult.Status = (int)Constant.PDAResult.Success;
  3411. }
  3412. else
  3413. {
  3414. actionResult.Status = (int)Constant.PDAResult.Fail;
  3415. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3416. }
  3417. }
  3418. catch (Exception ex)
  3419. {
  3420. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3421. OutputLog.TraceLog(LogPriority.Error,
  3422. this.ToString(),
  3423. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3424. ex.ToString(),
  3425. LocalPath.LogExePath);
  3426. actionResult.Status = (int)Constant.PDAResult.Exception;
  3427. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3428. }
  3429. return actionResult;
  3430. }
  3431. /// <summary>
  3432. /// 更换条码
  3433. /// </summary>
  3434. /// <param name="accountCode"></param>
  3435. /// <param name="userCode"></param>
  3436. /// <param name="userPassword"></param>
  3437. /// <param name="sessionKey"></param>
  3438. ///<param name="barcode">原条码</param>
  3439. /// <param name="newBarcode">新条码</param>
  3440. /// <param name="remarks">备注</param>
  3441. /// <returns>操作结果</returns>
  3442. public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  3443. {
  3444. ActionResult actionResult = new ActionResult();
  3445. try
  3446. {
  3447. // 验证请求头信息
  3448. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3449. // 验证失败
  3450. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3451. {
  3452. return actionResult;
  3453. }
  3454. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3455. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3456. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3457. {
  3458. actionResult.Result = 1;
  3459. actionResult.Status = (int)Constant.PDAResult.Success;
  3460. }
  3461. else
  3462. {
  3463. actionResult.Status = (int)Constant.PDAResult.Fail;
  3464. actionResult.Message = serviceResultEntity.Message;
  3465. }
  3466. }
  3467. catch (Exception ex)
  3468. {
  3469. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3470. OutputLog.TraceLog(LogPriority.Error,
  3471. this.ToString(),
  3472. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3473. ex.ToString(),
  3474. LocalPath.LogExePath);
  3475. actionResult.Status = (int)Constant.PDAResult.Exception;
  3476. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3477. }
  3478. return actionResult;
  3479. }
  3480. /// <summary>
  3481. /// 获取(注浆登记)的查询数据
  3482. /// </summary>
  3483. /// <param name="accountCode"></param>
  3484. /// <param name="userCode"></param>
  3485. /// <param name="userPassword"></param>
  3486. /// <param name="sessionKey"></param>
  3487. /// <param name="se">查询条件</param>
  3488. /// <returns>Dataset</returns>
  3489. public ActionResult GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  3490. {
  3491. ActionResult actionResult = new ActionResult();
  3492. try
  3493. {
  3494. // 验证请求头信息
  3495. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3496. // 验证失败
  3497. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3498. {
  3499. return actionResult;
  3500. }
  3501. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3502. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3503. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3504. {
  3505. // PDA不显示的列删除掉
  3506. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3507. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3508. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3509. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3510. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3511. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3512. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3513. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3514. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3515. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3516. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3517. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3518. actionResult.Status = (int)Constant.PDAResult.Success;
  3519. }
  3520. else
  3521. {
  3522. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3523. actionResult.Message = "无查询数据";
  3524. }
  3525. }
  3526. catch (Exception ex)
  3527. {
  3528. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3529. OutputLog.TraceLog(LogPriority.Error,
  3530. this.ToString(),
  3531. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3532. ex.ToString(),
  3533. LocalPath.LogExePath);
  3534. actionResult.Status = (int)Constant.PDAResult.Exception;
  3535. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3536. }
  3537. return actionResult;
  3538. }
  3539. /// <summary>
  3540. /// 获取(注浆登记)的查询数据
  3541. /// </summary>
  3542. /// <param name="accountCode"></param>
  3543. /// <param name="userCode"></param>
  3544. /// <param name="userPassword"></param>
  3545. /// <param name="sessionKey"></param>
  3546. /// <param name="se">查询条件</param>
  3547. /// <returns>Dataset</returns>
  3548. public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3549. {
  3550. ActionResult actionResult = new ActionResult();
  3551. try
  3552. {
  3553. // 验证请求头信息
  3554. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3555. // 验证失败
  3556. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3557. {
  3558. return actionResult;
  3559. }
  3560. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3561. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3562. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3563. {
  3564. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3565. actionResult.Status = (int)Constant.PDAResult.Success;
  3566. }
  3567. else
  3568. {
  3569. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3570. actionResult.Message = "无查询数据";
  3571. }
  3572. }
  3573. catch (Exception ex)
  3574. {
  3575. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3576. OutputLog.TraceLog(LogPriority.Error,
  3577. this.ToString(),
  3578. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3579. ex.ToString(),
  3580. LocalPath.LogExePath);
  3581. actionResult.Status = (int)Constant.PDAResult.Exception;
  3582. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3583. }
  3584. return actionResult;
  3585. }
  3586. /// <summary>
  3587. ///获得成型线信息
  3588. /// </summary>
  3589. /// <param name="accountCode"></param>
  3590. /// <param name="userCode"></param>
  3591. /// <param name="userPassword"></param>
  3592. /// <param name="sessionKey"></param>
  3593. /// <param name="se">查询条件</param>
  3594. /// <returns>Dataset</returns>
  3595. public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3596. {
  3597. ActionResult actionResult = new ActionResult();
  3598. try
  3599. {
  3600. // 验证请求头信息
  3601. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3602. // 验证失败
  3603. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3604. {
  3605. return actionResult;
  3606. }
  3607. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3608. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3609. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3610. {
  3611. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3612. actionResult.Status = (int)Constant.PDAResult.Success;
  3613. }
  3614. else
  3615. {
  3616. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3617. actionResult.Message = "无查询数据";
  3618. }
  3619. }
  3620. catch (Exception ex)
  3621. {
  3622. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3623. OutputLog.TraceLog(LogPriority.Error,
  3624. this.ToString(),
  3625. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3626. ex.ToString(),
  3627. LocalPath.LogExePath);
  3628. actionResult.Status = (int)Constant.PDAResult.Exception;
  3629. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3630. }
  3631. return actionResult;
  3632. }
  3633. /// <summary>
  3634. ///获取在产产品的信息标识列表
  3635. /// </summary>
  3636. /// <param name="accountCode"></param>
  3637. /// <param name="userCode"></param>
  3638. /// <param name="userPassword"></param>
  3639. /// <param name="sessionKey"></param>
  3640. /// <param name="barcode">查询条件</param>
  3641. /// <returns>Dataset</returns>
  3642. public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3643. {
  3644. ActionResult actionResult = new ActionResult();
  3645. try
  3646. {
  3647. // 验证请求头信息
  3648. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3649. // 验证失败
  3650. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3651. {
  3652. return actionResult;
  3653. }
  3654. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3655. () => PMModuleLogic.GetInProductionDataList(barcode));
  3656. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3657. {
  3658. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3659. actionResult.Status = (int)Constant.PDAResult.Success;
  3660. }
  3661. else
  3662. {
  3663. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3664. actionResult.Message = "无查询数据";
  3665. }
  3666. }
  3667. catch (Exception ex)
  3668. {
  3669. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3670. OutputLog.TraceLog(LogPriority.Error,
  3671. this.ToString(),
  3672. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3673. ex.ToString(),
  3674. LocalPath.LogExePath);
  3675. actionResult.Status = (int)Constant.PDAResult.Exception;
  3676. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3677. }
  3678. return actionResult;
  3679. }
  3680. /// <summary>
  3681. ///获取条码是否注浆登记过,0行无效
  3682. /// </summary>
  3683. /// <param name="accountCode"></param>
  3684. /// <param name="userCode"></param>
  3685. /// <param name="userPassword"></param>
  3686. /// <param name="sessionKey"></param>
  3687. /// <param name="barcode">查询条件</param>
  3688. /// <returns>Dataset</returns>
  3689. public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3690. {
  3691. ActionResult actionResult = new ActionResult();
  3692. try
  3693. {
  3694. // 验证请求头信息
  3695. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3696. // 验证失败
  3697. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3698. {
  3699. return actionResult;
  3700. }
  3701. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3702. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  3703. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3704. {
  3705. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3706. actionResult.Status = (int)Constant.PDAResult.Success;
  3707. }
  3708. else
  3709. {
  3710. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3711. actionResult.Message = "该产品条码无效,无法报损!";
  3712. }
  3713. }
  3714. catch (Exception ex)
  3715. {
  3716. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3717. OutputLog.TraceLog(LogPriority.Error,
  3718. this.ToString(),
  3719. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3720. ex.ToString(),
  3721. LocalPath.LogExePath);
  3722. actionResult.Status = (int)Constant.PDAResult.Exception;
  3723. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3724. }
  3725. return actionResult;
  3726. }
  3727. /// <summary>
  3728. /// 获取登陆帐户有变更条码权限
  3729. /// </summary>
  3730. /// <param name="accountCode"></param>
  3731. /// <param name="userCode"></param>
  3732. /// <param name="userPassword"></param>
  3733. /// <param name="sessionKey"></param>
  3734. /// <returns></returns>
  3735. public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3736. {
  3737. ActionResult actionResult = new ActionResult();
  3738. try
  3739. {
  3740. // 验证请求头信息
  3741. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3742. // 验证失败
  3743. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3744. {
  3745. return actionResult;
  3746. }
  3747. int returnValue = ServiceInvoker.Invoke<int>(this,
  3748. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  3749. actionResult.Result = JsonHelper.ToJson(returnValue);
  3750. actionResult.Status = (int)Constant.PDAResult.Success;
  3751. }
  3752. catch (Exception ex)
  3753. {
  3754. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3755. OutputLog.TraceLog(LogPriority.Error,
  3756. this.ToString(),
  3757. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3758. ex.ToString(),
  3759. LocalPath.LogExePath);
  3760. actionResult.Status = (int)Constant.PDAResult.Exception;
  3761. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3762. }
  3763. return actionResult;
  3764. }
  3765. /// <summary>
  3766. /// 成检时获取此条码是否报损
  3767. /// </summary>
  3768. /// <param name="accountCode"></param>
  3769. /// <param name="userCode"></param>
  3770. /// <param name="userPassword"></param>
  3771. /// <param name="sessionKey"></param>
  3772. /// <param name="barcode">产品条码</param>
  3773. /// <returns></returns>
  3774. public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3775. {
  3776. ActionResult actionResult = new ActionResult();
  3777. try
  3778. {
  3779. // 验证请求头信息
  3780. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3781. // 验证失败
  3782. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3783. {
  3784. return actionResult;
  3785. }
  3786. int returnValue = ServiceInvoker.Invoke<int>(this,
  3787. () => PMModuleLogic.CheckScrapProduct(barcode));
  3788. if (returnValue == -100)
  3789. {
  3790. actionResult.Result = JsonHelper.ToJson(returnValue);
  3791. actionResult.Status = (int)Constant.PDAResult.Success;
  3792. }
  3793. else
  3794. {
  3795. actionResult.Status = (int)Constant.PDAResult.Fail;
  3796. if (returnValue == 0)
  3797. {
  3798. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  3799. }
  3800. else
  3801. {
  3802. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  3803. }
  3804. }
  3805. }
  3806. catch (Exception ex)
  3807. {
  3808. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3809. OutputLog.TraceLog(LogPriority.Error,
  3810. this.ToString(),
  3811. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3812. ex.ToString(),
  3813. LocalPath.LogExePath);
  3814. actionResult.Status = (int)Constant.PDAResult.Exception;
  3815. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3816. }
  3817. return actionResult;
  3818. }
  3819. /// <summary>
  3820. /// 获取产品完成工序的ID(PDA)
  3821. /// </summary>
  3822. /// <param name="barcode">产品条码</param>
  3823. /// <returns>int</returns>
  3824. public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3825. {
  3826. ActionResult actionResult = new ActionResult();
  3827. try
  3828. {
  3829. // 验证请求头信息
  3830. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3831. // 验证失败
  3832. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3833. {
  3834. return actionResult;
  3835. }
  3836. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3837. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  3838. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3839. actionResult.Status = (int)Constant.PDAResult.Success;
  3840. }
  3841. catch (Exception ex)
  3842. {
  3843. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3844. OutputLog.TraceLog(LogPriority.Error,
  3845. this.ToString(),
  3846. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3847. ex.ToString(),
  3848. LocalPath.LogExePath);
  3849. actionResult.Status = (int)Constant.PDAResult.Exception;
  3850. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3851. }
  3852. return actionResult;
  3853. }
  3854. /// <summary>
  3855. /// 获取产品完成工序的ID(PDA)
  3856. /// </summary>
  3857. /// <param name="barcode">产品条码</param>
  3858. /// <returns>int</returns>
  3859. public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3860. {
  3861. ActionResult actionResult = new ActionResult();
  3862. try
  3863. {
  3864. // 验证请求头信息
  3865. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3866. // 验证失败
  3867. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3868. {
  3869. return actionResult;
  3870. }
  3871. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3872. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  3873. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3874. actionResult.Status = (int)Constant.PDAResult.Success;
  3875. }
  3876. catch (Exception ex)
  3877. {
  3878. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3879. OutputLog.TraceLog(LogPriority.Error,
  3880. this.ToString(),
  3881. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3882. ex.ToString(),
  3883. LocalPath.LogExePath);
  3884. actionResult.Status = (int)Constant.PDAResult.Exception;
  3885. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3886. }
  3887. return actionResult;
  3888. }
  3889. /// <summary>
  3890. /// 成检-校验生产工号
  3891. /// </summary>
  3892. /// <param name="usercode">生产工号</param>
  3893. /// <returns>int</returns>
  3894. public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode)
  3895. {
  3896. ActionResult actionResult = new ActionResult();
  3897. try
  3898. {
  3899. // 验证请求头信息
  3900. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3901. // 验证失败
  3902. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3903. {
  3904. return actionResult;
  3905. }
  3906. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3907. () => PDAModuleLogic.GetUserCode(usercode, sUserInfo));
  3908. actionResult.Result = JsonHelper.ToJson(ds);
  3909. actionResult.Status = (int)Constant.PDAResult.Success;
  3910. }
  3911. catch (Exception ex)
  3912. {
  3913. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3914. OutputLog.TraceLog(LogPriority.Error,
  3915. this.ToString(),
  3916. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3917. ex.ToString(),
  3918. LocalPath.LogExePath);
  3919. actionResult.Status = (int)Constant.PDAResult.Exception;
  3920. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3921. }
  3922. return actionResult;
  3923. }
  3924. /// <summary>
  3925. /// 更新漏扫的成型工号
  3926. /// </summary>
  3927. /// <param name="accountCode"></param>
  3928. /// <param name="userCode"></param>
  3929. /// <param name="userPassword"></param>
  3930. /// <param name="sessionKey"></param>
  3931. /// <param name="groutingUserCode">成型工号</param>
  3932. /// <param name="missingID">漏扫ID</param>
  3933. /// <returns></returns>
  3934. public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  3935. {
  3936. ActionResult actionResult = new ActionResult();
  3937. try
  3938. {
  3939. // 验证请求头信息
  3940. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3941. // 验证失败
  3942. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3943. {
  3944. return actionResult;
  3945. }
  3946. int returnValue = ServiceInvoker.Invoke<int>(this,
  3947. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  3948. if (returnValue != -1)
  3949. {
  3950. actionResult.Result = JsonHelper.ToJson(returnValue);
  3951. actionResult.Status = (int)Constant.PDAResult.Success;
  3952. }
  3953. else
  3954. {
  3955. actionResult.Status = (int)Constant.PDAResult.Fail;
  3956. actionResult.Message = "存在无效的漏扫工号";
  3957. }
  3958. }
  3959. catch (Exception ex)
  3960. {
  3961. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3962. OutputLog.TraceLog(LogPriority.Error,
  3963. this.ToString(),
  3964. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3965. ex.ToString(),
  3966. LocalPath.LogExePath);
  3967. actionResult.Status = (int)Constant.PDAResult.Exception;
  3968. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3969. }
  3970. return actionResult;
  3971. }
  3972. /// <summary>
  3973. /// 在入窑工序检验窑车号是否存在
  3974. /// </summary>
  3975. /// <param name="accountCode"></param>
  3976. /// <param name="userCode"></param>
  3977. /// <param name="userPassword"></param>
  3978. /// <param name="sessionKey"></param>
  3979. /// <param name="kilncarcode">窑车编码</param>
  3980. /// <param name="procedureid">工序ID</param>
  3981. /// <returns></returns>
  3982. public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  3983. {
  3984. ActionResult actionResult = new ActionResult();
  3985. try
  3986. {
  3987. // 验证请求头信息
  3988. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3989. // 验证失败
  3990. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3991. {
  3992. return actionResult;
  3993. }
  3994. int returnValue = ServiceInvoker.Invoke<int>(this,
  3995. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  3996. if (returnValue == 1)
  3997. {
  3998. actionResult.Result = JsonHelper.ToJson(returnValue);
  3999. actionResult.Status = (int)Constant.PDAResult.Success;
  4000. }
  4001. else
  4002. {
  4003. actionResult.Status = (int)Constant.PDAResult.Fail;
  4004. if (returnValue == -99)
  4005. actionResult.Message = "窑炉车号无效";
  4006. else if (returnValue == -98)
  4007. actionResult.Message = "窑车己无产品";
  4008. else if (returnValue == -97)
  4009. actionResult.Message = "窑车没有入窑,不可以撤销";
  4010. else if (returnValue == -1)
  4011. actionResult.Message = "保存失败";
  4012. }
  4013. }
  4014. catch (Exception ex)
  4015. {
  4016. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4017. OutputLog.TraceLog(LogPriority.Error,
  4018. this.ToString(),
  4019. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4020. ex.ToString(),
  4021. LocalPath.LogExePath);
  4022. actionResult.Status = (int)Constant.PDAResult.Exception;
  4023. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4024. }
  4025. return actionResult;
  4026. }
  4027. /// <summary>
  4028. /// 获取盘点单列表
  4029. /// </summary>
  4030. /// <param name="sUserInfo"></param>
  4031. /// <returns></returns>
  4032. public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey)
  4033. {
  4034. ActionResult actionResult = new ActionResult();
  4035. try
  4036. {
  4037. // 验证请求头信息
  4038. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4039. // 验证失败
  4040. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4041. {
  4042. return actionResult;
  4043. }
  4044. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4045. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  4046. actionResult.Result = JsonHelper.ToJson(ds);
  4047. actionResult.Status = (int)Constant.PDAResult.Success;
  4048. }
  4049. catch (Exception ex)
  4050. {
  4051. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4052. OutputLog.TraceLog(LogPriority.Error,
  4053. this.ToString(),
  4054. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4055. ex.ToString(),
  4056. LocalPath.LogExePath);
  4057. actionResult.Status = (int)Constant.PDAResult.Exception;
  4058. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4059. }
  4060. return actionResult;
  4061. }
  4062. /// <summary>
  4063. /// 进行盘点操作
  4064. /// </summary>
  4065. /// <param name="accountCode"></param>
  4066. /// <param name="userCode"></param>
  4067. /// <param name="userPassword"></param>
  4068. /// <param name="sessionKey"></param>
  4069. /// <param name="InCheckedID">盘点单ID</param>
  4070. /// <param name="BarCode">产品条码</param>
  4071. /// <returns></returns>
  4072. public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4073. {
  4074. ActionResult actionResult = new ActionResult();
  4075. try
  4076. {
  4077. // 验证请求头信息
  4078. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4079. // 验证失败
  4080. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4081. {
  4082. return actionResult;
  4083. }
  4084. int returnValue = ServiceInvoker.Invoke<int>(this,
  4085. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4086. if (returnValue > 0)
  4087. {
  4088. actionResult.Result = JsonHelper.ToJson(returnValue);
  4089. actionResult.Status = (int)Constant.PDAResult.Success;
  4090. actionResult.Message = "产品" + BarCode + "盘点成功";
  4091. }
  4092. else if (returnValue == 10)
  4093. {
  4094. actionResult.Result = JsonHelper.ToJson(returnValue);
  4095. actionResult.Status = (int)Constant.PDAResult.Success;
  4096. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4097. }
  4098. else
  4099. {
  4100. actionResult.Status = (int)Constant.PDAResult.Fail;
  4101. if (returnValue == -2)
  4102. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4103. //if (returnValue == 10)
  4104. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4105. //if (returnValue > 0)
  4106. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4107. if (returnValue == -22)
  4108. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4109. if (returnValue == -23)
  4110. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4111. if (returnValue == -24)
  4112. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4113. if (returnValue == -25)
  4114. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4115. else if (returnValue == 0)
  4116. actionResult.Message = "盘点失败";
  4117. }
  4118. }
  4119. catch (Exception ex)
  4120. {
  4121. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4122. OutputLog.TraceLog(LogPriority.Error,
  4123. this.ToString(),
  4124. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4125. ex.ToString(),
  4126. LocalPath.LogExePath);
  4127. actionResult.Status = (int)Constant.PDAResult.Exception;
  4128. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4129. }
  4130. return actionResult;
  4131. }
  4132. #region 班次配置
  4133. /// <summary>
  4134. /// 班次配置-通过工号获取工种列表
  4135. /// </summary>
  4136. /// <param name="userId">工号ID</param>
  4137. /// <returns></returns>
  4138. public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4139. {
  4140. ActionResult actionResult = new ActionResult();
  4141. try
  4142. {
  4143. // 验证请求头信息
  4144. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4145. // 验证失败
  4146. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4147. {
  4148. return actionResult;
  4149. }
  4150. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4151. () => SystemModuleLogic.GetJobByUserId(userId));
  4152. actionResult.Result = JsonHelper.ToJson(ds);
  4153. actionResult.Status = (int)Constant.PDAResult.Success;
  4154. }
  4155. catch (Exception ex)
  4156. {
  4157. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4158. OutputLog.TraceLog(LogPriority.Error,
  4159. this.ToString(),
  4160. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4161. ex.ToString(),
  4162. LocalPath.LogExePath);
  4163. actionResult.Status = (int)Constant.PDAResult.Exception;
  4164. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4165. }
  4166. return actionResult;
  4167. }
  4168. ///// <summary>
  4169. ///// 班次配置-根据工号查询员工档案信息
  4170. ///// </summary>
  4171. ///// <param name="userId">工号ID</param>
  4172. ///// <returns></returns>
  4173. //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4174. //{
  4175. // ActionResult actionResult = new ActionResult();
  4176. // try
  4177. // {
  4178. // // 验证请求头信息
  4179. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4180. // // 验证失败
  4181. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4182. // {
  4183. // return actionResult;
  4184. // }
  4185. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4186. // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
  4187. // actionResult.Result = JsonHelper.ToJson(ds);
  4188. // actionResult.Status = (int)Constant.PDAResult.Success;
  4189. // }
  4190. // catch (Exception ex)
  4191. // {
  4192. // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4193. // OutputLog.TraceLog(LogPriority.Error,
  4194. // this.ToString(),
  4195. // System.Reflection.MethodBase.GetCurrentMethod().Name,
  4196. // ex.ToString(),
  4197. // LocalPath.LogExePath);
  4198. // actionResult.Status = (int)Constant.PDAResult.Exception;
  4199. // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4200. // }
  4201. // return actionResult;
  4202. //}
  4203. /// <summary>
  4204. /// 班次配置-根据员工姓名查员工信息
  4205. /// </summary>
  4206. /// <param name="searchStaffEntity"></param>
  4207. /// <returns></returns>
  4208. public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4209. {
  4210. ActionResult actionResult = new ActionResult();
  4211. try
  4212. {
  4213. // 验证请求头信息
  4214. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4215. // 验证失败
  4216. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4217. {
  4218. return actionResult;
  4219. }
  4220. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4221. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4222. actionResult.Result = JsonHelper.ToJson(ds);
  4223. actionResult.Status = (int)Constant.PDAResult.Success;
  4224. }
  4225. catch (Exception ex)
  4226. {
  4227. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4228. OutputLog.TraceLog(LogPriority.Error,
  4229. this.ToString(),
  4230. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4231. ex.ToString(),
  4232. LocalPath.LogExePath);
  4233. actionResult.Status = (int)Constant.PDAResult.Exception;
  4234. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4235. }
  4236. return actionResult;
  4237. }
  4238. /// <summary>
  4239. /// 获取班次配置信息
  4240. /// </summary>
  4241. /// <param name="searchEntity"></param>
  4242. /// <returns></returns>
  4243. public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  4244. {
  4245. ActionResult actionResult = new ActionResult();
  4246. try
  4247. {
  4248. // 验证请求头信息
  4249. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4250. // 验证失败
  4251. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4252. {
  4253. return actionResult;
  4254. }
  4255. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4256. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4257. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4258. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4259. actionResult.Result = JsonHelper.ToJson(ds);
  4260. actionResult.Status = (int)Constant.PDAResult.Success;
  4261. }
  4262. catch (Exception ex)
  4263. {
  4264. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4265. OutputLog.TraceLog(LogPriority.Error,
  4266. this.ToString(),
  4267. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4268. ex.ToString(),
  4269. LocalPath.LogExePath);
  4270. actionResult.Status = (int)Constant.PDAResult.Exception;
  4271. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4272. }
  4273. return actionResult;
  4274. }
  4275. public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4276. {
  4277. ActionResult actionResult = new ActionResult();
  4278. try
  4279. {
  4280. // 验证请求头信息
  4281. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4282. // 验证失败
  4283. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4284. {
  4285. return actionResult;
  4286. }
  4287. int returnValue = ServiceInvoker.Invoke<int>(this,
  4288. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4289. if (returnValue > 0)
  4290. {
  4291. actionResult.Result = JsonHelper.ToJson(returnValue);
  4292. actionResult.Status = (int)Constant.PDAResult.Success;
  4293. }
  4294. else
  4295. {
  4296. actionResult.Status = (int)Constant.PDAResult.Fail;
  4297. actionResult.Message = "保存失败";
  4298. }
  4299. }
  4300. catch (Exception ex)
  4301. {
  4302. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4303. OutputLog.TraceLog(LogPriority.Error,
  4304. this.ToString(),
  4305. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4306. ex.ToString(),
  4307. LocalPath.LogExePath);
  4308. actionResult.Status = (int)Constant.PDAResult.Exception;
  4309. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4310. }
  4311. return actionResult;
  4312. }
  4313. /// <summary>
  4314. /// 班次配置--获取详细信息
  4315. /// </summary>
  4316. /// <param name="searchEntity"></param>
  4317. /// <returns></returns>
  4318. public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4319. {
  4320. ActionResult actionResult = new ActionResult();
  4321. try
  4322. {
  4323. // 验证请求头信息
  4324. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4325. // 验证失败
  4326. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4327. {
  4328. return actionResult;
  4329. }
  4330. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4331. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4332. actionResult.Result = JsonHelper.ToJson(ds);
  4333. actionResult.Status = (int)Constant.PDAResult.Success;
  4334. }
  4335. catch (Exception ex)
  4336. {
  4337. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4338. OutputLog.TraceLog(LogPriority.Error,
  4339. this.ToString(),
  4340. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4341. ex.ToString(),
  4342. LocalPath.LogExePath);
  4343. actionResult.Status = (int)Constant.PDAResult.Exception;
  4344. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4345. }
  4346. return actionResult;
  4347. }
  4348. /// <summary>
  4349. /// 获取用户是否有班次配置权限
  4350. /// </summary>
  4351. /// <param name="accountCode"></param>
  4352. /// <param name="userCode"></param>
  4353. /// <param name="userPassword"></param>
  4354. /// <param name="sessionKey"></param>
  4355. /// <returns></returns>
  4356. public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4357. {
  4358. ActionResult actionResult = new ActionResult();
  4359. try
  4360. {
  4361. // 验证请求头信息
  4362. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4363. // 验证失败
  4364. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4365. {
  4366. return actionResult;
  4367. }
  4368. int returnValue = ServiceInvoker.Invoke<int>(this,
  4369. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4370. actionResult.Result = JsonHelper.ToJson(returnValue);
  4371. actionResult.Status = (int)Constant.PDAResult.Success;
  4372. }
  4373. catch (Exception ex)
  4374. {
  4375. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4376. OutputLog.TraceLog(LogPriority.Error,
  4377. this.ToString(),
  4378. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4379. ex.ToString(),
  4380. LocalPath.LogExePath);
  4381. actionResult.Status = (int)Constant.PDAResult.Exception;
  4382. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4383. }
  4384. return actionResult;
  4385. }
  4386. /// <summary>
  4387. /// 获取盘点单列表
  4388. /// </summary>
  4389. /// <param name="sUserInfo"></param>
  4390. /// <returns></returns>
  4391. public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  4392. {
  4393. ActionResult actionResult = new ActionResult();
  4394. try
  4395. {
  4396. // 验证请求头信息
  4397. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4398. // 验证失败
  4399. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4400. {
  4401. return actionResult;
  4402. }
  4403. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4404. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4405. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4406. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4407. actionResult.Result = JsonHelper.ToJson(ds);
  4408. actionResult.Status = (int)Constant.PDAResult.Success;
  4409. }
  4410. catch (Exception ex)
  4411. {
  4412. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4413. OutputLog.TraceLog(LogPriority.Error,
  4414. this.ToString(),
  4415. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4416. ex.ToString(),
  4417. LocalPath.LogExePath);
  4418. actionResult.Status = (int)Constant.PDAResult.Exception;
  4419. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4420. }
  4421. return actionResult;
  4422. }
  4423. #endregion
  4424. #region PDA报表
  4425. /// <summary>
  4426. /// 产品质量跟踪
  4427. /// </summary>
  4428. /// <param name="accountCode"></param>
  4429. /// <param name="userCode"></param>
  4430. /// <param name="userPassword"></param>
  4431. /// <param name="sessionKey"></param>
  4432. /// <param name="se"></param>
  4433. /// <returns></returns>
  4434. public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4435. {
  4436. ActionResult actionResult = new ActionResult();
  4437. try
  4438. {
  4439. // 验证请求头信息
  4440. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4441. // 验证失败
  4442. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4443. {
  4444. return actionResult;
  4445. }
  4446. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4447. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4448. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4449. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4450. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4451. {
  4452. actionResult.Status = (int)Constant.PDAResult.Fail;
  4453. actionResult.Message = Messages.MSG_CMN_I002;
  4454. }
  4455. else
  4456. {
  4457. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4458. actionResult.Status = (int)Constant.PDAResult.Success;
  4459. }
  4460. }
  4461. catch (Exception ex)
  4462. {
  4463. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4464. OutputLog.TraceLog(LogPriority.Error,
  4465. this.ToString(),
  4466. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4467. ex.ToString(),
  4468. LocalPath.LogExePath);
  4469. actionResult.Status = (int)Constant.PDAResult.Exception;
  4470. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4471. }
  4472. return actionResult;
  4473. }
  4474. /// <summary>
  4475. /// 工号产量质量分析表
  4476. /// </summary>
  4477. /// <param name="accountCode"></param>
  4478. /// <param name="userCode"></param>
  4479. /// <param name="userPassword"></param>
  4480. /// <param name="sessionKey"></param>
  4481. /// <param name="se"></param>
  4482. /// <returns></returns>
  4483. public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4484. int rptSProcedureID, string workcode, string date)
  4485. {
  4486. ActionResult actionResult = new ActionResult();
  4487. try
  4488. {
  4489. // 验证请求头信息
  4490. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4491. // 验证失败
  4492. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4493. {
  4494. return actionResult;
  4495. }
  4496. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4497. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4498. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4499. {
  4500. actionResult.Status = (int)Constant.PDAResult.Fail;
  4501. actionResult.Message = Messages.MSG_CMN_I002;
  4502. }
  4503. else
  4504. {
  4505. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4506. actionResult.Status = (int)Constant.PDAResult.Success;
  4507. }
  4508. }
  4509. catch (Exception ex)
  4510. {
  4511. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4512. OutputLog.TraceLog(LogPriority.Error,
  4513. this.ToString(),
  4514. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4515. ex.ToString(),
  4516. LocalPath.LogExePath);
  4517. actionResult.Status = (int)Constant.PDAResult.Exception;
  4518. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4519. }
  4520. return actionResult;
  4521. }
  4522. /// <summary>
  4523. /// 半检数据统计表
  4524. /// </summary>
  4525. /// <param name="accountCode"></param>
  4526. /// <param name="userCode"></param>
  4527. /// <param name="userPassword"></param>
  4528. /// <param name="sessionKey"></param>
  4529. /// <param name="se"></param>
  4530. /// <returns></returns>
  4531. public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4532. string workcode, string datebegin, string dateend)
  4533. {
  4534. ActionResult actionResult = new ActionResult();
  4535. try
  4536. {
  4537. // 验证请求头信息
  4538. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4539. // 验证失败
  4540. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4541. {
  4542. return actionResult;
  4543. }
  4544. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4545. DateTime datetimeend = Convert.ToDateTime(dateend);
  4546. datetimebegin = datetimebegin.Date;
  4547. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4548. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4549. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4550. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4551. {
  4552. actionResult.Status = (int)Constant.PDAResult.Fail;
  4553. actionResult.Message = Messages.MSG_CMN_I002;
  4554. }
  4555. else
  4556. {
  4557. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4558. actionResult.Status = (int)Constant.PDAResult.Success;
  4559. }
  4560. }
  4561. catch (Exception ex)
  4562. {
  4563. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4564. OutputLog.TraceLog(LogPriority.Error,
  4565. this.ToString(),
  4566. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4567. ex.ToString(),
  4568. LocalPath.LogExePath);
  4569. actionResult.Status = (int)Constant.PDAResult.Exception;
  4570. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4571. }
  4572. return actionResult;
  4573. }
  4574. /// <summary>
  4575. /// 工号质量统计表
  4576. /// </summary>
  4577. /// <param name="accountCode"></param>
  4578. /// <param name="userCode"></param>
  4579. /// <param name="userPassword"></param>
  4580. /// <param name="sessionKey"></param>
  4581. /// <param name="se"></param>
  4582. /// <returns></returns>
  4583. public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4584. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4585. {
  4586. ActionResult actionResult = new ActionResult();
  4587. try
  4588. {
  4589. // 验证请求头信息
  4590. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4591. // 验证失败
  4592. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4593. {
  4594. return actionResult;
  4595. }
  4596. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4597. DateTime datetimeend = Convert.ToDateTime(dateend);
  4598. datetimebegin = datetimebegin.Date;
  4599. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4600. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4601. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4602. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4603. {
  4604. actionResult.Status = (int)Constant.PDAResult.Fail;
  4605. actionResult.Message = Messages.MSG_CMN_I002;
  4606. }
  4607. else
  4608. {
  4609. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4610. actionResult.Status = (int)Constant.PDAResult.Success;
  4611. }
  4612. }
  4613. catch (Exception ex)
  4614. {
  4615. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4616. OutputLog.TraceLog(LogPriority.Error,
  4617. this.ToString(),
  4618. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4619. ex.ToString(),
  4620. LocalPath.LogExePath);
  4621. actionResult.Status = (int)Constant.PDAResult.Exception;
  4622. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4623. }
  4624. return actionResult;
  4625. }
  4626. /// <summary>
  4627. /// 损坯数据统计表
  4628. /// </summary>
  4629. /// <param name="accountCode"></param>
  4630. /// <param name="userCode"></param>
  4631. /// <param name="userPassword"></param>
  4632. /// <param name="sessionKey"></param>
  4633. /// <param name="se"></param>
  4634. /// <returns></returns>
  4635. public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4636. string workcode, string datebegin, string dateend)
  4637. {
  4638. ActionResult actionResult = new ActionResult();
  4639. try
  4640. {
  4641. // 验证请求头信息
  4642. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4643. // 验证失败
  4644. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4645. {
  4646. return actionResult;
  4647. }
  4648. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4649. DateTime datetimeend = Convert.ToDateTime(dateend);
  4650. datetimebegin = datetimebegin.Date;
  4651. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4652. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4653. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4654. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4655. {
  4656. actionResult.Status = (int)Constant.PDAResult.Fail;
  4657. actionResult.Message = Messages.MSG_CMN_I002;
  4658. }
  4659. else
  4660. {
  4661. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4662. actionResult.Status = (int)Constant.PDAResult.Success;
  4663. }
  4664. }
  4665. catch (Exception ex)
  4666. {
  4667. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4668. OutputLog.TraceLog(LogPriority.Error,
  4669. this.ToString(),
  4670. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4671. ex.ToString(),
  4672. LocalPath.LogExePath);
  4673. actionResult.Status = (int)Constant.PDAResult.Exception;
  4674. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4675. }
  4676. return actionResult;
  4677. }
  4678. #endregion
  4679. /// <summary>
  4680. /// 取得报表数据源数据
  4681. /// </summary>
  4682. /// <param name="accountCode"></param>
  4683. /// <param name="userCode"></param>
  4684. /// <param name="userPassword"></param>
  4685. /// <param name="sessionKey"></param>
  4686. /// <returns></returns>
  4687. public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
  4688. {
  4689. ActionResult actionResult = new ActionResult();
  4690. try
  4691. {
  4692. // 验证请求头信息
  4693. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4694. // 验证失败
  4695. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4696. {
  4697. return actionResult;
  4698. }
  4699. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4700. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4701. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4702. {
  4703. actionResult.Status = (int)Constant.PDAResult.Fail;
  4704. actionResult.Message = Messages.MSG_CMN_I002;
  4705. }
  4706. else
  4707. {
  4708. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4709. actionResult.Status = (int)Constant.PDAResult.Success;
  4710. }
  4711. }
  4712. catch (Exception ex)
  4713. {
  4714. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4715. OutputLog.TraceLog(LogPriority.Error,
  4716. this.ToString(),
  4717. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4718. ex.ToString(),
  4719. LocalPath.LogExePath);
  4720. actionResult.Status = (int)Constant.PDAResult.Exception;
  4721. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4722. }
  4723. return actionResult;
  4724. }
  4725. /// <summary>
  4726. /// 取得报表的查询数据源统计工序数据
  4727. /// </summary>
  4728. /// <param name="accountCode"></param>
  4729. /// <param name="userCode"></param>
  4730. /// <param name="userPassword"></param>
  4731. /// <param name="sessionKey"></param>
  4732. /// <param name="RptProcedureID"></param>
  4733. /// <returns></returns>
  4734. public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  4735. {
  4736. ActionResult actionResult = new ActionResult();
  4737. try
  4738. {
  4739. // 验证请求头信息
  4740. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4741. // 验证失败
  4742. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4743. {
  4744. return actionResult;
  4745. }
  4746. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4747. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  4748. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4749. {
  4750. actionResult.Status = (int)Constant.PDAResult.Fail;
  4751. actionResult.Message = Messages.MSG_CMN_I002;
  4752. }
  4753. else
  4754. {
  4755. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4756. actionResult.Status = (int)Constant.PDAResult.Success;
  4757. }
  4758. }
  4759. catch (Exception ex)
  4760. {
  4761. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4762. OutputLog.TraceLog(LogPriority.Error,
  4763. this.ToString(),
  4764. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4765. ex.ToString(),
  4766. LocalPath.LogExePath);
  4767. actionResult.Status = (int)Constant.PDAResult.Exception;
  4768. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4769. }
  4770. return actionResult;
  4771. }
  4772. /// <summary>
  4773. /// 获取用户是否有统计产成品权限
  4774. /// </summary>
  4775. /// <param name="accountCode"></param>
  4776. /// <param name="userCode"></param>
  4777. /// <param name="userPassword"></param>
  4778. /// <param name="sessionKey"></param>
  4779. /// <returns></returns>
  4780. public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4781. {
  4782. ActionResult actionResult = new ActionResult();
  4783. try
  4784. {
  4785. // 验证请求头信息
  4786. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4787. // 验证失败
  4788. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4789. {
  4790. return actionResult;
  4791. }
  4792. int returnValue = ServiceInvoker.Invoke<int>(this,
  4793. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  4794. actionResult.Result = JsonHelper.ToJson(returnValue);
  4795. actionResult.Status = (int)Constant.PDAResult.Success;
  4796. }
  4797. catch (Exception ex)
  4798. {
  4799. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4800. OutputLog.TraceLog(LogPriority.Error,
  4801. this.ToString(),
  4802. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4803. ex.ToString(),
  4804. LocalPath.LogExePath);
  4805. actionResult.Status = (int)Constant.PDAResult.Exception;
  4806. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4807. }
  4808. return actionResult;
  4809. }
  4810. /// <summary>
  4811. /// 获取用户是否有盘点权限
  4812. /// </summary>
  4813. /// <param name="accountCode"></param>
  4814. /// <param name="userCode"></param>
  4815. /// <param name="userPassword"></param>
  4816. /// <param name="sessionKey"></param>
  4817. /// <returns></returns>
  4818. public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4819. {
  4820. ActionResult actionResult = new ActionResult();
  4821. try
  4822. {
  4823. // 验证请求头信息
  4824. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4825. // 验证失败
  4826. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4827. {
  4828. return actionResult;
  4829. }
  4830. int returnValue = ServiceInvoker.Invoke<int>(this,
  4831. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  4832. actionResult.Result = JsonHelper.ToJson(returnValue);
  4833. actionResult.Status = (int)Constant.PDAResult.Success;
  4834. }
  4835. catch (Exception ex)
  4836. {
  4837. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4838. OutputLog.TraceLog(LogPriority.Error,
  4839. this.ToString(),
  4840. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4841. ex.ToString(),
  4842. LocalPath.LogExePath);
  4843. actionResult.Status = (int)Constant.PDAResult.Exception;
  4844. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4845. }
  4846. return actionResult;
  4847. }
  4848. /// <summary>
  4849. /// 根据条件查询是否存在班次配置
  4850. /// </summary>
  4851. /// <param name="accountCode"></param>
  4852. /// <param name="userCode"></param>
  4853. /// <param name="userPassword"></param>
  4854. /// <param name="sessionKey"></param>
  4855. /// <param name="userCode">工号编码</param>
  4856. /// <returns></returns>
  4857. public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  4858. {
  4859. ActionResult actionResult = new ActionResult();
  4860. try
  4861. {
  4862. // 验证请求头信息
  4863. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4864. // 验证失败
  4865. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4866. {
  4867. return actionResult;
  4868. }
  4869. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4870. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  4871. actionResult.Result = JsonHelper.ToJson(ds);
  4872. actionResult.Status = (int)Constant.PDAResult.Success;
  4873. }
  4874. catch (Exception ex)
  4875. {
  4876. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4877. OutputLog.TraceLog(LogPriority.Error,
  4878. this.ToString(),
  4879. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4880. ex.ToString(),
  4881. LocalPath.LogExePath);
  4882. actionResult.Status = (int)Constant.PDAResult.Exception;
  4883. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4884. }
  4885. return actionResult;
  4886. }
  4887. /// <summary>
  4888. /// 报损工序查出工号根据生产数据ID
  4889. /// </summary>
  4890. /// <param name="accountCode"></param>
  4891. /// <param name="userCode"></param>
  4892. /// <param name="userPassword"></param>
  4893. /// <param name="sessionKey"></param>
  4894. /// <param name="ProductionDataID">生产数据ID</param>
  4895. /// <returns></returns>
  4896. public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  4897. {
  4898. ActionResult actionResult = new ActionResult();
  4899. try
  4900. {
  4901. // 验证请求头信息
  4902. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4903. // 验证失败
  4904. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4905. {
  4906. return actionResult;
  4907. }
  4908. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  4909. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  4910. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  4911. {
  4912. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  4913. actionResult.Status = (int)Constant.PDAResult.Success;
  4914. }
  4915. else
  4916. {
  4917. actionResult.Status = (int)Constant.PDAResult.Fail;
  4918. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  4919. }
  4920. }
  4921. catch (Exception ex)
  4922. {
  4923. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4924. OutputLog.TraceLog(LogPriority.Error,
  4925. this.ToString(),
  4926. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4927. ex.ToString(),
  4928. LocalPath.LogExePath);
  4929. actionResult.Status = (int)Constant.PDAResult.Exception;
  4930. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4931. }
  4932. return actionResult;
  4933. }
  4934. /// <summary>
  4935. /// 在入窑工序检验窑车号是否存在
  4936. /// </summary>
  4937. /// <param name="accountCode"></param>
  4938. /// <param name="userCode"></param>
  4939. /// <param name="userPassword"></param>
  4940. /// <param name="sessionKey"></param>
  4941. /// <param name="kilncarcode">窑车编码</param>
  4942. /// <param name="procedureid">工序ID</param>
  4943. /// <returns></returns>
  4944. public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4945. {
  4946. ActionResult actionResult = new ActionResult();
  4947. try
  4948. {
  4949. // 验证请求头信息
  4950. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4951. // 验证失败
  4952. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4953. {
  4954. return actionResult;
  4955. }
  4956. int returnValue = ServiceInvoker.Invoke<int>(this,
  4957. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  4958. if (returnValue == 1)
  4959. {
  4960. actionResult.Result = JsonHelper.ToJson(returnValue);
  4961. actionResult.Status = (int)Constant.PDAResult.Success;
  4962. }
  4963. else
  4964. {
  4965. actionResult.Status = (int)Constant.PDAResult.Fail;
  4966. if (returnValue == -99)
  4967. actionResult.Message = "窑炉车号无效";
  4968. else if (returnValue == -98)
  4969. actionResult.Message = "窑车己无产品";
  4970. else if (returnValue == -97)
  4971. actionResult.Message = "窑车没有入窑,不可以撤销";
  4972. else if (returnValue == -1)
  4973. actionResult.Message = "保存失败";
  4974. }
  4975. }
  4976. catch (Exception ex)
  4977. {
  4978. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4979. OutputLog.TraceLog(LogPriority.Error,
  4980. this.ToString(),
  4981. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4982. ex.ToString(),
  4983. LocalPath.LogExePath);
  4984. actionResult.Status = (int)Constant.PDAResult.Exception;
  4985. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4986. }
  4987. return actionResult;
  4988. }
  4989. /// <summary>
  4990. /// 撤销包装
  4991. /// </summary>
  4992. /// <param name="accountCode"></param>
  4993. /// <param name="userCode"></param>
  4994. /// <param name="userPassword"></param>
  4995. /// <param name="sessionKey"></param>
  4996. /// <param name="barcode"></param>
  4997. /// <returns></returns>
  4998. public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  4999. {
  5000. ActionResult actionResult = new ActionResult();
  5001. try
  5002. {
  5003. // 验证请求头信息
  5004. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5005. // 验证失败
  5006. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5007. {
  5008. return actionResult;
  5009. }
  5010. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5011. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  5012. if (Convert.ToInt32(returnValue.Result) > 0)
  5013. {
  5014. actionResult.Result = JsonHelper.ToJson(returnValue);
  5015. actionResult.Status = (int)Constant.PDAResult.Success;
  5016. }
  5017. else
  5018. {
  5019. actionResult.Status = (int)Constant.PDAResult.Fail;
  5020. if (Convert.ToInt32(returnValue.Result) == -1)
  5021. actionResult.Message = "产品条码不存在包装记录";
  5022. else if (Convert.ToInt32(returnValue.Result) == -200)
  5023. actionResult.Message = returnValue.Message;
  5024. else
  5025. actionResult.Message = "成品撤销失败";
  5026. }
  5027. }
  5028. catch (Exception ex)
  5029. {
  5030. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5031. OutputLog.TraceLog(LogPriority.Error,
  5032. this.ToString(),
  5033. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5034. ex.ToString(),
  5035. LocalPath.LogExePath);
  5036. actionResult.Status = (int)Constant.PDAResult.Exception;
  5037. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5038. }
  5039. return actionResult;
  5040. }
  5041. /*
  5042. /// <summary>
  5043. /// 获取用户是否有撤销包装权限
  5044. /// </summary>
  5045. /// <param name="accountCode"></param>
  5046. /// <param name="userCode"></param>
  5047. /// <param name="userPassword"></param>
  5048. /// <param name="sessionKey"></param>
  5049. /// <returns></returns>
  5050. public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5051. {
  5052. ActionResult actionResult = new ActionResult();
  5053. try
  5054. {
  5055. // 验证请求头信息
  5056. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5057. // 验证失败
  5058. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5059. {
  5060. return actionResult;
  5061. }
  5062. int returnValue = ServiceInvoker.Invoke<int>(this,
  5063. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5064. actionResult.Result = JsonHelper.ToJson(returnValue);
  5065. actionResult.Status = (int)Constant.PDAResult.Success;
  5066. }
  5067. catch (Exception ex)
  5068. {
  5069. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5070. OutputLog.TraceLog(LogPriority.Error,
  5071. this.ToString(),
  5072. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5073. ex.ToString(),
  5074. LocalPath.LogExePath);
  5075. actionResult.Status = (int)Constant.PDAResult.Exception;
  5076. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5077. }
  5078. return actionResult;
  5079. }
  5080. */
  5081. /// <summary>
  5082. /// 窑车状态明细表查询
  5083. /// </summary>
  5084. /// <param name="accountCode"></param>
  5085. /// <param name="userCode"></param>
  5086. /// <param name="userPassword"></param>
  5087. /// <param name="sessionKey"></param>
  5088. /// <param name="kilnCarCode"></param>
  5089. /// <returns></returns>
  5090. public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5091. {
  5092. ActionResult actionResult = new ActionResult();
  5093. try
  5094. {
  5095. // 验证请求头信息
  5096. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5097. // 验证失败
  5098. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5099. {
  5100. return actionResult;
  5101. }
  5102. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5103. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5104. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5105. {
  5106. actionResult.Status = (int)Constant.PDAResult.Fail;
  5107. actionResult.Message = Messages.MSG_CMN_I002;
  5108. }
  5109. else
  5110. {
  5111. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5112. actionResult.Status = (int)Constant.PDAResult.Success;
  5113. }
  5114. }
  5115. catch (Exception ex)
  5116. {
  5117. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5118. OutputLog.TraceLog(LogPriority.Error,
  5119. this.ToString(),
  5120. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5121. ex.ToString(),
  5122. LocalPath.LogExePath);
  5123. actionResult.Status = (int)Constant.PDAResult.Exception;
  5124. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5125. }
  5126. return actionResult;
  5127. }
  5128. /// <summary>
  5129. /// 损坯撤销
  5130. /// </summary>
  5131. /// <param name="accountCode"></param>
  5132. /// <param name="userCode"></param>
  5133. /// <param name="userPassword"></param>
  5134. /// <param name="sessionKey"></param>
  5135. /// <param name="barcode"></param>
  5136. /// <returns></returns>
  5137. public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5138. {
  5139. ActionResult actionResult = new ActionResult();
  5140. try
  5141. {
  5142. // 验证请求头信息
  5143. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5144. // 验证失败
  5145. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5146. {
  5147. return actionResult;
  5148. }
  5149. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5150. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5151. if (Convert.ToInt32(returnValue.Result) > 0)
  5152. {
  5153. actionResult.Result = JsonHelper.ToJson(returnValue);
  5154. actionResult.Status = (int)Constant.PDAResult.Success;
  5155. }
  5156. else
  5157. {
  5158. actionResult.Status = (int)Constant.PDAResult.Fail;
  5159. if (Convert.ToInt32(returnValue.Result) == -1)
  5160. actionResult.Message = "此产品没有损坯,不能撤销";
  5161. else if (Convert.ToInt32(returnValue.Result) == -200)
  5162. actionResult.Message = returnValue.Message;
  5163. else
  5164. actionResult.Message = "损坯撤销失败";
  5165. }
  5166. }
  5167. catch (Exception ex)
  5168. {
  5169. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5170. OutputLog.TraceLog(LogPriority.Error,
  5171. this.ToString(),
  5172. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5173. ex.ToString(),
  5174. LocalPath.LogExePath);
  5175. actionResult.Status = (int)Constant.PDAResult.Exception;
  5176. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5177. }
  5178. return actionResult;
  5179. }
  5180. /*
  5181. /// <summary>
  5182. /// 获取用户是否有损坯撤销权限
  5183. /// </summary>
  5184. /// <param name="accountCode"></param>
  5185. /// <param name="userCode"></param>
  5186. /// <param name="userPassword"></param>
  5187. /// <param name="sessionKey"></param>
  5188. /// <returns></returns>
  5189. public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5190. {
  5191. ActionResult actionResult = new ActionResult();
  5192. try
  5193. {
  5194. // 验证请求头信息
  5195. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5196. // 验证失败
  5197. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5198. {
  5199. return actionResult;
  5200. }
  5201. int returnValue = ServiceInvoker.Invoke<int>(this,
  5202. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5203. actionResult.Result = JsonHelper.ToJson(returnValue);
  5204. actionResult.Status = (int)Constant.PDAResult.Success;
  5205. }
  5206. catch (Exception ex)
  5207. {
  5208. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5209. OutputLog.TraceLog(LogPriority.Error,
  5210. this.ToString(),
  5211. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5212. ex.ToString(),
  5213. LocalPath.LogExePath);
  5214. actionResult.Status = (int)Constant.PDAResult.Exception;
  5215. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5216. }
  5217. return actionResult;
  5218. }
  5219. */
  5220. /// <summary>
  5221. /// 获取条码注浆信息
  5222. /// </summary>
  5223. /// <param name="accountCode"></param>
  5224. /// <param name="userCode"></param>
  5225. /// <param name="userPassword"></param>
  5226. /// <param name="sessionKey"></param>
  5227. /// <returns></returns>
  5228. public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5229. {
  5230. ActionResult actionResult = new ActionResult();
  5231. try
  5232. {
  5233. // 验证请求头信息
  5234. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5235. // 验证失败
  5236. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5237. {
  5238. return actionResult;
  5239. }
  5240. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5241. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5242. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5243. {
  5244. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5245. actionResult.Status = (int)Constant.PDAResult.Success;
  5246. }
  5247. else
  5248. {
  5249. actionResult.Status = (int)Constant.PDAResult.Fail;
  5250. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5251. }
  5252. }
  5253. catch (Exception ex)
  5254. {
  5255. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5256. OutputLog.TraceLog(LogPriority.Error,
  5257. this.ToString(),
  5258. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5259. ex.ToString(),
  5260. LocalPath.LogExePath);
  5261. actionResult.Status = (int)Constant.PDAResult.Exception;
  5262. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5263. }
  5264. return actionResult;
  5265. }
  5266. /// <summary>
  5267. /// 获取条码注浆信息
  5268. /// </summary>
  5269. /// <param name="accountCode"></param>
  5270. /// <param name="userCode"></param>
  5271. /// <param name="userPassword"></param>
  5272. /// <param name="sessionKey"></param>
  5273. /// <returns></returns>
  5274. public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5275. {
  5276. ActionResult actionResult = new ActionResult();
  5277. try
  5278. {
  5279. // 验证请求头信息
  5280. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5281. // 验证失败
  5282. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5283. {
  5284. return actionResult;
  5285. }
  5286. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5287. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5288. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5289. {
  5290. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5291. actionResult.Status = (int)Constant.PDAResult.Success;
  5292. }
  5293. else
  5294. {
  5295. actionResult.Status = (int)Constant.PDAResult.Fail;
  5296. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5297. }
  5298. }
  5299. catch (Exception ex)
  5300. {
  5301. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5302. OutputLog.TraceLog(LogPriority.Error,
  5303. this.ToString(),
  5304. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5305. ex.ToString(),
  5306. LocalPath.LogExePath);
  5307. actionResult.Status = (int)Constant.PDAResult.Exception;
  5308. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5309. }
  5310. return actionResult;
  5311. }
  5312. /// <summary>
  5313. /// 公坯设定
  5314. /// </summary>
  5315. /// <param name="accountCode"></param>
  5316. /// <param name="userCode"></param>
  5317. /// <param name="userPassword"></param>
  5318. /// <param name="sessionKey"></param>
  5319. /// <param name="barcode"></param>
  5320. /// <returns></returns>
  5321. public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5322. {
  5323. ActionResult actionResult = new ActionResult();
  5324. try
  5325. {
  5326. // 验证请求头信息
  5327. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5328. // 验证失败
  5329. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5330. {
  5331. return actionResult;
  5332. }
  5333. int returnValue = ServiceInvoker.Invoke<int>(this,
  5334. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5335. if (returnValue > 0)
  5336. {
  5337. actionResult.Result = JsonHelper.ToJson(returnValue);
  5338. actionResult.Status = (int)Constant.PDAResult.Success;
  5339. }
  5340. else
  5341. {
  5342. actionResult.Status = (int)Constant.PDAResult.Fail;
  5343. if (returnValue == -1)
  5344. actionResult.Message = "此产品不在生产线上";
  5345. else if (returnValue == -2)
  5346. actionResult.Message = "该产品已经标识为公坯";
  5347. else
  5348. actionResult.Message = "公坯设定失败";
  5349. }
  5350. }
  5351. catch (Exception ex)
  5352. {
  5353. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5354. OutputLog.TraceLog(LogPriority.Error,
  5355. this.ToString(),
  5356. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5357. ex.ToString(),
  5358. LocalPath.LogExePath);
  5359. actionResult.Status = (int)Constant.PDAResult.Exception;
  5360. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5361. }
  5362. return actionResult;
  5363. }
  5364. /*
  5365. /// <summary>
  5366. /// 获取用户是否有公坯设定
  5367. /// </summary>
  5368. /// <param name="accountCode"></param>
  5369. /// <param name="userCode"></param>
  5370. /// <param name="userPassword"></param>
  5371. /// <param name="sessionKey"></param>
  5372. /// <returns></returns>
  5373. public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  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. int returnValue = ServiceInvoker.Invoke<int>(this,
  5386. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5387. actionResult.Result = JsonHelper.ToJson(returnValue);
  5388. actionResult.Status = (int)Constant.PDAResult.Success;
  5389. }
  5390. catch (Exception ex)
  5391. {
  5392. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5393. OutputLog.TraceLog(LogPriority.Error,
  5394. this.ToString(),
  5395. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5396. ex.ToString(),
  5397. LocalPath.LogExePath);
  5398. actionResult.Status = (int)Constant.PDAResult.Exception;
  5399. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5400. }
  5401. return actionResult;
  5402. }
  5403. */
  5404. /// <summary>
  5405. /// 校验产品条码是否可以走到该工序
  5406. /// </summary>
  5407. /// <param name="accountCode">帐套code</param>
  5408. /// <param name="userCode">用户code</param>
  5409. /// <param name="userPassword">用户密码</param>
  5410. /// <param name="sessionKey">本次登陆密钥</param>
  5411. /// <param name="procedureID">工序ID</param>
  5412. /// <param name="barcode">条码</param>
  5413. /// <returns></returns>
  5414. /// <remarks>
  5415. /// 陈冰 2014.09.18 新建
  5416. /// </remarks>
  5417. public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5418. {
  5419. ActionResult actionResult = new ActionResult();
  5420. try
  5421. {
  5422. // 验证请求头信息
  5423. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5424. // 验证失败
  5425. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5426. {
  5427. return actionResult;
  5428. }
  5429. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5430. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5431. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5432. {
  5433. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5434. actionResult.Status = (int)Constant.PDAResult.Success;
  5435. }
  5436. else
  5437. {
  5438. actionResult.Status = (int)Constant.PDAResult.Fail;
  5439. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5440. }
  5441. }
  5442. catch (Exception ex)
  5443. {
  5444. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5445. OutputLog.TraceLog(LogPriority.Error,
  5446. this.ToString(),
  5447. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5448. ex.ToString(),
  5449. LocalPath.LogExePath);
  5450. actionResult.Status = (int)Constant.PDAResult.Exception;
  5451. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5452. }
  5453. return actionResult;
  5454. }
  5455. /// <summary>
  5456. /// 获取用户所有菜单权限
  5457. /// </summary>
  5458. /// <param name="accountCode"></param>
  5459. /// <param name="userCode"></param>
  5460. /// <param name="userPassword"></param>
  5461. /// <param name="sessionKey"></param>
  5462. /// <returns></returns>
  5463. public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
  5464. {
  5465. ActionResult actionResult = new ActionResult();
  5466. try
  5467. {
  5468. // 验证请求头信息
  5469. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5470. // 验证失败
  5471. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5472. {
  5473. return actionResult;
  5474. }
  5475. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5476. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5477. actionResult.Result = JsonHelper.ToJson(returnValue);
  5478. actionResult.Status = (int)Constant.PDAResult.Success;
  5479. }
  5480. catch (Exception ex)
  5481. {
  5482. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5483. OutputLog.TraceLog(LogPriority.Error,
  5484. this.ToString(),
  5485. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5486. ex.ToString(),
  5487. LocalPath.LogExePath);
  5488. actionResult.Status = (int)Constant.PDAResult.Exception;
  5489. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5490. }
  5491. return actionResult;
  5492. }
  5493. public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5494. {
  5495. ActionResult actionResult = new ActionResult();
  5496. try
  5497. {
  5498. // 验证请求头信息
  5499. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5500. // 验证失败
  5501. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5502. {
  5503. return actionResult;
  5504. }
  5505. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5506. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5507. if (Convert.ToInt32(returnValue.Result) > 0)
  5508. {
  5509. actionResult.Result = JsonHelper.ToJson(returnValue);
  5510. actionResult.Status = (int)Constant.PDAResult.Success;
  5511. }
  5512. else
  5513. {
  5514. actionResult.Status = (int)Constant.PDAResult.Fail;
  5515. if (Convert.ToInt32(returnValue.Result) == -1)
  5516. actionResult.Message = "无效条码";
  5517. else if (Convert.ToInt32(returnValue.Result) == -2)
  5518. actionResult.Message = "已经生产完成";
  5519. else if (Convert.ToInt32(returnValue.Result) == -3)
  5520. actionResult.Message = "条码已经申请报废";
  5521. else if (Convert.ToInt32(returnValue.Result) == -4)
  5522. actionResult.Message = "此条码当前工序不允许进行撤销";
  5523. else if (Convert.ToInt32(returnValue.Result) == -5)
  5524. actionResult.Message = "此条码没有生产数据";
  5525. else if (Convert.ToInt32(returnValue.Result) == -6)
  5526. actionResult.Message = "没有当前工序权限";
  5527. else if (Convert.ToInt32(returnValue.Result) == -7)
  5528. actionResult.Message = "条码不在生产线上";
  5529. else if (Convert.ToInt32(returnValue.Result) == -8)
  5530. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5531. else if (Convert.ToInt32(returnValue.Result) == -9)
  5532. actionResult.Message = "条码已经是返工状态";
  5533. else if (Convert.ToInt32(returnValue.Result) == -200)
  5534. actionResult.Message = returnValue.Message;
  5535. }
  5536. }
  5537. catch (Exception ex)
  5538. {
  5539. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5540. OutputLog.TraceLog(LogPriority.Error,
  5541. this.ToString(),
  5542. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5543. ex.ToString(),
  5544. LocalPath.LogExePath);
  5545. actionResult.Status = (int)Constant.PDAResult.Exception;
  5546. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5547. }
  5548. return actionResult;
  5549. }
  5550. public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5551. {
  5552. ActionResult actionResult = new ActionResult();
  5553. try
  5554. {
  5555. // 验证请求头信息
  5556. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5557. // 验证失败
  5558. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5559. {
  5560. return actionResult;
  5561. }
  5562. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5563. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5564. if (Convert.ToInt32(returnValue.Result) > 0)
  5565. {
  5566. actionResult.Result = JsonHelper.ToJson(returnValue);
  5567. actionResult.Status = (int)Constant.PDAResult.Success;
  5568. }
  5569. else
  5570. {
  5571. actionResult.Status = (int)Constant.PDAResult.Fail;
  5572. if (Convert.ToInt32(returnValue.Result) == -1)
  5573. actionResult.Message = "无效条码";
  5574. else if (Convert.ToInt32(returnValue.Result) == -2)
  5575. actionResult.Message = "已经生产完成";
  5576. else if (Convert.ToInt32(returnValue.Result) == -3)
  5577. actionResult.Message = "条码已经申请报废";
  5578. else if (Convert.ToInt32(returnValue.Result) == -4)
  5579. actionResult.Message = "此条码当前工序不允许进行撤销";
  5580. else if (Convert.ToInt32(returnValue.Result) == -5)
  5581. actionResult.Message = "此条码没有生产数据";
  5582. else if (Convert.ToInt32(returnValue.Result) == -55)
  5583. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5584. else if (Convert.ToInt32(returnValue.Result) == -6)
  5585. actionResult.Message = "没有任何影响行";
  5586. else if (Convert.ToInt32(returnValue.Result) == -7)
  5587. actionResult.Message = "条码不在生产线上";
  5588. else if (Convert.ToInt32(returnValue.Result) == -8)
  5589. actionResult.Message = "条码已经是返工状态";
  5590. else if (Convert.ToInt32(returnValue.Result) == -200)
  5591. actionResult.Message = returnValue.Message;
  5592. }
  5593. }
  5594. catch (Exception ex)
  5595. {
  5596. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5597. OutputLog.TraceLog(LogPriority.Error,
  5598. this.ToString(),
  5599. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5600. ex.ToString(),
  5601. LocalPath.LogExePath);
  5602. actionResult.Status = (int)Constant.PDAResult.Exception;
  5603. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5604. }
  5605. return actionResult;
  5606. }
  5607. public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  5608. {
  5609. ActionResult actionResult = new ActionResult();
  5610. try
  5611. {
  5612. // 验证请求头信息
  5613. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5614. // 验证失败
  5615. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5616. {
  5617. return actionResult;
  5618. }
  5619. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5620. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5621. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5622. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5623. {
  5624. //DataView dv = returnValue.Tables[0].DefaultView;
  5625. //dv.RowFilter = "ValueFlag=1";
  5626. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5627. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5628. actionResult.Status = (int)Constant.PDAResult.Success;
  5629. }
  5630. }
  5631. catch (Exception ex)
  5632. {
  5633. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5634. OutputLog.TraceLog(LogPriority.Error,
  5635. this.ToString(),
  5636. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5637. ex.ToString(),
  5638. LocalPath.LogExePath);
  5639. actionResult.Status = (int)Constant.PDAResult.Exception;
  5640. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5641. }
  5642. return actionResult;
  5643. }
  5644. public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5645. {
  5646. ActionResult actionResult = new ActionResult();
  5647. try
  5648. {
  5649. // 验证请求头信息
  5650. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5651. // 验证失败
  5652. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5653. {
  5654. return actionResult;
  5655. }
  5656. int returnValue = ServiceInvoker.Invoke<int>(this,
  5657. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5658. actionResult.Result = JsonHelper.ToJson(returnValue);
  5659. actionResult.Status = (int)Constant.PDAResult.Success;
  5660. }
  5661. catch (Exception ex)
  5662. {
  5663. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5664. OutputLog.TraceLog(LogPriority.Error,
  5665. this.ToString(),
  5666. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5667. ex.ToString(),
  5668. LocalPath.LogExePath);
  5669. actionResult.Status = (int)Constant.PDAResult.Exception;
  5670. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5671. }
  5672. return actionResult;
  5673. }
  5674. public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  5675. {
  5676. ActionResult actionResult = new ActionResult();
  5677. try
  5678. {
  5679. // 验证请求头信息
  5680. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5681. // 验证失败
  5682. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5683. {
  5684. return actionResult;
  5685. }
  5686. int returnValue = ServiceInvoker.Invoke<int>(this,
  5687. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo));
  5688. actionResult.Result = JsonHelper.ToJson(returnValue);
  5689. actionResult.Status = (int)Constant.PDAResult.Success;
  5690. }
  5691. catch (Exception ex)
  5692. {
  5693. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5694. OutputLog.TraceLog(LogPriority.Error,
  5695. this.ToString(),
  5696. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5697. ex.ToString(),
  5698. LocalPath.LogExePath);
  5699. actionResult.Status = (int)Constant.PDAResult.Exception;
  5700. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5701. }
  5702. return actionResult;
  5703. }
  5704. public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5705. {
  5706. ActionResult actionResult = new ActionResult();
  5707. try
  5708. {
  5709. // 验证请求头信息
  5710. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5711. // 验证失败
  5712. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5713. {
  5714. return actionResult;
  5715. }
  5716. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5717. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  5718. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5719. {
  5720. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5721. actionResult.Status = (int)Constant.PDAResult.Success;
  5722. }
  5723. }
  5724. catch (Exception ex)
  5725. {
  5726. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5727. OutputLog.TraceLog(LogPriority.Error,
  5728. this.ToString(),
  5729. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5730. ex.ToString(),
  5731. LocalPath.LogExePath);
  5732. actionResult.Status = (int)Constant.PDAResult.Exception;
  5733. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5734. }
  5735. return actionResult;
  5736. }
  5737. /// <summary>
  5738. /// 半检时,入窑前检验获取此条码是否报损为废品
  5739. /// </summary>
  5740. /// <param name="accountCode"></param>
  5741. /// <param name="userCode"></param>
  5742. /// <param name="userPassword"></param>
  5743. /// <param name="sessionKey"></param>
  5744. /// <param name="barcode">产品条码</param>
  5745. /// <returns></returns>
  5746. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  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. int returnValue = ServiceInvoker.Invoke<int>(this,
  5759. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  5760. if (returnValue != -100)
  5761. {
  5762. actionResult.Result = JsonHelper.ToJson(returnValue);
  5763. actionResult.Status = (int)Constant.PDAResult.Success;
  5764. }
  5765. else
  5766. {
  5767. actionResult.Status = (int)Constant.PDAResult.Fail;
  5768. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  5769. }
  5770. }
  5771. catch (Exception ex)
  5772. {
  5773. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5774. OutputLog.TraceLog(LogPriority.Error,
  5775. this.ToString(),
  5776. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5777. ex.ToString(),
  5778. LocalPath.LogExePath);
  5779. actionResult.Status = (int)Constant.PDAResult.Exception;
  5780. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5781. }
  5782. return actionResult;
  5783. }
  5784. /// <summary>
  5785. /// 获取登陆帐户有无入窑前检验数据编辑权限
  5786. /// </summary>
  5787. /// <param name="accountCode"></param>
  5788. /// <param name="userCode"></param>
  5789. /// <param name="userPassword"></param>
  5790. /// <param name="sessionKey"></param>
  5791. /// <param name="usercode">工号编码</param>
  5792. /// <returns></returns>
  5793. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5794. {
  5795. ActionResult actionResult = new ActionResult();
  5796. try
  5797. {
  5798. // 验证请求头信息
  5799. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5800. // 验证失败
  5801. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5802. {
  5803. return actionResult;
  5804. }
  5805. int returnValue = ServiceInvoker.Invoke<int>(this,
  5806. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  5807. actionResult.Result = JsonHelper.ToJson(returnValue);
  5808. actionResult.Status = (int)Constant.PDAResult.Success;
  5809. }
  5810. catch (Exception ex)
  5811. {
  5812. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5813. OutputLog.TraceLog(LogPriority.Error,
  5814. this.ToString(),
  5815. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5816. ex.ToString(),
  5817. LocalPath.LogExePath);
  5818. actionResult.Status = (int)Constant.PDAResult.Exception;
  5819. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5820. }
  5821. return actionResult;
  5822. }
  5823. /// <summary>
  5824. /// 获取登陆帐户有无半检验数据编辑权限
  5825. /// </summary>
  5826. /// <param name="accountCode"></param>
  5827. /// <param name="userCode"></param>
  5828. /// <param name="userPassword"></param>
  5829. /// <param name="sessionKey"></param>
  5830. /// <param name="usercode">工号编码</param>
  5831. /// <returns></returns>
  5832. public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5833. {
  5834. ActionResult actionResult = new ActionResult();
  5835. try
  5836. {
  5837. // 验证请求头信息
  5838. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5839. // 验证失败
  5840. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5841. {
  5842. return actionResult;
  5843. }
  5844. int returnValue = ServiceInvoker.Invoke<int>(this,
  5845. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  5846. actionResult.Result = JsonHelper.ToJson(returnValue);
  5847. actionResult.Status = (int)Constant.PDAResult.Success;
  5848. }
  5849. catch (Exception ex)
  5850. {
  5851. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5852. OutputLog.TraceLog(LogPriority.Error,
  5853. this.ToString(),
  5854. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5855. ex.ToString(),
  5856. LocalPath.LogExePath);
  5857. actionResult.Status = (int)Constant.PDAResult.Exception;
  5858. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5859. }
  5860. return actionResult;
  5861. }
  5862. /// <summary>
  5863. /// 获取缺陷扣罚管理的全部数据
  5864. /// </summary>
  5865. /// <param name="accountCode"></param>
  5866. /// <param name="userCode"></param>
  5867. /// <param name="userPassword"></param>
  5868. /// <param name="sessionKey"></param>
  5869. /// <returns></returns>
  5870. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  5871. {
  5872. ActionResult actionResult = new ActionResult();
  5873. try
  5874. {
  5875. // 验证请求头信息
  5876. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5877. // 验证失败
  5878. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5879. {
  5880. return actionResult;
  5881. }
  5882. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5883. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  5884. if (ds != null && ds.Tables[0].Rows.Count > 0)
  5885. {
  5886. DataView dv = ds.Tables[0].DefaultView;
  5887. dv.RowFilter = "valueflag=1";
  5888. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5889. actionResult.Status = (int)Constant.PDAResult.Success;
  5890. }
  5891. else
  5892. {
  5893. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  5894. actionResult.Status = (int)Constant.PDAResult.Success;
  5895. }
  5896. }
  5897. catch (Exception ex)
  5898. {
  5899. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5900. OutputLog.TraceLog(LogPriority.Error,
  5901. this.ToString(),
  5902. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5903. ex.ToString(),
  5904. LocalPath.LogExePath);
  5905. actionResult.Status = (int)Constant.PDAResult.Exception;
  5906. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5907. }
  5908. return actionResult;
  5909. }
  5910. /// <summary>
  5911. /// 获取缺陷扣除数管理的全部数据
  5912. /// </summary>
  5913. /// <param name="accountCode"></param>
  5914. /// <param name="userCode"></param>
  5915. /// <param name="userPassword"></param>
  5916. /// <param name="sessionKey"></param>
  5917. /// <returns></returns>
  5918. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  5919. {
  5920. ActionResult actionResult = new ActionResult();
  5921. try
  5922. {
  5923. // 验证请求头信息
  5924. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5925. // 验证失败
  5926. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5927. {
  5928. return actionResult;
  5929. }
  5930. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5931. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  5932. if (ds != null && ds.Tables[0].Rows.Count > 0)
  5933. {
  5934. DataView dv = ds.Tables[0].DefaultView;
  5935. dv.RowFilter = "valueflag=1";
  5936. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5937. actionResult.Status = (int)Constant.PDAResult.Success;
  5938. }
  5939. else
  5940. {
  5941. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  5942. actionResult.Status = (int)Constant.PDAResult.Success;
  5943. }
  5944. }
  5945. catch (Exception ex)
  5946. {
  5947. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5948. OutputLog.TraceLog(LogPriority.Error,
  5949. this.ToString(),
  5950. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5951. ex.ToString(),
  5952. LocalPath.LogExePath);
  5953. actionResult.Status = (int)Constant.PDAResult.Exception;
  5954. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5955. }
  5956. return actionResult;
  5957. }
  5958. /// <summary>
  5959. /// 获取缺陷扣罚关系管理的全部数据
  5960. /// </summary>
  5961. /// <param name="accountCode"></param>
  5962. /// <param name="userCode"></param>
  5963. /// <param name="userPassword"></param>
  5964. /// <param name="sessionKey"></param>
  5965. /// <returns></returns>
  5966. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  5967. {
  5968. ActionResult actionResult = new ActionResult();
  5969. try
  5970. {
  5971. // 验证请求头信息
  5972. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5973. // 验证失败
  5974. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5975. {
  5976. return actionResult;
  5977. }
  5978. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5979. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  5980. DataTable dt = new DataTable();
  5981. dt.Columns.Add("DefectID");
  5982. dt.Columns.Add("DefectFineID");
  5983. DataView dv = ds.Tables[0].DefaultView;
  5984. DataTable dtFor = dv.ToTable("defectid", true);
  5985. for (int i = 0; i < dtFor.Rows.Count; i++)
  5986. {
  5987. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  5988. string substring = "";
  5989. foreach (DataRow r1 in r)
  5990. {
  5991. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  5992. }
  5993. if (substring != "")
  5994. {
  5995. DataRow drnew = dt.NewRow();
  5996. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  5997. drnew["DefectFineID"] = substring.TrimEnd(',');
  5998. dt.Rows.Add(drnew);
  5999. }
  6000. }
  6001. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6002. actionResult.Status = (int)Constant.PDAResult.Success;
  6003. }
  6004. catch (Exception ex)
  6005. {
  6006. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6007. OutputLog.TraceLog(LogPriority.Error,
  6008. this.ToString(),
  6009. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6010. ex.ToString(),
  6011. LocalPath.LogExePath);
  6012. actionResult.Status = (int)Constant.PDAResult.Exception;
  6013. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6014. }
  6015. return actionResult;
  6016. }
  6017. /// <summary>
  6018. /// 获取缺陷扣除数关系管理的全部数据
  6019. /// </summary>
  6020. /// <param name="accountCode"></param>
  6021. /// <param name="userCode"></param>
  6022. /// <param name="userPassword"></param>
  6023. /// <param name="sessionKey"></param>
  6024. /// <returns></returns>
  6025. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6026. {
  6027. ActionResult actionResult = new ActionResult();
  6028. try
  6029. {
  6030. // 验证请求头信息
  6031. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6032. // 验证失败
  6033. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6034. {
  6035. return actionResult;
  6036. }
  6037. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6038. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6039. DataTable dt = new DataTable();
  6040. dt.Columns.Add("DefectID");
  6041. dt.Columns.Add("DefectDeductionNum");
  6042. DataView dv = ds.Tables[0].DefaultView;
  6043. DataTable dtFor = dv.ToTable("defectid", true);
  6044. for (int i = 0; i < dtFor.Rows.Count; i++)
  6045. {
  6046. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6047. string substring = "";
  6048. foreach (DataRow r1 in r)
  6049. {
  6050. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6051. }
  6052. if (substring != "")
  6053. {
  6054. DataRow drnew = dt.NewRow();
  6055. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6056. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6057. dt.Rows.Add(drnew);
  6058. }
  6059. }
  6060. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6061. actionResult.Status = (int)Constant.PDAResult.Success;
  6062. }
  6063. catch (Exception ex)
  6064. {
  6065. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6066. OutputLog.TraceLog(LogPriority.Error,
  6067. this.ToString(),
  6068. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6069. ex.ToString(),
  6070. LocalPath.LogExePath);
  6071. actionResult.Status = (int)Constant.PDAResult.Exception;
  6072. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6073. }
  6074. return actionResult;
  6075. }
  6076. /// <summary>
  6077. /// 获取盘点单明细
  6078. /// </summary>
  6079. /// <param name="sUserInfo"></param>
  6080. /// <returns></returns>
  6081. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6082. {
  6083. ActionResult actionResult = new ActionResult();
  6084. try
  6085. {
  6086. // 验证请求头信息
  6087. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6088. // 验证失败
  6089. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6090. {
  6091. return actionResult;
  6092. }
  6093. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6094. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6095. actionResult.Result = JsonHelper.ToJson(ds);
  6096. actionResult.Status = (int)Constant.PDAResult.Success;
  6097. }
  6098. catch (Exception ex)
  6099. {
  6100. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6101. OutputLog.TraceLog(LogPriority.Error,
  6102. this.ToString(),
  6103. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6104. ex.ToString(),
  6105. LocalPath.LogExePath);
  6106. actionResult.Status = (int)Constant.PDAResult.Exception;
  6107. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6108. }
  6109. return actionResult;
  6110. }
  6111. /// <summary>
  6112. /// 半检检验条码
  6113. /// </summary>
  6114. /// <param name="sUserInfo"></param>
  6115. /// <returns></returns>
  6116. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6117. {
  6118. ActionResult actionResult = new ActionResult();
  6119. try
  6120. {
  6121. // 验证请求头信息
  6122. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6123. // 验证失败
  6124. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6125. {
  6126. return actionResult;
  6127. }
  6128. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6129. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6130. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6131. if (Convert.ToInt32(resultEntity.Result) < 0)
  6132. {
  6133. actionResult.Status = (int)Constant.PDAResult.Fail;
  6134. }
  6135. else
  6136. {
  6137. actionResult.Status = (int)Constant.PDAResult.Success;
  6138. }
  6139. actionResult.Message = resultEntity.Message;
  6140. }
  6141. catch (Exception ex)
  6142. {
  6143. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6144. OutputLog.TraceLog(LogPriority.Error,
  6145. this.ToString(),
  6146. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6147. ex.ToString(),
  6148. LocalPath.LogExePath);
  6149. actionResult.Status = (int)Constant.PDAResult.Exception;
  6150. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6151. }
  6152. return actionResult;
  6153. }
  6154. /// <summary>
  6155. /// 根据条码获取经过的工序,用于绑定返工工序
  6156. /// </summary>
  6157. /// <param name="sUserInfo"></param>
  6158. /// <returns></returns>
  6159. public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6160. {
  6161. ActionResult actionResult = new ActionResult();
  6162. try
  6163. {
  6164. // 验证请求头信息
  6165. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6166. // 验证失败
  6167. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6168. {
  6169. return actionResult;
  6170. }
  6171. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6172. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6173. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6174. actionResult.Status = (int)Constant.PDAResult.Success;
  6175. }
  6176. catch (Exception ex)
  6177. {
  6178. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6179. OutputLog.TraceLog(LogPriority.Error,
  6180. this.ToString(),
  6181. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6182. ex.ToString(),
  6183. LocalPath.LogExePath);
  6184. actionResult.Status = (int)Constant.PDAResult.Exception;
  6185. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6186. }
  6187. return actionResult;
  6188. }
  6189. /// <summary>
  6190. /// 获取登陆帐户有无半检状态权限
  6191. /// </summary>
  6192. /// <param name="sUserInfo"></param>
  6193. /// <returns></returns>
  6194. public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6195. {
  6196. ActionResult actionResult = new ActionResult();
  6197. try
  6198. {
  6199. // 验证请求头信息
  6200. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6201. // 验证失败
  6202. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6203. {
  6204. return actionResult;
  6205. }
  6206. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6207. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6208. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6209. actionResult.Status = (int)Constant.PDAResult.Success;
  6210. }
  6211. catch (Exception ex)
  6212. {
  6213. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6214. OutputLog.TraceLog(LogPriority.Error,
  6215. this.ToString(),
  6216. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6217. ex.ToString(),
  6218. LocalPath.LogExePath);
  6219. actionResult.Status = (int)Constant.PDAResult.Exception;
  6220. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6221. }
  6222. return actionResult;
  6223. }
  6224. /// <summary>
  6225. /// 复检状态数据源
  6226. /// </summary>
  6227. /// <param name="sUserInfo"></param>
  6228. /// <returns></returns>
  6229. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6230. {
  6231. ActionResult actionResult = new ActionResult();
  6232. try
  6233. {
  6234. // 验证请求头信息
  6235. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6236. // 验证失败
  6237. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6238. {
  6239. return actionResult;
  6240. }
  6241. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6242. () => SystemModuleLogic.GetSemiCheckType());
  6243. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6244. actionResult.Status = (int)Constant.PDAResult.Success;
  6245. }
  6246. catch (Exception ex)
  6247. {
  6248. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6249. OutputLog.TraceLog(LogPriority.Error,
  6250. this.ToString(),
  6251. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6252. ex.ToString(),
  6253. LocalPath.LogExePath);
  6254. actionResult.Status = (int)Constant.PDAResult.Exception;
  6255. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6256. }
  6257. return actionResult;
  6258. }
  6259. /// <summary>
  6260. /// 根据半成品检验数据ID,显示半成品数据信息
  6261. /// </summary>
  6262. /// <param name="sUserInfo"></param>
  6263. /// <returns></returns>
  6264. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6265. {
  6266. ActionResult actionResult = new ActionResult();
  6267. try
  6268. {
  6269. // 验证请求头信息
  6270. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6271. // 验证失败
  6272. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6273. {
  6274. return actionResult;
  6275. }
  6276. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6277. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6278. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6279. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6280. {
  6281. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6282. {
  6283. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6284. {
  6285. SemiCheckEntity productionData = new SemiCheckEntity();
  6286. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6287. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6288. {
  6289. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6290. }
  6291. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6292. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6293. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6294. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6295. productionData.ReFine = 0;
  6296. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6297. {
  6298. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6299. }
  6300. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6301. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6302. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6303. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6304. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6305. {
  6306. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6307. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6308. }
  6309. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6310. {
  6311. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6312. }
  6313. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6314. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6315. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6316. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6317. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6318. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6319. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6320. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6321. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6322. {
  6323. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6324. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6325. }
  6326. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6327. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6328. {
  6329. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6330. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6331. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6332. }
  6333. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6334. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6335. {
  6336. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6337. }
  6338. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6339. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6340. DataTable dtDefect = dvDefect.ToTable();
  6341. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6342. {
  6343. // 产品缺陷
  6344. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6345. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6346. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6347. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6348. //{
  6349. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6350. //}
  6351. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6352. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6353. {
  6354. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6355. }
  6356. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6357. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6358. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6359. {
  6360. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6361. }
  6362. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6363. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6364. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6365. {
  6366. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6367. }
  6368. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6369. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6370. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6371. {
  6372. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6373. }
  6374. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6375. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6376. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6377. //{
  6378. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6379. //}
  6380. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6381. //{
  6382. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6383. //}
  6384. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6385. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6386. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6387. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6388. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6389. {
  6390. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6391. }
  6392. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6393. {
  6394. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6395. }
  6396. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6397. //{
  6398. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6399. //}
  6400. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6401. //--------责任员工-------------------
  6402. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6403. if (drRow.Length > Constant.INT_IS_ZERO)
  6404. {
  6405. if (defect.DefectResponsibles == null)
  6406. {
  6407. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6408. }
  6409. foreach (DataRow r in drRow)
  6410. {
  6411. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6412. if (r["SemiCheckDefectID"].ToString() != "")
  6413. {
  6414. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6415. }
  6416. if (r["StaffID"].ToString() != "")
  6417. {
  6418. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6419. }
  6420. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6421. defectResponsible.StaffName = r["StaffName"].ToString();
  6422. if (r["StaffStatus"].ToString() != "")
  6423. {
  6424. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6425. }
  6426. if (r["UJobsID"].ToString() != "")
  6427. {
  6428. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6429. }
  6430. if (r["SJobsID"].ToString() != "")
  6431. {
  6432. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6433. }
  6434. defect.DefectResponsibles.Add(defectResponsible);
  6435. }
  6436. }
  6437. //------------------------------
  6438. if (productionData.SemiCheckDefects == null)
  6439. {
  6440. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6441. }
  6442. productionData.SemiCheckDefects.Add(defect);
  6443. }
  6444. //if (productionDatas.PDAProductionData == null)
  6445. //{
  6446. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6447. //}
  6448. productionDatas[0] = productionData;
  6449. //---------------------------------------------------------------------------------
  6450. }
  6451. }
  6452. }
  6453. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6454. actionResult.Status = (int)Constant.PDAResult.Success;
  6455. }
  6456. catch (Exception ex)
  6457. {
  6458. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6459. OutputLog.TraceLog(LogPriority.Error,
  6460. this.ToString(),
  6461. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6462. ex.ToString(),
  6463. LocalPath.LogExePath);
  6464. actionResult.Status = (int)Constant.PDAResult.Exception;
  6465. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6466. }
  6467. return actionResult;
  6468. }
  6469. /// <summary>
  6470. /// 保存半检登记
  6471. /// </summary>
  6472. /// <param name="accountCode">帐套code</param>
  6473. /// <param name="userCode">用户code</param>
  6474. /// <param name="userPassword">用户密码</param>
  6475. /// <param name="sessionKey">本次登陆密钥</param>
  6476. /// <param name="entity">半检实体类</param>
  6477. /// <param name="sUserInfo">用户基本信息</param>
  6478. /// <returns></returns>
  6479. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6480. {
  6481. ActionResult actionResult = new ActionResult();
  6482. try
  6483. {
  6484. // 验证请求头信息
  6485. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6486. // 验证失败
  6487. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6488. {
  6489. return actionResult;
  6490. }
  6491. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6492. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6493. string err = string.Empty;
  6494. err = resultEntity.Message;
  6495. if (err == null)
  6496. {
  6497. err = "";
  6498. }
  6499. SemiCheckEntity entity = entityobj[0];
  6500. if (entity.SemiCheckCategory == 1) // 半检登记
  6501. {
  6502. }
  6503. else if (entity.SemiCheckCategory == 2)// 复检登记
  6504. {
  6505. err = JsonHelper.ToJson(err);
  6506. }
  6507. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6508. {
  6509. err = JsonHelper.ToJson(err);
  6510. }
  6511. //actionResult.Result = JsonHelper.ToJson(err);
  6512. actionResult.Result = err;//JsonHelper.ToJson(err);
  6513. actionResult.Status = (int)Constant.PDAResult.Success;
  6514. }
  6515. catch (Exception ex)
  6516. {
  6517. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6518. OutputLog.TraceLog(LogPriority.Error,
  6519. this.ToString(),
  6520. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6521. ex.ToString(),
  6522. LocalPath.LogExePath);
  6523. actionResult.Status = (int)Constant.PDAResult.Exception;
  6524. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6525. }
  6526. return actionResult;
  6527. }
  6528. /// <summary>
  6529. /// 根据所选工号,查出缺陷责任员工
  6530. /// </summary>
  6531. /// <param name="sUserInfo"></param>
  6532. /// <returns></returns>
  6533. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6534. {
  6535. ActionResult actionResult = new ActionResult();
  6536. try
  6537. {
  6538. // 验证请求头信息
  6539. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6540. // 验证失败
  6541. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6542. {
  6543. return actionResult;
  6544. }
  6545. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6546. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  6547. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6548. actionResult.Status = (int)Constant.PDAResult.Success;
  6549. }
  6550. catch (Exception ex)
  6551. {
  6552. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6553. OutputLog.TraceLog(LogPriority.Error,
  6554. this.ToString(),
  6555. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6556. ex.ToString(),
  6557. LocalPath.LogExePath);
  6558. actionResult.Status = (int)Constant.PDAResult.Exception;
  6559. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6560. }
  6561. return actionResult;
  6562. }
  6563. /// <summary>
  6564. /// 获取半成品缺陷管理的全部数据
  6565. /// </summary>
  6566. /// <param name="sUserInfo"></param>
  6567. /// <returns></returns>
  6568. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  6569. {
  6570. ActionResult actionResult = new ActionResult();
  6571. try
  6572. {
  6573. // 验证请求头信息
  6574. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6575. // 验证失败
  6576. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6577. {
  6578. return actionResult;
  6579. }
  6580. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6581. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  6582. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6583. actionResult.Status = (int)Constant.PDAResult.Success;
  6584. }
  6585. catch (Exception ex)
  6586. {
  6587. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6588. OutputLog.TraceLog(LogPriority.Error,
  6589. this.ToString(),
  6590. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6591. ex.ToString(),
  6592. LocalPath.LogExePath);
  6593. actionResult.Status = (int)Constant.PDAResult.Exception;
  6594. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6595. }
  6596. return actionResult;
  6597. }
  6598. /// <summary>
  6599. /// 获取半成品缺陷位置管理的全部数据
  6600. /// </summary>
  6601. /// <param name="sUserInfo"></param>
  6602. /// <returns></returns>
  6603. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  6604. {
  6605. ActionResult actionResult = new ActionResult();
  6606. try
  6607. {
  6608. // 验证请求头信息
  6609. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6610. // 验证失败
  6611. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6612. {
  6613. return actionResult;
  6614. }
  6615. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6616. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  6617. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6618. actionResult.Status = (int)Constant.PDAResult.Success;
  6619. }
  6620. catch (Exception ex)
  6621. {
  6622. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6623. OutputLog.TraceLog(LogPriority.Error,
  6624. this.ToString(),
  6625. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6626. ex.ToString(),
  6627. LocalPath.LogExePath);
  6628. actionResult.Status = (int)Constant.PDAResult.Exception;
  6629. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6630. }
  6631. return actionResult;
  6632. }
  6633. /// <summary>
  6634. /// 复检验条码
  6635. /// </summary>
  6636. /// <param name="sUserInfo"></param>
  6637. /// <returns></returns>
  6638. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6639. {
  6640. ActionResult actionResult = new ActionResult();
  6641. try
  6642. {
  6643. // 验证请求头信息
  6644. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6645. // 验证失败
  6646. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6647. {
  6648. return actionResult;
  6649. }
  6650. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6651. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  6652. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6653. if (Convert.ToInt32(resultEntity.Result) < 0)
  6654. {
  6655. actionResult.Status = (int)Constant.PDAResult.Fail;
  6656. }
  6657. else
  6658. {
  6659. actionResult.Status = (int)Constant.PDAResult.Success;
  6660. }
  6661. actionResult.Message = resultEntity.Message;
  6662. }
  6663. catch (Exception ex)
  6664. {
  6665. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6666. OutputLog.TraceLog(LogPriority.Error,
  6667. this.ToString(),
  6668. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6669. ex.ToString(),
  6670. LocalPath.LogExePath);
  6671. actionResult.Status = (int)Constant.PDAResult.Exception;
  6672. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6673. }
  6674. return actionResult;
  6675. }
  6676. /// <summary>
  6677. /// 撤销复检验条码
  6678. /// </summary>
  6679. /// <param name="sUserInfo"></param>
  6680. /// <returns></returns>
  6681. public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6682. {
  6683. ActionResult actionResult = new ActionResult();
  6684. try
  6685. {
  6686. // 验证请求头信息
  6687. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6688. // 验证失败
  6689. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6690. {
  6691. return actionResult;
  6692. }
  6693. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6694. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  6695. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6696. if (Convert.ToInt32(resultEntity.Result) < 0)
  6697. {
  6698. actionResult.Status = (int)Constant.PDAResult.Fail;
  6699. }
  6700. else
  6701. {
  6702. actionResult.Status = (int)Constant.PDAResult.Success;
  6703. }
  6704. actionResult.Message = resultEntity.Message;
  6705. }
  6706. catch (Exception ex)
  6707. {
  6708. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6709. OutputLog.TraceLog(LogPriority.Error,
  6710. this.ToString(),
  6711. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6712. ex.ToString(),
  6713. LocalPath.LogExePath);
  6714. actionResult.Status = (int)Constant.PDAResult.Exception;
  6715. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6716. }
  6717. return actionResult;
  6718. }
  6719. /// <summary>
  6720. /// 恢复数据
  6721. /// </summary>
  6722. /// <param name="sUserInfo"></param>
  6723. /// <returns></returns>
  6724. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6725. {
  6726. ActionResult actionResult = new ActionResult();
  6727. try
  6728. {
  6729. // 验证请求头信息
  6730. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6731. // 验证失败
  6732. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6733. {
  6734. return actionResult;
  6735. }
  6736. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6737. () => PMModuleLogicDAL.ResetBarCode(barcode));
  6738. if (resultEntity > 0)
  6739. {
  6740. actionResult.Status = (int)Constant.PDAResult.Success;
  6741. actionResult.Message = "恢复数据成功";
  6742. }
  6743. else
  6744. {
  6745. actionResult.Status = (int)Constant.PDAResult.Fail;
  6746. if (resultEntity == -1)
  6747. {
  6748. actionResult.Message = "此条码没有清除,不能恢复";
  6749. }
  6750. else if (resultEntity == 0)
  6751. {
  6752. actionResult.Message = "没有可恢复的数据";
  6753. }
  6754. }
  6755. }
  6756. catch (Exception ex)
  6757. {
  6758. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6759. OutputLog.TraceLog(LogPriority.Error,
  6760. this.ToString(),
  6761. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6762. ex.ToString(),
  6763. LocalPath.LogExePath);
  6764. actionResult.Status = (int)Constant.PDAResult.Exception;
  6765. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6766. }
  6767. return actionResult;
  6768. }
  6769. /// <summary>
  6770. /// 通过SettingCode获取系统参数管理的数据
  6771. /// </summary>
  6772. /// <param name="accountCode"></param>
  6773. /// <param name="userCode"></param>
  6774. /// <param name="userPassword"></param>
  6775. /// <param name="sessionKey"></param>
  6776. /// <param name="settingcode">设置编码</param>
  6777. /// <returns></returns>
  6778. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  6779. {
  6780. ActionResult actionResult = new ActionResult();
  6781. try
  6782. {
  6783. // 验证请求头信息
  6784. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6785. // 验证失败
  6786. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6787. {
  6788. return actionResult;
  6789. }
  6790. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6791. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  6792. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6793. actionResult.Status = (int)Constant.PDAResult.Success;
  6794. }
  6795. catch (Exception ex)
  6796. {
  6797. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6798. OutputLog.TraceLog(LogPriority.Error,
  6799. this.ToString(),
  6800. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6801. ex.ToString(),
  6802. LocalPath.LogExePath);
  6803. actionResult.Status = (int)Constant.PDAResult.Exception;
  6804. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6805. }
  6806. return actionResult;
  6807. }
  6808. /// <summary>
  6809. /// 校验条码是否允许撤销,如果不允许提示错误消息
  6810. /// </summary>
  6811. /// <param name="accountCode"></param>
  6812. /// <param name="userCode"></param>
  6813. /// <param name="userPassword"></param>
  6814. /// <param name="sessionKey"></param>
  6815. /// <param name="orgTime">原时间</param>
  6816. /// <param name="days">允许撤销天数</param>
  6817. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  6818. /// <returns></returns>
  6819. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  6820. {
  6821. ActionResult actionResult = new ActionResult();
  6822. try
  6823. {
  6824. // 验证请求头信息
  6825. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6826. // 验证失败
  6827. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6828. {
  6829. return actionResult;
  6830. }
  6831. string[] subOrgTime = orgTime.Split('-');
  6832. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  6833. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6834. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  6835. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6836. if (Convert.ToInt32(resultEntity.Result) < 0)
  6837. {
  6838. actionResult.Status = (int)Constant.PDAResult.Fail;
  6839. }
  6840. else
  6841. {
  6842. actionResult.Status = (int)Constant.PDAResult.Success;
  6843. }
  6844. actionResult.Message = resultEntity.Message;
  6845. }
  6846. catch (Exception ex)
  6847. {
  6848. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6849. OutputLog.TraceLog(LogPriority.Error,
  6850. this.ToString(),
  6851. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6852. ex.ToString(),
  6853. LocalPath.LogExePath);
  6854. actionResult.Status = (int)Constant.PDAResult.Exception;
  6855. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6856. }
  6857. return actionResult;
  6858. }
  6859. /// <summary>
  6860. /// 获取生产订单管理的全部数据
  6861. /// </summary>
  6862. /// <param name="sUserInfo"></param>
  6863. /// <returns></returns>
  6864. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  6865. {
  6866. ActionResult actionResult = new ActionResult();
  6867. try
  6868. {
  6869. // 验证请求头信息
  6870. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6871. // 验证失败
  6872. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6873. {
  6874. return actionResult;
  6875. }
  6876. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6877. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  6878. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6879. actionResult.Status = (int)Constant.PDAResult.Success;
  6880. }
  6881. catch (Exception ex)
  6882. {
  6883. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6884. OutputLog.TraceLog(LogPriority.Error,
  6885. this.ToString(),
  6886. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6887. ex.ToString(),
  6888. LocalPath.LogExePath);
  6889. actionResult.Status = (int)Constant.PDAResult.Exception;
  6890. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6891. }
  6892. return actionResult;
  6893. }
  6894. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6895. {
  6896. ActionResult actionResult = new ActionResult();
  6897. try
  6898. {
  6899. // 验证请求头信息
  6900. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6901. // 验证失败
  6902. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6903. {
  6904. return actionResult;
  6905. }
  6906. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6907. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  6908. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6909. if (Convert.ToInt32(resultEntity.Result) < 0)
  6910. {
  6911. actionResult.Status = (int)Constant.PDAResult.Fail;
  6912. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  6913. }
  6914. else
  6915. {
  6916. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  6917. actionResult.Status = (int)Constant.PDAResult.Success;
  6918. }
  6919. actionResult.Message = resultEntity.Message;
  6920. }
  6921. catch (Exception ex)
  6922. {
  6923. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6924. OutputLog.TraceLog(LogPriority.Error,
  6925. this.ToString(),
  6926. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6927. ex.ToString(),
  6928. LocalPath.LogExePath);
  6929. actionResult.Status = (int)Constant.PDAResult.Exception;
  6930. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6931. }
  6932. return actionResult;
  6933. }
  6934. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  6935. {
  6936. ActionResult actionResult = new ActionResult();
  6937. try
  6938. {
  6939. // 验证请求头信息
  6940. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6941. // 验证失败
  6942. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6943. {
  6944. return actionResult;
  6945. }
  6946. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6947. () => SystemModuleLogic.GetSystemData(sUserInfo));
  6948. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6949. actionResult.Status = (int)Constant.PDAResult.Success;
  6950. }
  6951. catch (Exception ex)
  6952. {
  6953. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6954. OutputLog.TraceLog(LogPriority.Error,
  6955. this.ToString(),
  6956. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6957. ex.ToString(),
  6958. LocalPath.LogExePath);
  6959. actionResult.Status = (int)Constant.PDAResult.Exception;
  6960. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6961. }
  6962. return actionResult;
  6963. }
  6964. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  6965. {
  6966. ActionResult actionResult = new ActionResult();
  6967. try
  6968. {
  6969. // 验证请求头信息
  6970. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6971. // 验证失败
  6972. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6973. {
  6974. return actionResult;
  6975. }
  6976. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  6977. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6978. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  6979. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6980. if (Convert.ToInt32(resultEntity.Result) < 0)
  6981. {
  6982. actionResult.Status = (int)Constant.PDAResult.Fail;
  6983. }
  6984. else
  6985. {
  6986. actionResult.Status = (int)Constant.PDAResult.Success;
  6987. }
  6988. actionResult.Message = resultEntity.Message;
  6989. }
  6990. catch (Exception ex)
  6991. {
  6992. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6993. OutputLog.TraceLog(LogPriority.Error,
  6994. this.ToString(),
  6995. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6996. ex.ToString(),
  6997. LocalPath.LogExePath);
  6998. actionResult.Status = (int)Constant.PDAResult.Exception;
  6999. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7000. }
  7001. return actionResult;
  7002. }
  7003. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7004. {
  7005. ActionResult actionResult = new ActionResult();
  7006. try
  7007. {
  7008. // 验证请求头信息
  7009. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7010. // 验证失败
  7011. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7012. {
  7013. return actionResult;
  7014. }
  7015. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7016. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7017. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7018. if (Convert.ToInt32(resultEntity.Result) < 0)
  7019. {
  7020. actionResult.Status = (int)Constant.PDAResult.Fail;
  7021. }
  7022. else
  7023. {
  7024. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7025. actionResult.Status = (int)Constant.PDAResult.Success;
  7026. }
  7027. actionResult.Message = resultEntity.Message;
  7028. }
  7029. catch (Exception ex)
  7030. {
  7031. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7032. OutputLog.TraceLog(LogPriority.Error,
  7033. this.ToString(),
  7034. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7035. ex.ToString(),
  7036. LocalPath.LogExePath);
  7037. actionResult.Status = (int)Constant.PDAResult.Exception;
  7038. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7039. }
  7040. return actionResult;
  7041. }
  7042. public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7043. {
  7044. ActionResult actionResult = new ActionResult();
  7045. try
  7046. {
  7047. // 验证请求头信息
  7048. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7049. // 验证失败
  7050. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7051. {
  7052. return actionResult;
  7053. }
  7054. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7055. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7056. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7057. if (Convert.ToInt32(resultEntity.Result) < 0)
  7058. {
  7059. actionResult.Status = (int)Constant.PDAResult.Fail;
  7060. }
  7061. else
  7062. {
  7063. actionResult.Status = (int)Constant.PDAResult.Success;
  7064. }
  7065. actionResult.Message = resultEntity.Message;
  7066. }
  7067. catch (Exception ex)
  7068. {
  7069. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7070. OutputLog.TraceLog(LogPriority.Error,
  7071. this.ToString(),
  7072. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7073. ex.ToString(),
  7074. LocalPath.LogExePath);
  7075. actionResult.Status = (int)Constant.PDAResult.Exception;
  7076. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7077. }
  7078. return actionResult;
  7079. }
  7080. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7081. {
  7082. ActionResult actionResult = new ActionResult();
  7083. try
  7084. {
  7085. // 验证请求头信息
  7086. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7087. // 验证失败
  7088. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7089. {
  7090. return actionResult;
  7091. }
  7092. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7093. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7094. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7095. if (Convert.ToInt32(resultEntity.Result) < 0)
  7096. {
  7097. actionResult.Status = (int)Constant.PDAResult.Fail;
  7098. }
  7099. else
  7100. {
  7101. actionResult.Status = (int)Constant.PDAResult.Success;
  7102. }
  7103. actionResult.Message = resultEntity.Message;
  7104. }
  7105. catch (Exception ex)
  7106. {
  7107. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7108. OutputLog.TraceLog(LogPriority.Error,
  7109. this.ToString(),
  7110. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7111. ex.ToString(),
  7112. LocalPath.LogExePath);
  7113. actionResult.Status = (int)Constant.PDAResult.Exception;
  7114. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7115. }
  7116. return actionResult;
  7117. }
  7118. #region PDA条码打印
  7119. /// <summary>
  7120. /// 获取条码打印机
  7121. /// </summary>
  7122. /// <param name="accountCode"></param>
  7123. /// <param name="userCode"></param>
  7124. /// <param name="userPassword"></param>
  7125. /// <param name="sessionKey"></param>
  7126. /// <returns></returns>
  7127. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey)
  7128. {
  7129. ActionResult actionResult = new ActionResult();
  7130. try
  7131. {
  7132. // 验证请求头信息
  7133. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7134. // 验证失败
  7135. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7136. {
  7137. return actionResult;
  7138. }
  7139. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo);
  7140. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7141. actionResult.Status = (int)Constant.PDAResult.Success;
  7142. }
  7143. catch (Exception ex)
  7144. {
  7145. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7146. OutputLog.TraceLog(LogPriority.Error,
  7147. this.ToString(),
  7148. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7149. ex.ToString(),
  7150. LocalPath.LogExePath);
  7151. actionResult.Status = (int)Constant.PDAResult.Exception;
  7152. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7153. }
  7154. return actionResult;
  7155. }
  7156. /// <summary>
  7157. /// 打印条码样式
  7158. /// </summary>
  7159. /// <param name="accountCode"></param>
  7160. /// <param name="userCode"></param>
  7161. /// <param name="userPassword"></param>
  7162. /// <param name="sessionKey"></param>
  7163. /// <returns></returns>
  7164. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey
  7165. , string barcode, int copies, int printerID)
  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. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7178. copies, printerID, sUserInfo);
  7179. if (sre.Status != Constant.ServiceResultStatus.Success)
  7180. {
  7181. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7182. actionResult.Message = sre.Message;
  7183. return actionResult;
  7184. }
  7185. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7186. actionResult.Status = (int)Constant.PDAResult.Success;
  7187. }
  7188. catch (Exception ex)
  7189. {
  7190. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7191. OutputLog.TraceLog(LogPriority.Error,
  7192. this.ToString(),
  7193. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7194. ex.ToString(),
  7195. LocalPath.LogExePath);
  7196. actionResult.Status = (int)Constant.PDAResult.Exception;
  7197. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7198. }
  7199. return actionResult;
  7200. }
  7201. #endregion PDA条码打印
  7202. #region 统计报表
  7203. /// <summary>
  7204. /// 成型结算报表
  7205. /// </summary>
  7206. /// <param name="accountCode"></param>
  7207. /// <param name="userCode"></param>
  7208. /// <param name="userPassword"></param>
  7209. /// <param name="sessionKey"></param>
  7210. /// <returns></returns>
  7211. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7212. int currentMonth)
  7213. {
  7214. ActionResult actionResult = new ActionResult();
  7215. try
  7216. {
  7217. // 验证请求头信息
  7218. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7219. // 验证失败
  7220. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7221. {
  7222. return actionResult;
  7223. }
  7224. DateTime date = DateTime.Now;
  7225. if (currentMonth != 1)
  7226. {
  7227. date = date.AddMonths(-1);
  7228. }
  7229. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7230. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7231. if (resultEntity == null || resultEntity.Data == null)
  7232. {
  7233. actionResult.Status = (int)Constant.PDAResult.Fail;
  7234. actionResult.Message = "查询失败";
  7235. return actionResult;
  7236. }
  7237. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7238. {
  7239. actionResult.Status = (int)Constant.PDAResult.Fail;
  7240. actionResult.Message = resultEntity.Message;
  7241. return actionResult;
  7242. }
  7243. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7244. actionResult.Status = (int)Constant.PDAResult.Success;
  7245. }
  7246. catch (Exception ex)
  7247. {
  7248. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7249. OutputLog.TraceLog(LogPriority.Error,
  7250. this.ToString(),
  7251. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7252. ex.ToString(),
  7253. LocalPath.LogExePath);
  7254. actionResult.Status = (int)Constant.PDAResult.Exception;
  7255. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7256. }
  7257. return actionResult;
  7258. }
  7259. #endregion
  7260. #region 设置当期用户默认打印机配置
  7261. /// <summary>
  7262. /// 设置当期用户默认打印机配置
  7263. /// </summary>
  7264. /// <param name="accountCode"></param>
  7265. /// <param name="userCode"></param>
  7266. /// <param name="userPassword"></param>
  7267. /// <param name="sessionKey"></param>
  7268. /// <param name="printerID"></param>
  7269. /// <returns></returns>
  7270. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7271. int printerID)
  7272. {
  7273. ActionResult actionResult = new ActionResult();
  7274. try
  7275. {
  7276. // 验证请求头信息
  7277. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7278. // 验证失败
  7279. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7280. {
  7281. return actionResult;
  7282. }
  7283. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7284. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7285. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7286. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7287. {
  7288. actionResult.Status = (int)Constant.PDAResult.Fail;
  7289. }
  7290. else
  7291. {
  7292. actionResult.Status = (int)Constant.PDAResult.Success;
  7293. }
  7294. actionResult.Message = resultEntity.Message;
  7295. }
  7296. catch (Exception ex)
  7297. {
  7298. OutputLog.TraceLog(LogPriority.Error,
  7299. this.ToString(),
  7300. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7301. ex.ToString(),
  7302. LocalPath.LogExePath);
  7303. actionResult.Status = (int)Constant.PDAResult.Exception;
  7304. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7305. }
  7306. return actionResult;
  7307. }
  7308. /// <summary>
  7309. /// 校验产品条码是否可以进行回收
  7310. /// </summary>
  7311. /// <param name="accountCode">帐套code</param>
  7312. /// <param name="userCode">用户code</param>
  7313. /// <param name="userPassword">用户密码</param>
  7314. /// <param name="sessionKey">本次登陆密钥</param>
  7315. /// <param name="procedureID">工序ID</param>
  7316. /// <param name="barcode">条码</param>
  7317. /// <returns></returns>
  7318. /// <remarks>
  7319. /// 王鑫 2017.7.21 新建
  7320. /// </remarks>
  7321. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7322. {
  7323. ActionResult actionResult = new ActionResult();
  7324. try
  7325. {
  7326. // 验证请求头信息
  7327. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7328. // 验证失败
  7329. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7330. {
  7331. return actionResult;
  7332. }
  7333. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7334. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7335. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7336. {
  7337. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7338. actionResult.Status = (int)Constant.PDAResult.Success;
  7339. }
  7340. else
  7341. {
  7342. actionResult.Status = (int)Constant.PDAResult.Fail;
  7343. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7344. }
  7345. }
  7346. catch (Exception ex)
  7347. {
  7348. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7349. OutputLog.TraceLog(LogPriority.Error,
  7350. this.ToString(),
  7351. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7352. ex.ToString(),
  7353. LocalPath.LogExePath);
  7354. actionResult.Status = (int)Constant.PDAResult.Exception;
  7355. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7356. }
  7357. return actionResult;
  7358. }
  7359. /// <summary>
  7360. /// 获取回收标识
  7361. /// </summary>
  7362. /// <param name="accountCode"></param>
  7363. /// <param name="userCode"></param>
  7364. /// <param name="userPassword"></param>
  7365. /// <param name="sessionKey"></param>
  7366. /// <param name="usercode">工号编码</param>
  7367. /// <returns></returns>
  7368. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7369. {
  7370. ActionResult actionResult = new ActionResult();
  7371. try
  7372. {
  7373. // 验证请求头信息
  7374. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7375. // 验证失败
  7376. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7377. {
  7378. return actionResult;
  7379. }
  7380. int returnValue = ServiceInvoker.Invoke<int>(this,
  7381. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7382. actionResult.Result = JsonHelper.ToJson(returnValue);
  7383. actionResult.Status = (int)Constant.PDAResult.Success;
  7384. }
  7385. catch (Exception ex)
  7386. {
  7387. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7388. OutputLog.TraceLog(LogPriority.Error,
  7389. this.ToString(),
  7390. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7391. ex.ToString(),
  7392. LocalPath.LogExePath);
  7393. actionResult.Status = (int)Constant.PDAResult.Exception;
  7394. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7395. }
  7396. return actionResult;
  7397. }
  7398. #endregion
  7399. #region 注浆盘点
  7400. /// <summary>
  7401. /// 获取注浆盘点单列表
  7402. /// </summary>
  7403. /// <param name="sUserInfo"></param>
  7404. /// <returns></returns>
  7405. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7406. {
  7407. ActionResult actionResult = new ActionResult();
  7408. try
  7409. {
  7410. // 验证请求头信息
  7411. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7412. // 验证失败
  7413. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7414. {
  7415. return actionResult;
  7416. }
  7417. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7418. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7419. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7420. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7421. actionResult.Result = JsonHelper.ToJson(ds);
  7422. actionResult.Status = (int)Constant.PDAResult.Success;
  7423. }
  7424. catch (Exception ex)
  7425. {
  7426. string json = JsonHelper.ToJson(entity);
  7427. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7428. OutputLog.TraceLog(LogPriority.Error,
  7429. this.ToString(),
  7430. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7431. ex.ToString(),
  7432. LocalPath.LogExePath);
  7433. actionResult.Status = (int)Constant.PDAResult.Exception;
  7434. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7435. }
  7436. return actionResult;
  7437. }
  7438. /// <summary>
  7439. /// 进行盘点操作
  7440. /// </summary>
  7441. /// <param name="accountCode"></param>
  7442. /// <param name="userCode"></param>
  7443. /// <param name="userPassword"></param>
  7444. /// <param name="sessionKey"></param>
  7445. /// <param name="InCheckedID">盘点单ID</param>
  7446. /// <param name="BarCode">产品条码</param>
  7447. /// <returns></returns>
  7448. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7449. {
  7450. ActionResult actionResult = new ActionResult();
  7451. try
  7452. {
  7453. // 验证请求头信息
  7454. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7455. // 验证失败
  7456. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7457. {
  7458. return actionResult;
  7459. }
  7460. ClientRequestEntity cre = new ClientRequestEntity();
  7461. cre.Properties["CheckedID"] = CheckedID;
  7462. cre.Properties["Barcode"] = BarCode;
  7463. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7464. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7465. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7466. {
  7467. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7468. actionResult.Status = (int)Constant.PDAResult.Success;
  7469. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7470. }
  7471. else
  7472. {
  7473. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7474. actionResult.Status = (int)Constant.PDAResult.Fail;
  7475. actionResult.Message = returnValue.Message;
  7476. }
  7477. }
  7478. catch (Exception ex)
  7479. {
  7480. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7481. OutputLog.TraceLog(LogPriority.Error,
  7482. this.ToString(),
  7483. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7484. ex.ToString(),
  7485. LocalPath.LogExePath);
  7486. actionResult.Status = (int)Constant.PDAResult.Exception;
  7487. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7488. }
  7489. return actionResult;
  7490. }
  7491. /// <summary>
  7492. /// 获取盘点单明细
  7493. /// </summary>
  7494. /// <param name="sUserInfo"></param>
  7495. /// <returns></returns>
  7496. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  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 ds = ServiceInvoker.Invoke<DataSet>(this,
  7509. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  7510. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  7511. actionResult.Result = JsonHelper.ToJson(ds);
  7512. actionResult.Status = (int)Constant.PDAResult.Success;
  7513. }
  7514. catch (Exception ex)
  7515. {
  7516. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7517. OutputLog.TraceLog(LogPriority.Error,
  7518. this.ToString(),
  7519. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7520. ex.ToString(),
  7521. LocalPath.LogExePath);
  7522. actionResult.Status = (int)Constant.PDAResult.Exception;
  7523. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7524. }
  7525. return actionResult;
  7526. }
  7527. #endregion
  7528. #region 模具盘点
  7529. /// <summary>
  7530. /// 获取模具盘点单列表
  7531. /// </summary>
  7532. /// <param name="sUserInfo"></param>
  7533. /// <returns></returns>
  7534. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7535. {
  7536. ActionResult actionResult = new ActionResult();
  7537. try
  7538. {
  7539. // 验证请求头信息
  7540. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7541. // 验证失败
  7542. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7543. {
  7544. return actionResult;
  7545. }
  7546. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7547. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7548. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7549. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  7550. actionResult.Result = JsonHelper.ToJson(ds);
  7551. actionResult.Status = (int)Constant.PDAResult.Success;
  7552. }
  7553. catch (Exception ex)
  7554. {
  7555. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7556. OutputLog.TraceLog(LogPriority.Error,
  7557. this.ToString(),
  7558. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7559. ex.ToString(),
  7560. LocalPath.LogExePath);
  7561. actionResult.Status = (int)Constant.PDAResult.Exception;
  7562. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7563. }
  7564. return actionResult;
  7565. }
  7566. /// <summary>
  7567. /// 进行盘点操作
  7568. /// </summary>
  7569. /// <param name="accountCode"></param>
  7570. /// <param name="userCode"></param>
  7571. /// <param name="userPassword"></param>
  7572. /// <param name="sessionKey"></param>
  7573. /// <param name="InCheckedID">盘点单ID</param>
  7574. /// <param name="BarCode">产品条码</param>
  7575. /// <returns></returns>
  7576. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7577. {
  7578. ActionResult actionResult = new ActionResult();
  7579. try
  7580. {
  7581. // 验证请求头信息
  7582. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7583. // 验证失败
  7584. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7585. {
  7586. return actionResult;
  7587. }
  7588. ClientRequestEntity cre = new ClientRequestEntity();
  7589. cre.Properties["CheckedID"] = CheckedID;
  7590. cre.Properties["Barcode"] = BarCode;
  7591. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7592. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  7593. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7594. {
  7595. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7596. actionResult.Status = (int)Constant.PDAResult.Success;
  7597. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7598. }
  7599. else
  7600. {
  7601. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7602. actionResult.Status = (int)Constant.PDAResult.Fail;
  7603. actionResult.Message = returnValue.Message;
  7604. }
  7605. }
  7606. catch (Exception ex)
  7607. {
  7608. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7609. OutputLog.TraceLog(LogPriority.Error,
  7610. this.ToString(),
  7611. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7612. ex.ToString(),
  7613. LocalPath.LogExePath);
  7614. actionResult.Status = (int)Constant.PDAResult.Exception;
  7615. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7616. }
  7617. return actionResult;
  7618. }
  7619. /// <summary>
  7620. /// 获取盘点单明细
  7621. /// </summary>
  7622. /// <param name="sUserInfo"></param>
  7623. /// <returns></returns>
  7624. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7625. {
  7626. ActionResult actionResult = new ActionResult();
  7627. try
  7628. {
  7629. // 验证请求头信息
  7630. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7631. // 验证失败
  7632. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7633. {
  7634. return actionResult;
  7635. }
  7636. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7637. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  7638. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  7639. actionResult.Result = JsonHelper.ToJson(ds);
  7640. actionResult.Status = (int)Constant.PDAResult.Success;
  7641. }
  7642. catch (Exception ex)
  7643. {
  7644. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7645. OutputLog.TraceLog(LogPriority.Error,
  7646. this.ToString(),
  7647. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7648. ex.ToString(),
  7649. LocalPath.LogExePath);
  7650. actionResult.Status = (int)Constant.PDAResult.Exception;
  7651. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7652. }
  7653. return actionResult;
  7654. }
  7655. #endregion
  7656. #region 通用接口
  7657. /// <summary>
  7658. /// PDA调用通用接口
  7659. /// </summary>
  7660. /// <param name="accountCode"></param>
  7661. /// <param name="userCode"></param>
  7662. /// <param name="userPassword"></param>
  7663. /// <param name="sessionKey"></param>
  7664. /// <param name="module"></param>
  7665. /// <param name="action"></param>
  7666. /// <param name="data"></param>
  7667. /// <returns></returns>
  7668. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  7669. string module, string action, string jsonData)
  7670. {
  7671. ActionResult actionResult = null;
  7672. try
  7673. {
  7674. // 验证请求头信息
  7675. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7676. // 验证失败
  7677. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7678. {
  7679. return actionResult;
  7680. }
  7681. actionResult.Status = (int)Constant.PDAResult.Fail;
  7682. Dictionary<string, object> data = null;
  7683. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  7684. {
  7685. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  7686. }
  7687. #region PDA报表
  7688. if (module == "Report")
  7689. {
  7690. // 成型月度结算
  7691. if (action == "GetGroutingSettlementInfo")
  7692. {
  7693. DateTime month = DateTime.Now;
  7694. month = new DateTime(month.Year, month.Month, 1);
  7695. //month = new DateTime(2017, 6, 1);
  7696. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7697. if (currentMonth != 1)
  7698. {
  7699. month = month.AddMonths(-1);
  7700. }
  7701. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  7702. if (sre.Status == Constant.ServiceResultStatus.Success)
  7703. {
  7704. actionResult.Status = (int)Constant.PDAResult.Success;
  7705. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7706. }
  7707. else
  7708. {
  7709. actionResult.Status = (int)Constant.PDAResult.Fail;
  7710. actionResult.Message = sre.Message;
  7711. }
  7712. return actionResult;
  7713. }
  7714. // 成型月度结算-明细
  7715. if (action == "GetGroutingSettlementDetail")
  7716. {
  7717. DateTime month = DateTime.Now;
  7718. month = new DateTime(month.Year, month.Month, 1);
  7719. //month = new DateTime(2017, 6, 1);
  7720. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7721. if (currentMonth != 1)
  7722. {
  7723. month = month.AddMonths(-1);
  7724. }
  7725. string goodsCode = data["GoodsCode"].ToString();
  7726. string detailDate = data["DetailDate"].ToString();
  7727. DateTime? date = null;
  7728. if (detailDate != "合计")
  7729. {
  7730. date = DateTime.Parse(detailDate);
  7731. }
  7732. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  7733. if (sre.Status == Constant.ServiceResultStatus.Success)
  7734. {
  7735. actionResult.Status = (int)Constant.PDAResult.Success;
  7736. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7737. }
  7738. else
  7739. {
  7740. actionResult.Status = (int)Constant.PDAResult.Fail;
  7741. actionResult.Message = sre.Message;
  7742. }
  7743. return actionResult;
  7744. }
  7745. // 产成品交接汇总
  7746. if (action == "GetFinishedProductHandoverSum")
  7747. {
  7748. DateTime date = DateTime.Parse(data["date"].ToString());
  7749. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  7750. data["goodscode"] as string, sUserInfo);
  7751. if (sre.Status == Constant.ServiceResultStatus.Success)
  7752. {
  7753. actionResult.Status = (int)Constant.PDAResult.Success;
  7754. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7755. }
  7756. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  7757. {
  7758. actionResult.Status = (int)Constant.PDAResult.Success;
  7759. }
  7760. else
  7761. {
  7762. actionResult.Status = (int)Constant.PDAResult.Fail;
  7763. actionResult.Message = sre.Message;
  7764. }
  7765. return actionResult;
  7766. }
  7767. //xuwei add 2019-10-21
  7768. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  7769. if (action == "GetSemiReworkDayCount")
  7770. {
  7771. //不指定参数查询当天
  7772. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  7773. //dateStr = "2019-10-17";
  7774. //指定参数查询特定日期
  7775. if(data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  7776. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  7777. if (sre.Status == Constant.ServiceResultStatus.Success)
  7778. {
  7779. actionResult.Status = (int)Constant.PDAResult.Success;
  7780. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7781. }
  7782. else
  7783. {
  7784. actionResult.Status = (int)Constant.PDAResult.Fail;
  7785. actionResult.Message = sre.Message;
  7786. }
  7787. return actionResult;
  7788. }
  7789. //xuwe end
  7790. return actionResult;
  7791. }
  7792. #endregion
  7793. #region 模具管理
  7794. if (module == "PC_Mould")
  7795. {
  7796. #region 模具新建画面数据初始化
  7797. if (action == "GetMouldAddInit")
  7798. {
  7799. ClientRequestEntity cre = new ClientRequestEntity();
  7800. cre.Properties["MouldID"] = 0;
  7801. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  7802. if (sre.Status == Constant.ServiceResultStatus.Success)
  7803. {
  7804. actionResult.Status = (int)Constant.PDAResult.Success;
  7805. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7806. }
  7807. else
  7808. {
  7809. actionResult.Status = (int)Constant.PDAResult.Fail;
  7810. actionResult.Message = sre.Message;
  7811. }
  7812. return actionResult;
  7813. }
  7814. #endregion
  7815. #region 验证模具产品型号
  7816. if (action == "CheckGoodsCodeOnMould")
  7817. {
  7818. ClientRequestEntity cre = new ClientRequestEntity();
  7819. cre.Properties["GoodsCode"] = data["GoodsCode"];
  7820. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  7821. if (sre.Status == Constant.ServiceResultStatus.Success &&
  7822. sre.Data.Tables[0].Rows.Count > 0)
  7823. {
  7824. actionResult.Status = (int)Constant.PDAResult.Success;
  7825. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7826. }
  7827. else
  7828. {
  7829. actionResult.Status = (int)Constant.PDAResult.Fail;
  7830. actionResult.Message = "无效产品型号";
  7831. }
  7832. return actionResult;
  7833. }
  7834. #endregion
  7835. #region 验证模具生产工号
  7836. if (action == "CheckUserCodeOnMould")
  7837. {
  7838. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  7839. if (sre != null && sre.Rows.Count > 0)
  7840. {
  7841. actionResult.Status = (int)Constant.PDAResult.Success;
  7842. actionResult.Result = JsonHelper.ToJson(sre);
  7843. }
  7844. else
  7845. {
  7846. actionResult.Status = (int)Constant.PDAResult.Fail;
  7847. actionResult.Message = "无效生产工号";
  7848. }
  7849. return actionResult;
  7850. }
  7851. #endregion
  7852. #region 新建保存
  7853. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  7854. {
  7855. ClientRequestEntity cre = new ClientRequestEntity();
  7856. foreach (string item in data.Keys)
  7857. {
  7858. if (item == "ProductionDate")
  7859. {
  7860. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  7861. }
  7862. else
  7863. {
  7864. cre.Properties.Add(item, data[item]);
  7865. }
  7866. }
  7867. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  7868. if (sre.Status == Constant.ServiceResultStatus.Success)
  7869. {
  7870. actionResult.Status = (int)Constant.PDAResult.Success;
  7871. }
  7872. else
  7873. {
  7874. actionResult.Status = (int)Constant.PDAResult.Fail;
  7875. actionResult.Result = sre.OtherStatus;
  7876. actionResult.Message = sre.Message;
  7877. }
  7878. return actionResult;
  7879. }
  7880. #endregion
  7881. #region 模具编辑画面数据初始化
  7882. if (action == "GetMouldEditInfo")
  7883. {
  7884. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  7885. if (sre != null && sre.Rows.Count > 0)
  7886. {
  7887. actionResult.Status = (int)Constant.PDAResult.Success;
  7888. actionResult.Result = JsonHelper.ToJson(sre);
  7889. }
  7890. else
  7891. {
  7892. actionResult.Status = (int)Constant.PDAResult.Fail;
  7893. actionResult.Message = "无效模具条码";
  7894. }
  7895. return actionResult;
  7896. }
  7897. #endregion
  7898. #region 模具操作-画面初始化
  7899. if (action == "GetMouldOperationInit")
  7900. {
  7901. ClientRequestEntity cre = new ClientRequestEntity();
  7902. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  7903. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  7904. if (sre.Status == Constant.ServiceResultStatus.Success)
  7905. {
  7906. actionResult.Status = (int)Constant.PDAResult.Success;
  7907. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7908. }
  7909. else
  7910. {
  7911. actionResult.Status = (int)Constant.PDAResult.Fail;
  7912. actionResult.Result = sre.OtherStatus;
  7913. actionResult.Message = sre.Message;
  7914. }
  7915. return actionResult;
  7916. }
  7917. #endregion
  7918. #region 模具操作-验证模具条码
  7919. if (action == "CheckMouldBarcode")
  7920. {
  7921. ClientRequestEntity cre = new ClientRequestEntity();
  7922. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  7923. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  7924. if (sre.Status == Constant.ServiceResultStatus.Success)
  7925. {
  7926. if (sre.Data.Tables[0].Rows.Count == 0)
  7927. {
  7928. actionResult.Status = (int)Constant.PDAResult.Fail;
  7929. actionResult.Result = -1;
  7930. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  7931. return actionResult;
  7932. }
  7933. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  7934. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  7935. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  7936. #region 报损
  7937. if (mouldOperationType == 2)
  7938. {
  7939. if (mouldStatusID == 1 || mouldStatusID == 3)
  7940. {
  7941. actionResult.Status = (int)Constant.PDAResult.Success;
  7942. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7943. }
  7944. else
  7945. {
  7946. actionResult.Status = (int)Constant.PDAResult.Fail;
  7947. actionResult.Result = -2;
  7948. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  7949. }
  7950. return actionResult;
  7951. }
  7952. #endregion
  7953. #region 撤销
  7954. if (mouldOperationType == 3)
  7955. {
  7956. if (mouldStatusID == 4)
  7957. {
  7958. actionResult.Status = (int)Constant.PDAResult.Success;
  7959. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7960. }
  7961. else
  7962. {
  7963. actionResult.Status = (int)Constant.PDAResult.Fail;
  7964. actionResult.Result = -2;
  7965. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  7966. }
  7967. return actionResult;
  7968. }
  7969. #endregion
  7970. #region 领用
  7971. if (mouldOperationType == 4)
  7972. {
  7973. if (mouldStatusID == 1)
  7974. {
  7975. actionResult.Status = (int)Constant.PDAResult.Success;
  7976. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7977. }
  7978. else
  7979. {
  7980. actionResult.Status = (int)Constant.PDAResult.Fail;
  7981. actionResult.Result = -2;
  7982. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  7983. }
  7984. return actionResult;
  7985. }
  7986. #endregion
  7987. #region 回收
  7988. if (mouldOperationType == 5)
  7989. {
  7990. if (mouldStatusID == 3)
  7991. {
  7992. actionResult.Status = (int)Constant.PDAResult.Success;
  7993. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7994. }
  7995. else
  7996. {
  7997. actionResult.Status = (int)Constant.PDAResult.Fail;
  7998. actionResult.Result = -2;
  7999. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  8000. }
  8001. return actionResult;
  8002. }
  8003. #endregion
  8004. #region 变更型号
  8005. if (mouldOperationType == -1)
  8006. {
  8007. if (mouldStatusID != 4)
  8008. {
  8009. actionResult.Status = (int)Constant.PDAResult.Success;
  8010. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8011. }
  8012. else
  8013. {
  8014. actionResult.Status = (int)Constant.PDAResult.Fail;
  8015. actionResult.Result = -2;
  8016. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  8017. }
  8018. return actionResult;
  8019. }
  8020. #endregion
  8021. #region 替换条码
  8022. if (mouldOperationType == -2)
  8023. {
  8024. actionResult.Status = (int)Constant.PDAResult.Success;
  8025. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8026. return actionResult;
  8027. }
  8028. #endregion
  8029. return actionResult;
  8030. }
  8031. }
  8032. #endregion
  8033. #region 模具操作-保存
  8034. if (action == "SetMouldOperation")
  8035. {
  8036. ClientRequestEntity cre = new ClientRequestEntity();
  8037. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8038. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8039. cre.Properties["Remarks"] = data["Remarks"];
  8040. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8041. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8042. {
  8043. cre.Properties["GoodsID"] = data["GoodsID"];
  8044. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8045. }
  8046. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8047. {
  8048. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8049. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8050. }
  8051. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8052. if (sre.Status == Constant.ServiceResultStatus.Success)
  8053. {
  8054. actionResult.Status = (int)Constant.PDAResult.Success;
  8055. }
  8056. else
  8057. {
  8058. actionResult.Status = (int)Constant.PDAResult.Fail;
  8059. }
  8060. return actionResult;
  8061. }
  8062. #endregion
  8063. #region 模具操作-替换条码
  8064. if (action == "ChangedMouldBarcode")
  8065. {
  8066. ClientRequestEntity cre = new ClientRequestEntity();
  8067. cre.Properties["MouldID"] = data["MouldID"];
  8068. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8069. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8070. cre.Properties["Remarks"] = data["Remarks"];
  8071. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8072. if (sre.Status == Constant.ServiceResultStatus.Success)
  8073. {
  8074. actionResult.Status = (int)Constant.PDAResult.Success;
  8075. }
  8076. else
  8077. {
  8078. actionResult.Status = (int)Constant.PDAResult.Fail;
  8079. actionResult.Result = sre.OtherStatus;
  8080. actionResult.Message = sre.Message;
  8081. }
  8082. return actionResult;
  8083. }
  8084. #endregion
  8085. #region 模具跟踪表
  8086. if (action == "GetMoldTracking")
  8087. {
  8088. ClientRequestEntity cre = new ClientRequestEntity();
  8089. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8090. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8091. if (sre.Status == Constant.ServiceResultStatus.Success)
  8092. {
  8093. actionResult.Status = (int)Constant.PDAResult.Success;
  8094. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8095. }
  8096. else
  8097. {
  8098. actionResult.Status = (int)Constant.PDAResult.Fail;
  8099. actionResult.Message = "此模具条码不存在";
  8100. }
  8101. return actionResult;
  8102. }
  8103. #endregion
  8104. return actionResult;
  8105. }
  8106. #endregion
  8107. #region 成型线模具管理
  8108. if (module == "PC_GroutingLineMould")
  8109. {
  8110. #region 获取当前用户成型线模具管理权限
  8111. if (action == "GetGMouldStatusRight")
  8112. {
  8113. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8114. actionResult.Status = (int)Constant.PDAResult.Success;
  8115. if (right != null && right.Rows.Count > 0)
  8116. {
  8117. actionResult.Result = JsonHelper.ToJson(right);
  8118. }
  8119. return actionResult;
  8120. }
  8121. #endregion
  8122. #region 获取成型线状态等信息,和成型模具信息
  8123. if (action == "GetGroutingLineMould")
  8124. {
  8125. int? groutingLineID = null;
  8126. string groutingLineCode = null;
  8127. if (data.ContainsKey("GroutingLineID"))
  8128. {
  8129. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8130. }
  8131. else
  8132. {
  8133. groutingLineCode = data["GroutingLineCode"] + "";
  8134. }
  8135. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8136. if (lineInfo == null)
  8137. {
  8138. actionResult.Status = (int)Constant.PDAResult.Fail;
  8139. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8140. }
  8141. else
  8142. {
  8143. actionResult.Status = (int)Constant.PDAResult.Success;
  8144. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8145. }
  8146. return actionResult;
  8147. }
  8148. #endregion
  8149. #region 模具操作-画面初始化
  8150. if (action == "GetMouldOperationInit")
  8151. {
  8152. ClientRequestEntity cre = new ClientRequestEntity();
  8153. cre.Properties["MouldOperationType"] = 2;
  8154. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8155. if (sre.Status == Constant.ServiceResultStatus.Success)
  8156. {
  8157. actionResult.Status = (int)Constant.PDAResult.Success;
  8158. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8159. }
  8160. else
  8161. {
  8162. actionResult.Status = (int)Constant.PDAResult.Fail;
  8163. actionResult.Result = sre.OtherStatus;
  8164. actionResult.Message = sre.Message;
  8165. }
  8166. return actionResult;
  8167. }
  8168. #endregion
  8169. #region 成型模具操作-画面初始化
  8170. if (action == "GetGroutingMouldOperationInit")
  8171. {
  8172. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8173. if (initData != null && initData.Rows.Count > 0)
  8174. {
  8175. actionResult.Status = (int)Constant.PDAResult.Success;
  8176. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8177. foreach (DataRow item in initData.Rows)
  8178. {
  8179. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8180. }
  8181. actionResult.Result = JsonHelper.ToJson(syssetting);
  8182. }
  8183. else
  8184. {
  8185. actionResult.Status = (int)Constant.PDAResult.Fail;
  8186. }
  8187. return actionResult;
  8188. }
  8189. #endregion
  8190. #region 模具操作-验证模具条码
  8191. if (action == "CheckMouldBarcode")
  8192. {
  8193. ClientRequestEntity cre = new ClientRequestEntity();
  8194. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8195. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8196. if (sre.Status == Constant.ServiceResultStatus.Success)
  8197. {
  8198. if (sre.Data.Tables[0].Rows.Count == 0)
  8199. {
  8200. actionResult.Status = (int)Constant.PDAResult.Fail;
  8201. actionResult.Result = -1;
  8202. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8203. return actionResult;
  8204. }
  8205. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8206. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8207. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8208. #region 上线
  8209. if (mouldOperationType == 6)
  8210. {
  8211. if (mouldStatusID == 1 || mouldStatusID == 3)
  8212. {
  8213. if (data.ContainsKey("GoodsID"))
  8214. {
  8215. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8216. {
  8217. actionResult.Status = (int)Constant.PDAResult.Fail;
  8218. actionResult.Result = -3;
  8219. actionResult.Message =
  8220. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8221. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8222. "】与当前不一致";
  8223. return actionResult;
  8224. }
  8225. }
  8226. actionResult.Status = (int)Constant.PDAResult.Success;
  8227. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8228. }
  8229. else
  8230. {
  8231. actionResult.Status = (int)Constant.PDAResult.Fail;
  8232. actionResult.Result = -2;
  8233. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8234. }
  8235. return actionResult;
  8236. }
  8237. #endregion
  8238. return actionResult;
  8239. }
  8240. }
  8241. #endregion
  8242. #region 停用
  8243. if (action == "StopGroutingLineDetail")
  8244. {
  8245. if (data == null || !data.ContainsKey("Details"))
  8246. {
  8247. actionResult.Status = (int)Constant.PDAResult.Fail;
  8248. actionResult.Message = "参数错误";
  8249. return actionResult;
  8250. }
  8251. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8252. DataTable gTable = new DataTable();
  8253. gTable.Columns.Add("GroutingLineID", typeof(int));
  8254. gTable.Columns.Add("GroutingLineCode");
  8255. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8256. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8257. gTable.Columns.Add("GroutingMouldCode");
  8258. gTable.Columns.Add("RecordRemarks");
  8259. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8260. gTable.Columns.Add("MouldID", typeof(int));
  8261. gTable.Columns.Add("MouldCode");
  8262. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8263. string groutingLineCode = data["GroutingLineCode"] + "";
  8264. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8265. foreach (Dictionary<string, object> item in details)
  8266. {
  8267. int? mouldID = null;
  8268. if (item.ContainsKey("MouldID"))
  8269. {
  8270. mouldID = Convert.ToInt32(item["MouldID"]);
  8271. if (mouldID == 0)
  8272. {
  8273. mouldID = null;
  8274. }
  8275. }
  8276. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8277. item["GLineDetailID"], item["GLineDetailCode"],
  8278. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8279. mouldID, item["MouldCode"]);
  8280. }
  8281. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8282. if (result > 0)
  8283. {
  8284. actionResult.Status = (int)Constant.PDAResult.Success;
  8285. }
  8286. else
  8287. {
  8288. actionResult.Status = (int)Constant.PDAResult.Fail;
  8289. actionResult.Result = result;
  8290. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8291. return actionResult;
  8292. }
  8293. return actionResult;
  8294. }
  8295. #endregion
  8296. #region 启用
  8297. if (action == "StartGroutingLineDetail")
  8298. {
  8299. if (data == null || !data.ContainsKey("Details"))
  8300. {
  8301. actionResult.Status = (int)Constant.PDAResult.Fail;
  8302. actionResult.Message = "参数错误";
  8303. return actionResult;
  8304. }
  8305. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8306. DataTable gTable = new DataTable();
  8307. gTable.Columns.Add("GroutingLineID", typeof(int));
  8308. gTable.Columns.Add("GroutingLineCode");
  8309. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8310. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8311. gTable.Columns.Add("GroutingMouldCode");
  8312. gTable.Columns.Add("RecordRemarks");
  8313. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8314. gTable.Columns.Add("MouldID", typeof(int));
  8315. gTable.Columns.Add("MouldCode");
  8316. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8317. string groutingLineCode = data["GroutingLineCode"] + "";
  8318. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8319. foreach (Dictionary<string, object> item in details)
  8320. {
  8321. int? mouldID = null;
  8322. if (item.ContainsKey("MouldID"))
  8323. {
  8324. mouldID = Convert.ToInt32(item["MouldID"]);
  8325. if (mouldID == 0)
  8326. {
  8327. mouldID = null;
  8328. }
  8329. }
  8330. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8331. item["GLineDetailID"], item["GLineDetailCode"],
  8332. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8333. mouldID, item["MouldCode"]);
  8334. }
  8335. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8336. if (result > 0)
  8337. {
  8338. actionResult.Status = (int)Constant.PDAResult.Success;
  8339. }
  8340. else
  8341. {
  8342. actionResult.Status = (int)Constant.PDAResult.Fail;
  8343. actionResult.Result = result;
  8344. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8345. return actionResult;
  8346. }
  8347. return actionResult;
  8348. }
  8349. #endregion
  8350. #region 维修
  8351. if (action == "RepairStartGroutingLineDetail")
  8352. {
  8353. if (data == null || !data.ContainsKey("Details"))
  8354. {
  8355. actionResult.Status = (int)Constant.PDAResult.Fail;
  8356. actionResult.Message = "参数错误";
  8357. return actionResult;
  8358. }
  8359. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8360. DataTable gTable = new DataTable();
  8361. gTable.Columns.Add("GroutingLineID", typeof(int));
  8362. gTable.Columns.Add("GroutingLineCode");
  8363. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8364. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8365. gTable.Columns.Add("GroutingMouldCode");
  8366. gTable.Columns.Add("RecordRemarks");
  8367. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8368. gTable.Columns.Add("MouldID", typeof(int));
  8369. gTable.Columns.Add("MouldCode");
  8370. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8371. string groutingLineCode = data["GroutingLineCode"] + "";
  8372. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8373. foreach (Dictionary<string, object> item in details)
  8374. {
  8375. int? mouldID = null;
  8376. if (item.ContainsKey("MouldID"))
  8377. {
  8378. mouldID = Convert.ToInt32(item["MouldID"]);
  8379. if (mouldID == 0)
  8380. {
  8381. mouldID = null;
  8382. }
  8383. }
  8384. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8385. item["GLineDetailID"], item["GLineDetailCode"],
  8386. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8387. mouldID, item["MouldCode"]);
  8388. }
  8389. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8390. if (result > 0)
  8391. {
  8392. actionResult.Status = (int)Constant.PDAResult.Success;
  8393. }
  8394. else
  8395. {
  8396. actionResult.Status = (int)Constant.PDAResult.Fail;
  8397. actionResult.Result = result;
  8398. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8399. return actionResult;
  8400. }
  8401. return actionResult;
  8402. }
  8403. #endregion
  8404. #region 结束维修
  8405. if (action == "RepairEndGroutingLineDetail")
  8406. {
  8407. if (data == null || !data.ContainsKey("Details"))
  8408. {
  8409. actionResult.Status = (int)Constant.PDAResult.Fail;
  8410. actionResult.Message = "参数错误";
  8411. return actionResult;
  8412. }
  8413. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8414. DataTable gTable = new DataTable();
  8415. gTable.Columns.Add("GroutingLineID", typeof(int));
  8416. gTable.Columns.Add("GroutingLineCode");
  8417. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8418. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8419. gTable.Columns.Add("GroutingMouldCode");
  8420. gTable.Columns.Add("RecordRemarks");
  8421. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8422. gTable.Columns.Add("MouldID", typeof(int));
  8423. gTable.Columns.Add("MouldCode");
  8424. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8425. string groutingLineCode = data["GroutingLineCode"] + "";
  8426. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8427. foreach (Dictionary<string, object> item in details)
  8428. {
  8429. int? mouldID = null;
  8430. if (item.ContainsKey("MouldID"))
  8431. {
  8432. mouldID = Convert.ToInt32(item["MouldID"]);
  8433. if (mouldID == 0)
  8434. {
  8435. mouldID = null;
  8436. }
  8437. }
  8438. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8439. item["GLineDetailID"], item["GLineDetailCode"],
  8440. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8441. mouldID, item["MouldCode"]);
  8442. }
  8443. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8444. if (result > 0)
  8445. {
  8446. actionResult.Status = (int)Constant.PDAResult.Success;
  8447. }
  8448. else
  8449. {
  8450. actionResult.Status = (int)Constant.PDAResult.Fail;
  8451. actionResult.Result = result;
  8452. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8453. return actionResult;
  8454. }
  8455. return actionResult;
  8456. }
  8457. #endregion
  8458. #region 换模
  8459. if (action == "ChangeGMouldStartGroutingLineDetail")
  8460. {
  8461. if (data == null || !data.ContainsKey("Details"))
  8462. {
  8463. actionResult.Status = (int)Constant.PDAResult.Fail;
  8464. actionResult.Message = "参数错误";
  8465. return actionResult;
  8466. }
  8467. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8468. DataTable gTable = new DataTable();
  8469. gTable.Columns.Add("GroutingLineID", typeof(int));
  8470. gTable.Columns.Add("GroutingLineCode");
  8471. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8472. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8473. gTable.Columns.Add("GroutingMouldCode");
  8474. gTable.Columns.Add("RecordRemarks");
  8475. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8476. gTable.Columns.Add("MouldID", typeof(int));
  8477. gTable.Columns.Add("MouldCode");
  8478. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8479. gTable.Columns.Add("MouldStatus", typeof(int));
  8480. gTable.Columns.Add("ScrapReason", typeof(int));
  8481. gTable.Columns.Add("ScrapResponsibility");
  8482. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8483. string groutingLineCode = data["GroutingLineCode"] + "";
  8484. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8485. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8486. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8487. string scrapResponsibility = data["ScrapRemarks"] + "";
  8488. foreach (Dictionary<string, object> item in details)
  8489. {
  8490. int? mouldID = null;
  8491. if (item.ContainsKey("MouldID"))
  8492. {
  8493. mouldID = Convert.ToInt32(item["MouldID"]);
  8494. if (mouldID == 0)
  8495. {
  8496. mouldID = null;
  8497. }
  8498. }
  8499. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8500. item["GLineDetailID"], item["GLineDetailCode"],
  8501. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8502. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8503. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8504. }
  8505. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  8506. if (result > 0)
  8507. {
  8508. actionResult.Status = (int)Constant.PDAResult.Success;
  8509. }
  8510. else
  8511. {
  8512. actionResult.Status = (int)Constant.PDAResult.Fail;
  8513. actionResult.Result = result;
  8514. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8515. return actionResult;
  8516. }
  8517. return actionResult;
  8518. }
  8519. #endregion
  8520. #region 变产
  8521. if (action == "UpdateLineStartGroutingLineDetail")
  8522. {
  8523. if (data == null || !data.ContainsKey("Details"))
  8524. {
  8525. actionResult.Status = (int)Constant.PDAResult.Fail;
  8526. actionResult.Message = "参数错误";
  8527. return actionResult;
  8528. }
  8529. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8530. DataTable gTable = new DataTable();
  8531. gTable.Columns.Add("GroutingLineID", typeof(int));
  8532. gTable.Columns.Add("GroutingLineCode");
  8533. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8534. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8535. gTable.Columns.Add("GroutingMouldCode");
  8536. gTable.Columns.Add("RecordRemarks");
  8537. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8538. gTable.Columns.Add("MouldID", typeof(int));
  8539. gTable.Columns.Add("MouldCode");
  8540. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8541. gTable.Columns.Add("MouldStatus", typeof(int));
  8542. gTable.Columns.Add("ScrapReason", typeof(int));
  8543. gTable.Columns.Add("ScrapResponsibility");
  8544. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8545. string groutingLineCode = data["GroutingLineCode"] + "";
  8546. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8547. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8548. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8549. string scrapResponsibility = data["ScrapRemarks"] + "";
  8550. foreach (Dictionary<string, object> item in details)
  8551. {
  8552. int? mouldID = null;
  8553. if (item.ContainsKey("MouldID"))
  8554. {
  8555. mouldID = Convert.ToInt32(item["MouldID"]);
  8556. if (mouldID == 0)
  8557. {
  8558. mouldID = null;
  8559. }
  8560. }
  8561. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8562. item["GLineDetailID"], item["GLineDetailCode"],
  8563. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8564. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8565. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8566. }
  8567. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  8568. if (result > 0)
  8569. {
  8570. actionResult.Status = (int)Constant.PDAResult.Success;
  8571. }
  8572. else
  8573. {
  8574. actionResult.Status = (int)Constant.PDAResult.Fail;
  8575. actionResult.Result = result;
  8576. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8577. return actionResult;
  8578. }
  8579. return actionResult;
  8580. }
  8581. #endregion
  8582. #region 整线变产
  8583. if (action == "UpdateAllLineStartGroutingLineDetail")
  8584. {
  8585. if (data == null || !data.ContainsKey("Details"))
  8586. {
  8587. actionResult.Status = (int)Constant.PDAResult.Fail;
  8588. actionResult.Message = "参数错误";
  8589. return actionResult;
  8590. }
  8591. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8592. DataTable gTable = new DataTable();
  8593. gTable.Columns.Add("GroutingLineID", typeof(int));
  8594. gTable.Columns.Add("GroutingLineCode");
  8595. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8596. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8597. gTable.Columns.Add("GroutingMouldCode");
  8598. gTable.Columns.Add("RecordRemarks");
  8599. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8600. gTable.Columns.Add("MouldID", typeof(int));
  8601. gTable.Columns.Add("MouldCode");
  8602. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8603. gTable.Columns.Add("MouldStatus", typeof(int));
  8604. gTable.Columns.Add("ScrapReason", typeof(int));
  8605. gTable.Columns.Add("ScrapResponsibility");
  8606. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8607. string groutingLineCode = data["GroutingLineCode"] + "";
  8608. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8609. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8610. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8611. string scrapResponsibility = data["ScrapRemarks"] + "";
  8612. foreach (Dictionary<string, object> item in details)
  8613. {
  8614. int? mouldID = null;
  8615. if (item.ContainsKey("MouldID"))
  8616. {
  8617. mouldID = Convert.ToInt32(item["MouldID"]);
  8618. if (mouldID == 0)
  8619. {
  8620. mouldID = null;
  8621. }
  8622. }
  8623. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8624. item["GLineDetailID"], item["GLineDetailCode"],
  8625. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8626. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8627. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8628. }
  8629. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  8630. if (result > 0)
  8631. {
  8632. actionResult.Status = (int)Constant.PDAResult.Success;
  8633. }
  8634. else
  8635. {
  8636. actionResult.Status = (int)Constant.PDAResult.Fail;
  8637. actionResult.Result = result;
  8638. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8639. return actionResult;
  8640. }
  8641. return actionResult;
  8642. }
  8643. #endregion
  8644. #region 卸模
  8645. if (action == "UnloadGroutingLineDetail")
  8646. {
  8647. if (data == null || !data.ContainsKey("Details"))
  8648. {
  8649. actionResult.Status = (int)Constant.PDAResult.Fail;
  8650. actionResult.Message = "参数错误";
  8651. return actionResult;
  8652. }
  8653. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8654. DataTable gTable = new DataTable();
  8655. gTable.Columns.Add("GroutingLineID", typeof(int));
  8656. gTable.Columns.Add("GroutingLineCode");
  8657. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8658. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8659. gTable.Columns.Add("GroutingMouldCode");
  8660. gTable.Columns.Add("RecordRemarks");
  8661. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8662. gTable.Columns.Add("MouldID", typeof(int));
  8663. gTable.Columns.Add("MouldCode");
  8664. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8665. gTable.Columns.Add("MouldStatus", typeof(int));
  8666. gTable.Columns.Add("ScrapReason", typeof(int));
  8667. gTable.Columns.Add("ScrapResponsibility");
  8668. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8669. string groutingLineCode = data["GroutingLineCode"] + "";
  8670. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8671. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8672. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8673. string scrapResponsibility = data["ScrapRemarks"] + "";
  8674. foreach (Dictionary<string, object> item in details)
  8675. {
  8676. int? mouldID = null;
  8677. if (item.ContainsKey("MouldID"))
  8678. {
  8679. mouldID = Convert.ToInt32(item["MouldID"]);
  8680. if (mouldID == 0)
  8681. {
  8682. mouldID = null;
  8683. }
  8684. }
  8685. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8686. item["GLineDetailID"], item["GLineDetailCode"],
  8687. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8688. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8689. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8690. }
  8691. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  8692. if (result > 0)
  8693. {
  8694. actionResult.Status = (int)Constant.PDAResult.Success;
  8695. }
  8696. else
  8697. {
  8698. actionResult.Status = (int)Constant.PDAResult.Fail;
  8699. actionResult.Result = result;
  8700. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8701. return actionResult;
  8702. }
  8703. return actionResult;
  8704. }
  8705. #endregion
  8706. #region 结束换模
  8707. if (action == "ChangeGMouldEndGroutingLineDetail")
  8708. {
  8709. if (data == null || !data.ContainsKey("Details"))
  8710. {
  8711. actionResult.Status = (int)Constant.PDAResult.Fail;
  8712. actionResult.Message = "参数错误";
  8713. return actionResult;
  8714. }
  8715. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8716. DataTable gTable = new DataTable();
  8717. gTable.Columns.Add("GroutingLineID", typeof(int));
  8718. gTable.Columns.Add("GroutingLineCode");
  8719. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8720. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8721. gTable.Columns.Add("GroutingMouldCode");
  8722. gTable.Columns.Add("RreasonRemarks");
  8723. gTable.Columns.Add("RecordRemarks");
  8724. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8725. gTable.Columns.Add("MouldID", typeof(int));
  8726. gTable.Columns.Add("MouldCode");
  8727. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8728. gTable.Columns.Add("GoodsID", typeof(int));
  8729. gTable.Columns.Add("GoodsCode");
  8730. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8731. gTable.Columns.Add("GroutingCount", typeof(int));
  8732. gTable.Columns.Add("MouldSource");
  8733. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8734. string groutingLineCode = data["GroutingLineCode"] + "";
  8735. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8736. foreach (Dictionary<string, object> item in details)
  8737. {
  8738. int? mouldID = null;
  8739. if (item.ContainsKey("MouldID"))
  8740. {
  8741. mouldID = Convert.ToInt32(item["MouldID"]);
  8742. if (mouldID == 0)
  8743. {
  8744. mouldID = null;
  8745. }
  8746. }
  8747. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8748. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8749. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8750. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8751. item["GoodsID"], item["GoodsCode"],
  8752. item["StandardGroutingCount"], item["GroutingCount"],
  8753. (mouldID == null ? "0" : "1"));
  8754. }
  8755. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  8756. if (result.Status == Constant.ServiceResultStatus.Success)
  8757. {
  8758. actionResult.Status = (int)Constant.PDAResult.Success;
  8759. }
  8760. else if (result.OtherStatus == -100)
  8761. {
  8762. actionResult.Status = (int)Constant.PDAResult.Fail;
  8763. actionResult.Result = -100;
  8764. actionResult.Message = result.Message;
  8765. return actionResult;
  8766. }
  8767. else
  8768. {
  8769. actionResult.Status = (int)Constant.PDAResult.Fail;
  8770. actionResult.Result = -500;
  8771. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8772. return actionResult;
  8773. }
  8774. return actionResult;
  8775. }
  8776. #endregion
  8777. #region 结束变产
  8778. if (action == "UpdateLineEndGroutingLineDetail")
  8779. {
  8780. if (data == null || !data.ContainsKey("Details"))
  8781. {
  8782. actionResult.Status = (int)Constant.PDAResult.Fail;
  8783. actionResult.Message = "参数错误";
  8784. return actionResult;
  8785. }
  8786. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8787. DataTable gTable = new DataTable();
  8788. gTable.Columns.Add("GroutingLineID", typeof(int));
  8789. gTable.Columns.Add("GroutingLineCode");
  8790. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8791. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8792. gTable.Columns.Add("GroutingMouldCode");
  8793. gTable.Columns.Add("RreasonRemarks");
  8794. gTable.Columns.Add("RecordRemarks");
  8795. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8796. gTable.Columns.Add("MouldID", typeof(int));
  8797. gTable.Columns.Add("MouldCode");
  8798. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8799. gTable.Columns.Add("GoodsID", typeof(int));
  8800. gTable.Columns.Add("GoodsCode");
  8801. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8802. gTable.Columns.Add("GroutingCount", typeof(int));
  8803. gTable.Columns.Add("MouldSource");
  8804. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8805. string groutingLineCode = data["GroutingLineCode"] + "";
  8806. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8807. foreach (Dictionary<string, object> item in details)
  8808. {
  8809. int? mouldID = null;
  8810. if (item.ContainsKey("MouldID"))
  8811. {
  8812. mouldID = Convert.ToInt32(item["MouldID"]);
  8813. if (mouldID == 0)
  8814. {
  8815. mouldID = null;
  8816. }
  8817. }
  8818. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8819. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8820. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8821. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8822. item["GoodsID"], item["GoodsCode"],
  8823. item["StandardGroutingCount"], item["GroutingCount"],
  8824. (mouldID == null ? "0" : "1"));
  8825. }
  8826. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  8827. if (result.Status == Constant.ServiceResultStatus.Success)
  8828. {
  8829. actionResult.Status = (int)Constant.PDAResult.Success;
  8830. }
  8831. else if (result.OtherStatus == -100)
  8832. {
  8833. actionResult.Status = (int)Constant.PDAResult.Fail;
  8834. actionResult.Result = -100;
  8835. actionResult.Message = result.Message;
  8836. return actionResult;
  8837. }
  8838. else
  8839. {
  8840. actionResult.Status = (int)Constant.PDAResult.Fail;
  8841. actionResult.Result = -500;
  8842. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8843. return actionResult;
  8844. }
  8845. return actionResult;
  8846. }
  8847. #endregion
  8848. #region 结束整线变产
  8849. if (action == "UpdateAllLineEndGroutingLineDetail")
  8850. {
  8851. if (data == null || !data.ContainsKey("Details"))
  8852. {
  8853. actionResult.Status = (int)Constant.PDAResult.Fail;
  8854. actionResult.Message = "参数错误";
  8855. return actionResult;
  8856. }
  8857. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8858. DataTable gTable = new DataTable();
  8859. gTable.Columns.Add("GroutingLineID", typeof(int));
  8860. gTable.Columns.Add("GroutingLineCode");
  8861. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8862. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8863. gTable.Columns.Add("GroutingMouldCode");
  8864. gTable.Columns.Add("Remarks");
  8865. gTable.Columns.Add("RecordRemarks");
  8866. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8867. gTable.Columns.Add("MouldID", typeof(int));
  8868. gTable.Columns.Add("MouldCode");
  8869. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8870. gTable.Columns.Add("GoodsID", typeof(int));
  8871. gTable.Columns.Add("GoodsCode");
  8872. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8873. gTable.Columns.Add("GroutingCount", typeof(int));
  8874. gTable.Columns.Add("MouldSource");
  8875. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8876. string groutingLineCode = data["GroutingLineCode"] + "";
  8877. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8878. foreach (Dictionary<string, object> item in details)
  8879. {
  8880. int? mouldID = null;
  8881. if (item.ContainsKey("MouldID"))
  8882. {
  8883. mouldID = Convert.ToInt32(item["MouldID"]);
  8884. if (mouldID == 0)
  8885. {
  8886. mouldID = null;
  8887. }
  8888. }
  8889. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8890. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8891. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  8892. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8893. item["GoodsID"], item["GoodsCode"],
  8894. item["StandardGroutingCount"], item["GroutingCount"],
  8895. (mouldID == null ? "0" : "1"));
  8896. }
  8897. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  8898. if (result.Status == Constant.ServiceResultStatus.Success)
  8899. {
  8900. actionResult.Status = (int)Constant.PDAResult.Success;
  8901. }
  8902. else if (result.OtherStatus == -100)
  8903. {
  8904. actionResult.Status = (int)Constant.PDAResult.Fail;
  8905. actionResult.Result = -100;
  8906. actionResult.Message = result.Message;
  8907. return actionResult;
  8908. }
  8909. else
  8910. {
  8911. actionResult.Status = (int)Constant.PDAResult.Fail;
  8912. actionResult.Result = -500;
  8913. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8914. return actionResult;
  8915. }
  8916. return actionResult;
  8917. }
  8918. #endregion
  8919. #region 上模
  8920. if (action == "UpdateGroutingLine_AddMould")
  8921. {
  8922. if (data == null || !data.ContainsKey("Details"))
  8923. {
  8924. actionResult.Status = (int)Constant.PDAResult.Fail;
  8925. actionResult.Message = "参数错误";
  8926. return actionResult;
  8927. }
  8928. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8929. DataTable gTable = new DataTable();
  8930. gTable.Columns.Add("GroutingLineID", typeof(int));
  8931. gTable.Columns.Add("GroutingLineCode");
  8932. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8933. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8934. gTable.Columns.Add("GroutingMouldCode");
  8935. gTable.Columns.Add("Remarks");
  8936. gTable.Columns.Add("RecordRemarks");
  8937. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8938. gTable.Columns.Add("MouldID", typeof(int));
  8939. gTable.Columns.Add("MouldCode");
  8940. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8941. gTable.Columns.Add("GoodsID", typeof(int));
  8942. gTable.Columns.Add("GoodsCode");
  8943. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8944. gTable.Columns.Add("GroutingCount", typeof(int));
  8945. gTable.Columns.Add("MouldSource");
  8946. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8947. string groutingLineCode = data["GroutingLineCode"] + "";
  8948. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8949. foreach (Dictionary<string, object> item in details)
  8950. {
  8951. int? mouldID = null;
  8952. if (item.ContainsKey("MouldID"))
  8953. {
  8954. mouldID = Convert.ToInt32(item["MouldID"]);
  8955. if (mouldID == 0)
  8956. {
  8957. mouldID = null;
  8958. }
  8959. }
  8960. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  8961. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8962. gldID, item["GLineDetailCode"],
  8963. item["DetailRemarks"], item["RecordRemarks"],
  8964. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  8965. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8966. item["GoodsID"], item["GoodsCode"],
  8967. item["StandardGroutingCount"], item["GroutingCount"],
  8968. (mouldID == null ? "0" : "1"));
  8969. }
  8970. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  8971. if (result.Status == Constant.ServiceResultStatus.Success)
  8972. {
  8973. actionResult.Status = (int)Constant.PDAResult.Success;
  8974. }
  8975. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  8976. {
  8977. actionResult.Status = (int)Constant.PDAResult.Fail;
  8978. actionResult.Result = result.OtherStatus;
  8979. actionResult.Message = result.Message;
  8980. return actionResult;
  8981. }
  8982. else
  8983. {
  8984. actionResult.Status = (int)Constant.PDAResult.Fail;
  8985. actionResult.Result = -500;
  8986. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8987. return actionResult;
  8988. }
  8989. return actionResult;
  8990. }
  8991. #endregion
  8992. return actionResult;
  8993. }
  8994. #endregion
  8995. #region 包装装板限制
  8996. if (module == "FinishedLoadingCar")
  8997. {
  8998. if (action == "GetSetting")
  8999. {
  9000. ClientRequestEntity cre = new ClientRequestEntity();
  9001. cre.Properties["GoodsID"] = data["GoodsID"];
  9002. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9003. if (sre.Status == Constant.ServiceResultStatus.Success)
  9004. {
  9005. actionResult.Status = (int)Constant.PDAResult.Success;
  9006. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9007. {
  9008. if (item["settingcode"].ToString() == "S_PM_011")
  9009. {
  9010. cre.Properties["S_PM_011"] = item["settingvalue"];
  9011. }
  9012. else if (item["settingcode"].ToString() == "S_PM_012")
  9013. {
  9014. cre.Properties["S_PM_012"] = item["settingvalue"];
  9015. }
  9016. else if (item["settingcode"].ToString() == "S_PM_013")
  9017. {
  9018. cre.Properties["S_PM_013"] = item["settingvalue"];
  9019. }
  9020. }
  9021. cre.Properties["PlatelitNum"] = sre.Result;
  9022. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9023. }
  9024. else
  9025. {
  9026. actionResult.Status = (int)Constant.PDAResult.Fail;
  9027. actionResult.Message = "";
  9028. }
  9029. return actionResult;
  9030. }
  9031. }
  9032. #endregion
  9033. #region 成型报损
  9034. if (module == "GroutingScrapProduct")
  9035. {
  9036. // 查询注浆日报明细表
  9037. if ("GetGroutingDailyDetail" == action)
  9038. {
  9039. ClientRequestEntity cre = new ClientRequestEntity();
  9040. cre.NameSpace = module;
  9041. cre.Name = action;
  9042. if (!string.IsNullOrEmpty(jsonData))
  9043. {
  9044. cre.Properties["BarCode"] = data["BarCode"];
  9045. }
  9046. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9047. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9048. actionResult.Status = (int)Constant.PDAResult.Success;
  9049. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9050. || sre.Data.Tables[0].Rows.Count == 0)
  9051. {
  9052. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9053. actionResult.Status = (int)Constant.PDAResult.Fail;
  9054. }
  9055. else
  9056. {
  9057. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9058. // 判断是否进行了注浆
  9059. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9060. {
  9061. actionResult.Message = "该产品还未进行注浆!";
  9062. actionResult.Status = (int)Constant.PDAResult.Fail;
  9063. }
  9064. // 判断是否进行了交坯
  9065. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9066. {
  9067. actionResult.Message = "该产品已经交坯!";
  9068. actionResult.Status = (int)Constant.PDAResult.Fail;
  9069. }
  9070. // 判断是否已经报损
  9071. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9072. {
  9073. actionResult.Message = "该产品已经报损!";
  9074. actionResult.Status = (int)Constant.PDAResult.Fail;
  9075. }
  9076. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9077. }
  9078. }
  9079. // 获取成型报损原因
  9080. else if ("GetScrapReasonData" == action)
  9081. {
  9082. ClientRequestEntity cre = new ClientRequestEntity();
  9083. cre.NameSpace = module;
  9084. cre.Name = action;
  9085. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo);
  9086. actionResult.Status = (int)Constant.PDAResult.Success;
  9087. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9088. }
  9089. // 保存成型报损
  9090. else if ("SaveGroutingScrapProduct" == action)
  9091. {
  9092. ClientRequestEntity cre = new ClientRequestEntity();
  9093. cre.NameSpace = module;
  9094. cre.Name = action;
  9095. if (!string.IsNullOrEmpty(jsonData))
  9096. {
  9097. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9098. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9099. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9100. if (dt != null && dt.Rows.Count > 0)
  9101. {
  9102. // 总单信息
  9103. DataRow properties = dt.Rows[0];
  9104. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9105. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9106. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9107. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9108. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9109. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9110. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9111. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9112. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9113. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9114. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9115. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9116. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9117. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9118. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9119. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9120. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9121. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9122. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9123. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9124. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9125. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9126. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9127. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9128. // 责任员工
  9129. cre.Data = new DataSet();
  9130. //DataTable returnTable = returnData.Tables[1].Copy();
  9131. cre.Data.Tables.Add(dtResponsible);
  9132. }
  9133. }
  9134. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9135. if (sre.Status == Constant.ServiceResultStatus.Success)
  9136. {
  9137. actionResult.Status = (int)Constant.PDAResult.Success;
  9138. actionResult.Result = sre.Result;
  9139. }
  9140. else
  9141. {
  9142. actionResult.Status = (int)Constant.PDAResult.Fail;
  9143. actionResult.Result = sre.OtherStatus;
  9144. actionResult.Message = sre.Message;
  9145. }
  9146. }
  9147. // 获取成型报损信息 用于撤销使用
  9148. else if ("GetGroutingScrapProduct" == action)
  9149. {
  9150. ClientRequestEntity cre = new ClientRequestEntity();
  9151. cre.NameSpace = module;
  9152. cre.Name = action;
  9153. if (!string.IsNullOrEmpty(jsonData))
  9154. {
  9155. cre.Properties["BarCode"] = data["BarCode"];
  9156. }
  9157. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9158. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9159. actionResult.Status = (int)Constant.PDAResult.Success;
  9160. }
  9161. // 撤销成型报损
  9162. else if ("ReverseGroutingScrapProduct" == action)
  9163. {
  9164. ClientRequestEntity cre = new ClientRequestEntity();
  9165. cre.NameSpace = module;
  9166. cre.Name = action;
  9167. if (!string.IsNullOrEmpty(jsonData))
  9168. {
  9169. cre.Properties["BarCode"] = data["BarCode"];
  9170. }
  9171. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9172. if (sre.Status == Constant.ServiceResultStatus.Success)
  9173. {
  9174. actionResult.Status = (int)Constant.PDAResult.Success;
  9175. actionResult.Result = sre.Result;
  9176. }
  9177. else
  9178. {
  9179. actionResult.Status = (int)Constant.PDAResult.Fail;
  9180. actionResult.Result = sre.OtherStatus;
  9181. actionResult.Message = sre.Message;
  9182. }
  9183. }
  9184. }
  9185. #endregion
  9186. #region 产品挂起
  9187. if (module == "ProductSuspend")
  9188. {
  9189. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9190. if (action == "GetSuspendProcedure")
  9191. {
  9192. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9193. if (sre.Status == Constant.ServiceResultStatus.Success)
  9194. {
  9195. actionResult.Status = (int)Constant.PDAResult.Success;
  9196. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9197. }
  9198. else
  9199. {
  9200. actionResult.Status = (int)Constant.PDAResult.Fail;
  9201. actionResult.Message = sre.Message;
  9202. }
  9203. return actionResult;
  9204. }
  9205. // 验证挂起条码
  9206. if (action == "CheckSuspendBarcode")
  9207. {
  9208. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9209. if (sre.Status == Constant.ServiceResultStatus.Success)
  9210. {
  9211. actionResult.Status = (int)Constant.PDAResult.Success;
  9212. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9213. }
  9214. else
  9215. {
  9216. actionResult.Status = (int)Constant.PDAResult.Fail;
  9217. actionResult.Message = sre.Message;
  9218. }
  9219. return actionResult;
  9220. }
  9221. // 挂起条码
  9222. if (action == "SaveSuspendProduct")
  9223. {
  9224. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9225. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9226. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9227. if (sre.Status == Constant.ServiceResultStatus.Success)
  9228. {
  9229. actionResult.Status = (int)Constant.PDAResult.Success;
  9230. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9231. }
  9232. else
  9233. {
  9234. actionResult.Status = (int)Constant.PDAResult.Fail;
  9235. actionResult.Message = sre.Message;
  9236. }
  9237. return actionResult;
  9238. }
  9239. // 撤销挂起条码
  9240. if (action == "DeleteSuspendProduct")
  9241. {
  9242. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9243. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9244. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9245. if (sre.Status == Constant.ServiceResultStatus.Success)
  9246. {
  9247. actionResult.Status = (int)Constant.PDAResult.Success;
  9248. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9249. }
  9250. else
  9251. {
  9252. actionResult.Status = (int)Constant.PDAResult.Fail;
  9253. actionResult.Message = sre.Message;
  9254. }
  9255. return actionResult;
  9256. }
  9257. // 查询挂起条码
  9258. if (action == "GetSuspendProduct")
  9259. {
  9260. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9261. if (sre.Status == Constant.ServiceResultStatus.Success)
  9262. {
  9263. if (sre.Data.Tables[0].Rows.Count == 0)
  9264. {
  9265. actionResult.Status = (int)Constant.PDAResult.Fail;
  9266. actionResult.Message = "此条码没有可撤销的挂起信息";
  9267. }
  9268. else
  9269. {
  9270. actionResult.Status = (int)Constant.PDAResult.Success;
  9271. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9272. }
  9273. }
  9274. else
  9275. {
  9276. actionResult.Status = (int)Constant.PDAResult.Fail;
  9277. actionResult.Message = sre.Message;
  9278. }
  9279. return actionResult;
  9280. }
  9281. }
  9282. #endregion
  9283. #region 品保抽查
  9284. if (module == "QASpotCheck")
  9285. {
  9286. if (action == "GetAllQASpotCheck")
  9287. {
  9288. ClientRequestEntity cre = new ClientRequestEntity();
  9289. cre.NameSpace = module;
  9290. cre.Name = action;
  9291. if (data != null && data.Count > 0)
  9292. {
  9293. foreach (string item in data.Keys)
  9294. {
  9295. if (item.StartsWith("checktime"))
  9296. {
  9297. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9298. }
  9299. else
  9300. {
  9301. cre.Properties.Add(item, data[item]);
  9302. }
  9303. }
  9304. }
  9305. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9306. if (sre.Status == Constant.ServiceResultStatus.Success)
  9307. {
  9308. actionResult.Status = (int)Constant.PDAResult.Success;
  9309. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9310. }
  9311. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9312. {
  9313. actionResult.Status = (int)Constant.PDAResult.Success;
  9314. }
  9315. else
  9316. {
  9317. actionResult.Status = (int)Constant.PDAResult.Fail;
  9318. actionResult.Message = sre.Message;
  9319. }
  9320. return actionResult;
  9321. }
  9322. if (action == "AutoSaveQASpotCheck")
  9323. {
  9324. string barcode = data["barcode"] + "";
  9325. string remarks = data["remarks"] + "";
  9326. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9327. if (sre.Status == Constant.ServiceResultStatus.Success)
  9328. {
  9329. actionResult.Status = (int)Constant.PDAResult.Success;
  9330. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9331. }
  9332. else
  9333. {
  9334. actionResult.Status = (int)Constant.PDAResult.Fail;
  9335. actionResult.Message = sre.Message;
  9336. }
  9337. return actionResult;
  9338. }
  9339. if (action == "CheckQASpotCheck")
  9340. {
  9341. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9342. if (sre.Status == Constant.ServiceResultStatus.Success)
  9343. {
  9344. actionResult.Status = (int)Constant.PDAResult.Success;
  9345. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9346. }
  9347. else
  9348. {
  9349. actionResult.Status = (int)Constant.PDAResult.Fail;
  9350. actionResult.Message = sre.Message;
  9351. }
  9352. return actionResult;
  9353. }
  9354. if (action == "SaveQASpotCheck")
  9355. {
  9356. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9357. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9358. if (sre.Status == Constant.ServiceResultStatus.Success)
  9359. {
  9360. actionResult.Status = (int)Constant.PDAResult.Success;
  9361. }
  9362. else
  9363. {
  9364. actionResult.Status = (int)Constant.PDAResult.Fail;
  9365. actionResult.Message = sre.Message;
  9366. }
  9367. return actionResult;
  9368. }
  9369. return null;
  9370. }
  9371. #endregion
  9372. #region 产成品交接
  9373. if (module == "FinishedProduct")
  9374. {
  9375. // 设定商标
  9376. if (action == "GetFinishedBarcode")
  9377. {
  9378. string barcode = data["barcode"].ToString();
  9379. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  9380. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9381. if (Convert.ToInt32(resultEntity.Result) < 0)
  9382. {
  9383. actionResult.Status = (int)Constant.PDAResult.Fail;
  9384. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9385. actionResult.Message = resultEntity.Message;
  9386. }
  9387. else
  9388. {
  9389. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9390. actionResult.Status = (int)Constant.PDAResult.Success;
  9391. actionResult.Message = resultEntity.Message;
  9392. }
  9393. return actionResult;
  9394. }
  9395. if (action == "GetHandoveredBarcode")
  9396. {
  9397. string barcode = data["barcode"].ToString();
  9398. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  9399. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9400. if (Convert.ToInt32(resultEntity.Result) < 0)
  9401. {
  9402. actionResult.Status = (int)Constant.PDAResult.Fail;
  9403. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9404. actionResult.Message = resultEntity.Message;
  9405. }
  9406. else
  9407. {
  9408. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9409. actionResult.Status = (int)Constant.PDAResult.Success;
  9410. actionResult.Message = resultEntity.Message;
  9411. }
  9412. return actionResult;
  9413. }
  9414. if (action == "SetFinishedLogo")
  9415. {
  9416. int logoid = Convert.ToInt32(data["logoid"]);
  9417. string[] barcodes = data["barcodes"].ToString().Split(',');
  9418. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo);
  9419. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9420. if (result < 0)
  9421. {
  9422. actionResult.Status = (int)Constant.PDAResult.Fail;
  9423. }
  9424. else
  9425. {
  9426. actionResult.Status = (int)Constant.PDAResult.Success;
  9427. }
  9428. return actionResult;
  9429. }
  9430. if (action == "SetHandoveredOrder")
  9431. {
  9432. int orderID = Convert.ToInt32(data["orderID"]);
  9433. string[] barcodes = data["barcodes"].ToString().Split(',');
  9434. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  9435. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9436. if (result < 0)
  9437. {
  9438. actionResult.Status = (int)Constant.PDAResult.Fail;
  9439. }
  9440. else
  9441. {
  9442. actionResult.Status = (int)Constant.PDAResult.Success;
  9443. }
  9444. return actionResult;
  9445. }
  9446. }
  9447. #endregion
  9448. #region 产成品装车
  9449. /*
  9450. if (module == "FinishedLoading")
  9451. {
  9452. // 设定商标
  9453. if (action == "GetMaxLoadingNo")
  9454. {
  9455. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  9456. actionResult.Status = (int)Constant.PDAResult.Success;
  9457. actionResult.Result = no;
  9458. return actionResult;
  9459. }
  9460. if (action == "CheckFinishedLaodingBarcode")
  9461. {
  9462. string barcode = data["barcode"].ToString();
  9463. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  9464. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  9465. {
  9466. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9467. actionResult.Status = (int)Constant.PDAResult.Success;
  9468. actionResult.Message = resultEntity.Message;
  9469. }
  9470. else
  9471. {
  9472. actionResult.Status = (int)Constant.PDAResult.Fail;
  9473. actionResult.Result = resultEntity.OtherStatus;
  9474. actionResult.Message = resultEntity.Message;
  9475. }
  9476. return actionResult;
  9477. }
  9478. if (action == "SaveFinishedLoading")
  9479. {
  9480. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  9481. string carLicense = data["carLicense"] + "";
  9482. int palletNum = Convert.ToInt32(data["palletNum"]);
  9483. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  9484. string remarks = data["remarks"] + "";
  9485. Dictionary<string, object>[] details =
  9486. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  9487. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  9488. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  9489. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  9490. if (result.Status == Constant.ServiceResultStatus.Success)
  9491. {
  9492. actionResult.Status = (int)Constant.PDAResult.Success;
  9493. actionResult.Message = result.Message;
  9494. }
  9495. else
  9496. {
  9497. actionResult.Status = (int)Constant.PDAResult.Fail;
  9498. actionResult.Result = result.OtherStatus;
  9499. actionResult.Message = result.Message;
  9500. }
  9501. return actionResult;
  9502. }
  9503. }
  9504. */
  9505. #endregion
  9506. #region 产成品质量改判
  9507. if (module == "FinishedProductTamper")
  9508. {
  9509. // 获取产成品信息及缺陷数据
  9510. if (action == "GetDefectData")
  9511. {
  9512. string barcode = data["barcode"].ToString();
  9513. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  9514. if (sre.Status == Constant.ServiceResultStatus.Success)
  9515. {
  9516. actionResult.Status = (int)Constant.PDAResult.Success;
  9517. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9518. actionResult.Message = sre.Message;
  9519. }
  9520. else
  9521. {
  9522. actionResult.Status = (int)Constant.PDAResult.Fail;
  9523. actionResult.Result = sre.OtherStatus;
  9524. actionResult.Message = sre.Message;
  9525. }
  9526. return actionResult;
  9527. }
  9528. // 获取产成品信息及缺陷数据
  9529. if (action == "SaveDefectData")
  9530. {
  9531. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  9532. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  9533. if (sre.Status == Constant.ServiceResultStatus.Success)
  9534. {
  9535. actionResult.Status = (int)Constant.PDAResult.Success;
  9536. actionResult.Message = sre.Message;
  9537. }
  9538. else
  9539. {
  9540. actionResult.Status = (int)Constant.PDAResult.Fail;
  9541. actionResult.Message = sre.Message;
  9542. }
  9543. return actionResult;
  9544. }
  9545. // 通过条码查出责任工序(成品改判用)
  9546. if (action == "GetDutyProcedureByBarCodeForTamper")
  9547. {
  9548. string barcode = data["barcode"] + "";
  9549. int defectid = int.Parse(data["defectid"] + "");
  9550. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  9551. if (sre.Status == Constant.ServiceResultStatus.Success)
  9552. {
  9553. actionResult.Status = (int)Constant.PDAResult.Success;
  9554. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9555. actionResult.Message = sre.Message;
  9556. }
  9557. else
  9558. {
  9559. actionResult.Status = (int)Constant.PDAResult.Fail;
  9560. actionResult.Result = sre.OtherStatus;
  9561. actionResult.Message = sre.Message;
  9562. }
  9563. return actionResult;
  9564. }
  9565. }
  9566. #endregion
  9567. #region PDA独立功能
  9568. #region 水效标识
  9569. if (module == "WaterEffect")
  9570. {
  9571. // 获取产成品信息及水效标识
  9572. if (action == "GetGoodsByBarCode")
  9573. {
  9574. string barcode = data["barcode"].ToString();
  9575. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  9576. if (sre.Status == Constant.ServiceResultStatus.Success)
  9577. {
  9578. actionResult.Status = (int)Constant.PDAResult.Success;
  9579. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9580. actionResult.Message = sre.Message;
  9581. }
  9582. else
  9583. {
  9584. actionResult.Status = (int)Constant.PDAResult.Fail;
  9585. actionResult.Result = sre.OtherStatus;
  9586. actionResult.Message = sre.Message;
  9587. }
  9588. return actionResult;
  9589. }
  9590. }
  9591. #endregion
  9592. #region 盖板型号
  9593. if (module == "SeatCoverType")
  9594. {
  9595. // 获取产成品信息及水效标识
  9596. if (action == "SendGoodsCodeToPLC")
  9597. {
  9598. string barcode = data["barcode"].ToString();
  9599. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  9600. if (sre == 0)
  9601. {
  9602. actionResult.Status = (int)Constant.PDAResult.Success;
  9603. }
  9604. else
  9605. {
  9606. actionResult.Status = (int)Constant.PDAResult.Fail;
  9607. actionResult.Result = sre;
  9608. switch (sre)
  9609. {
  9610. case 1:
  9611. case 2:
  9612. actionResult.Message = "无效条码";
  9613. break;
  9614. case 3:
  9615. actionResult.Message = "此产品型号没有设置盖板标识码";
  9616. break;
  9617. case 4:
  9618. actionResult.Message = "当前用户没有设置PLC参数";
  9619. break;
  9620. case 5:
  9621. actionResult.Message = "PLC参数设置不全";
  9622. break;
  9623. default:
  9624. actionResult.Message = "PLC通信异常";
  9625. break;
  9626. }
  9627. }
  9628. return actionResult;
  9629. }
  9630. }
  9631. #endregion
  9632. #region PDA PLC 相关功能
  9633. if (module == "PDA_FUN_PLC")
  9634. {
  9635. // PDA扫码发送到PLCServer
  9636. if (action == "SendBarcodeToPLCServer")
  9637. {
  9638. string barcode = data["barcode"].ToString();
  9639. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  9640. if (sre == 0)
  9641. {
  9642. actionResult.Status = (int)Constant.PDAResult.Success;
  9643. }
  9644. else
  9645. {
  9646. actionResult.Status = (int)Constant.PDAResult.Fail;
  9647. actionResult.Result = sre;
  9648. switch (sre)
  9649. {
  9650. case 1:
  9651. case 2:
  9652. actionResult.Message = "无效条码";
  9653. break;
  9654. case 3:
  9655. actionResult.Message = "PLC通信异常";
  9656. break;
  9657. case 4:
  9658. actionResult.Message = "当前用户没有设置PLC参数";
  9659. break;
  9660. case 5:
  9661. actionResult.Message = "PLC参数设置不全";
  9662. break;
  9663. default:
  9664. actionResult.Message = "PLC通信异常";
  9665. break;
  9666. }
  9667. }
  9668. return actionResult;
  9669. }
  9670. }
  9671. #endregion
  9672. #endregion
  9673. #region 半检返修
  9674. if (module == "SemiRework")
  9675. {
  9676. // 验证半检返修条码
  9677. if (action == "CheckSemiReworkBarcode")
  9678. {
  9679. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9680. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  9681. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9682. if (Convert.ToInt32(resultEntity.Result) < 0)
  9683. {
  9684. actionResult.Status = (int)Constant.PDAResult.Fail;
  9685. }
  9686. else
  9687. {
  9688. actionResult.Status = (int)Constant.PDAResult.Success;
  9689. }
  9690. actionResult.Message = resultEntity.Message;
  9691. return actionResult;
  9692. }
  9693. // 可以返修的工序
  9694. if (action == "GetSemiReworkProcedure")
  9695. {
  9696. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9697. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  9698. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9699. actionResult.Status = (int)Constant.PDAResult.Success;
  9700. return actionResult;
  9701. }
  9702. // 根据条码获取经过的工序,用于责任工序
  9703. if (action == "GetSemiReworkPassProcedure")
  9704. {
  9705. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9706. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  9707. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9708. actionResult.Status = (int)Constant.PDAResult.Success;
  9709. return actionResult;
  9710. }
  9711. // 根据所选生产工序(生产数据ID)查询责任员工
  9712. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  9713. {
  9714. int productionDataID = Convert.ToInt32(jsonData);
  9715. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9716. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  9717. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9718. actionResult.Status = (int)Constant.PDAResult.Success;
  9719. return actionResult;
  9720. }
  9721. // 根据所选工号,查出缺陷责任员工
  9722. if (action == "GetSemiReworkDefectStaffByUserID")
  9723. {
  9724. int userID = Convert.ToInt32(jsonData);
  9725. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9726. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  9727. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9728. actionResult.Status = (int)Constant.PDAResult.Success;
  9729. return actionResult;
  9730. }
  9731. // 新建半检返修
  9732. if (action == "AddSemiRework")
  9733. {
  9734. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"]+"");
  9735. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9736. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  9737. actionResult.Result = resultEntity.Result;
  9738. actionResult.Message = resultEntity.Message;
  9739. if (Convert.ToInt32(resultEntity.Result) > 0)
  9740. {
  9741. actionResult.Status = (int)Constant.PDAResult.Success;
  9742. }
  9743. else
  9744. {
  9745. actionResult.Status = (int)Constant.PDAResult.Fail;
  9746. }
  9747. return actionResult;
  9748. }
  9749. // 编辑半检返修
  9750. if (action == "EditSemiRework")
  9751. {
  9752. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9753. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9754. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  9755. actionResult.Result = resultEntity.Result;
  9756. actionResult.Message = resultEntity.Message;
  9757. if (Convert.ToInt32(resultEntity.Result) > 0)
  9758. {
  9759. actionResult.Status = (int)Constant.PDAResult.Success;
  9760. }
  9761. else
  9762. {
  9763. actionResult.Status = (int)Constant.PDAResult.Fail;
  9764. }
  9765. return actionResult;
  9766. }
  9767. // 撤销半检返修
  9768. if (action == "CancelSemiRework")
  9769. {
  9770. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9771. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9772. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  9773. actionResult.Result = resultEntity.Result;
  9774. actionResult.Message = resultEntity.Message;
  9775. if (Convert.ToInt32(resultEntity.Result) > 0)
  9776. {
  9777. actionResult.Status = (int)Constant.PDAResult.Success;
  9778. }
  9779. else
  9780. {
  9781. actionResult.Status = (int)Constant.PDAResult.Fail;
  9782. }
  9783. return actionResult;
  9784. }
  9785. // 获取半检返修数据(PDA编辑用)
  9786. if (action == "GetSemiReworkByID")
  9787. {
  9788. int id = Convert.ToInt32(jsonData);
  9789. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9790. PMModuleLogic.GetSemiReworkByID(id,sUserInfo.UserCode);
  9791. DataTable data1 = resultEntity.Data.Tables[0];
  9792. DataTable data2 = resultEntity.Data.Tables[1];
  9793. DataTable data3 = resultEntity.Data.Tables[2];
  9794. if (data1.Rows.Count == 0)
  9795. {
  9796. actionResult.Status = (int)Constant.PDAResult.Fail;
  9797. actionResult.Message = "半检返修信息不存在";
  9798. return actionResult;
  9799. }
  9800. SemiReworkEntity srEntity = new SemiReworkEntity();
  9801. srEntity.SemiReworkID = id;
  9802. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  9803. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  9804. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  9805. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  9806. foreach (DataRow row2 in data2.Rows)
  9807. {
  9808. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  9809. srEntity.SemiReworkDefects.Add(defectEntity);
  9810. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  9811. defectEntity.SemiReworkID = id;
  9812. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  9813. defectEntity.DefectCode = row2["DefectCode"] + "";
  9814. defectEntity.DefectName = row2["DefectName"] + "";
  9815. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  9816. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  9817. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  9818. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  9819. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  9820. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  9821. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  9822. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  9823. defectEntity.Remarks = row2["Remarks"] + "";
  9824. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  9825. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  9826. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  9827. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  9828. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  9829. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  9830. if (row3s.Length == 0)
  9831. {
  9832. continue;
  9833. }
  9834. foreach (DataRow row3 in row3s)
  9835. {
  9836. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  9837. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  9838. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  9839. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  9840. semiReworkRPS.StaffName = row3["StaffName"] + "";
  9841. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  9842. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  9843. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  9844. semiReworkRPS.UserCode = row3["UserCode"] + "";
  9845. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  9846. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  9847. }
  9848. }
  9849. //xuwei note 总单用于显示,信息较全
  9850. actionResult.Message = JsonHelper.ToJson(data1);
  9851. //xuwei note 总单信息不全,但有明细,用于回传保存
  9852. actionResult.Result = JsonHelper.ToJson(srEntity);
  9853. actionResult.Status = (int)Constant.PDAResult.Success;
  9854. }
  9855. }
  9856. #endregion
  9857. return actionResult;
  9858. }
  9859. catch (Exception ex)
  9860. {
  9861. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  9862. OutputLog.TraceLog(LogPriority.Error,
  9863. this.ToString(),
  9864. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  9865. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  9866. " module:" + module + " action:" + action + " json:" + jsonData,
  9867. ex.ToString(),
  9868. LocalPath.LogExePath);
  9869. actionResult.Status = (int)Constant.PDAResult.Exception;
  9870. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  9871. }
  9872. return actionResult;
  9873. }
  9874. #endregion
  9875. }
  9876. }