| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689 |
- /*******************************************************************************
- * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:PDAModuleService.cs
- * 2.功能描述:PDA模块WCF服务
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 陈晓野 2014/09/16 1.00 新建
- *******************************************************************************/
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.IO;
- using System.ServiceModel;
- using System.ServiceModel.Activation;
- using Dongke.IBOSS.PRD.Basics.BaseResources;
- using Dongke.IBOSS.PRD.Basics.DataAccess;
- using Dongke.IBOSS.PRD.Basics.Library;
- using Dongke.IBOSS.PRD.Service.BarcodePrintService;
- using Dongke.IBOSS.PRD.Service.CommonModuleLogic;
- using Dongke.IBOSS.PRD.Service.DataModels;
- using Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic;
- using Dongke.IBOSS.PRD.Service.HRModuleLogic;
- using Dongke.IBOSS.PRD.Service.PCModuleLogic;
- using Dongke.IBOSS.PRD.Service.PDAModuleLogic;
- using Dongke.IBOSS.PRD.Service.PMModuleLogic;
- using Dongke.IBOSS.PRD.Service.PublicModuleService;
- using Dongke.IBOSS.PRD.Service.ReportModuleLogic;
- using Dongke.IBOSS.PRD.Service.SmartDeviceService;
- using Dongke.IBOSS.PRD.Service.SystemModuleLogic;
- using Dongke.IBOSS.PRD.WCF.Contracts;
- using Dongke.IBOSS.PRD.WCF.DataModels;
- using Dongke.IBOSS.PRD.WCF.DataModels.ConfigModule;
- using Dongke.IBOSS.PRD.WCF.DataModels.HRModule;
- using Dongke.IBOSS.PRD.WCF.DataModels.PCModule;
- using Dongke.IBOSS.PRD.WCF.DataModels.PMModule;
- namespace Dongke.IBOSS.PRD.WCF.Services
- {
- // 服务实现类,继承服务声明接口
- // 该标签声明该服务可以在ASP.NET下运行
- [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
- [ServiceBehavior(ConfigurationName = "PDAModuleService",
- InstanceContextMode = InstanceContextMode.PerCall,
- ConcurrencyMode = ConcurrencyMode.Multiple,
- UseSynchronizationContext = false)]
- public partial class PDAModuleService : IPDAModule
- {
- #region 属性
- /// <summary>
- /// 用户登陆的信息
- /// </summary>
- SUserInfo sUserInfo
- {
- get;
- set;
- }
- #endregion
- #region 构造函数
- /// <summary>
- /// 构造函数
- /// </summary>
- public PDAModuleService()
- : base()
- {
- }
- #endregion
- #region 验证
- /// <summary>
- /// 验证访问头
- /// </summary>
- /// <param name="accountCode">帐套编码</param>
- /// <param name="userCode">用户编码</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">访问密钥</param>
- /// <returns></returns>
- private ActionResult DoPDACheck(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- try
- {
- ActionResult actionResult = new ActionResult();
- LoginRequestEntity requestEntity = new LoginRequestEntity();
- requestEntity.AccountCode = accountCode;
- requestEntity.UserCode = userCode;
- requestEntity.Password = userPassword;
- requestEntity.SessionKey = sessionKey;
- SUserInfo userInfo = null;
- string loginStatus = DKIBOSSPRDLogic.AuthenticateRepeatLogin(requestEntity, out userInfo);
- // 用户登录信息错误
- if (Constant.INT_IS_ONE.ToString().Equals(loginStatus))
- {
- actionResult.Status = (int)Constant.PDAResult.LoginInfoError;
- actionResult.Message = Constant.PDA_RESULT_LOGININFOERROR;
- }
- // 用户在其它终端登陆
- else if (Constant.INT_IS_TWO.ToString().Equals(loginStatus))
- {
- actionResult.Status = (int)Constant.PDAResult.RepeatLogin;
- actionResult.Message = Constant.PDA_RESULT_REPEATLOGIN;
- }
- // Lic错误
- else if ("3".Equals(loginStatus))
- {
- actionResult.Status = (int)Constant.PDAResult.LicInfoError;
- actionResult.Message = "授权信息错误,请联系管理员。";
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- sUserInfo = userInfo;
- return actionResult;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- #endregion
- #region WCF服务
- /// <summary>
- /// 测试PDA连接WCF服务
- /// </summary>
- /// <param name="value">测试文本</param>
- /// <returns>返回文本</returns>
- public string TestConnectionEx(string value)
- {
- return "连接成功!" + value;
- }
- public string TestConnection()
- {
- return "连接成功!";
- }
- #endregion
- #region 系统登录
- /// <summary>
- /// 系统登录
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="macAddress"></param>
- /// <param name="ipAddress"></param>
- /// <param name="phoneCode"></param>
- /// <param name="phoneType"></param>
- /// <param name="appVersion"></param>
- /// <param name="systemType"></param>
- /// <param name="systemVersion"></param>
- /// <returns></returns>
- public PDALoginResult DoPDALogin(string accountCode, string userCode, string userPassword,
- string macAddress, string ipAddress, string phoneCode, string phoneType,
- string appVersion, string systemType, string systemVersion)
- {
- try
- {
- LoginRequestEntity requestEntity = new LoginRequestEntity();
- requestEntity.AccountCode = accountCode;
- requestEntity.UserCode = userCode;
- requestEntity.Password = userPassword;
- requestEntity.ComputerName = phoneCode;
- requestEntity.IPAddress = ipAddress;
- requestEntity.MACAddress = macAddress;
- PDALoginResult result = ServiceInvoker.Invoke<PDALoginResult>(this,
- () => PDAModuleLogic.DoPDALogin(requestEntity));
- return result;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- PDALoginResult result = new PDALoginResult();
- result.Status = (int)Constant.PDAResult.Exception;
- result.Message = Constant.PDA_RESULT_EXCEPTION;
- return result;
- }
- }
- /// <summary>
- /// 退出
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <returns></returns>
- public ActionResult DoPDAOut(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- bool result = DKIBOSSPRDLogic.Logout(sUserInfo.UserID, "3", sUserInfo);
- actionResult.Result = JsonHelper.ToJson(result);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 修改密码
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult ChangeUserPassword(string accountCode, string userCode, string userPassword, string sessionKey,
- string newPassWord)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- string result = ServiceInvoker.Invoke<string>(this,
- () => SystemModuleDAL.SaveUserPassWord(newPassWord, userCode, null, sUserInfo));
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- #region 取得展示数据
- /// <summary>
- /// 获得生产线菜单
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <returns></returns>
- /// <remarks>
- /// 陈冰 2014.09.18 新建
- /// </remarks>
- public ActionResult GetProductionLineMenu(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- // 查询菜单
- DataTable dtPLM = ServiceInvoker.Invoke<DataTable>(this,
- () => PDAModuleLogic.GetProductionLineMenu(sUserInfo));
- PDAFunctionResult pdaFunction = new PDAFunctionResult();
- pdaFunction.MenuCode = "Root";
- DataRow[] navigationRows = dtPLM.Select("LEN(MenuCode) = " + Constant.INT_IS_TWO.ToString(), "MenuCode ASC"); // 编号2为一级菜单
- foreach (DataRow newRow in navigationRows)
- {
- #region 插入子节点数据
- int? intProcedureID = null;
- int? intModelType = null;
- if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
- {
- intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
- }
- if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
- {
- intModelType = Convert.ToInt32(newRow["ModelType"]);
- }
- PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
- pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
- pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
- pdaFunctionChild.ProcedureID = intProcedureID;
- pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
- pdaFunctionChild.ModelType = intModelType;
- pdaFunction.PDAFunctions.Add(pdaFunctionChild);
- #endregion
- InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild);
- }
- //actionResult.Result = JsonHelper.ToJson(dtPLM);
- actionResult.Result = JsonHelper.ToJson(pdaFunction);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 初始化树形控件
- /// </summary>
- /// <param name="treeTable">菜单数据表</param>
- /// <param name="rows">待处理的菜单集合</param>
- /// <param name="node">当前树节点</param>
- private void InitTreeView(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions)
- {
- string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = "
- + (pFuncCode.Length + Constant.INT_IS_TWO);
- DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC");
- //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC");
- foreach (DataRow newRow in subRows)
- {
- #region 插入子节点数据
- int? intProcedureID = null;
- int? intModelType = null;
- if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
- {
- intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
- }
- if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
- {
- intModelType = Convert.ToInt32(newRow["ModelType"]);
- }
- PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
- pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
- pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
- pdaFunctionChild.ProcedureID = intProcedureID;
- pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
- pdaFunctionChild.ModelType = intModelType;
- pFunctions.PDAFunctions.Add(pdaFunctionChild);
- #endregion
- // 递归方法
- InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild);
- }
- }
- #endregion
- #region 获得工序信息
- /// <summary>
- /// 获得工序信息
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="procedureID">工序ID</param>
- /// <returns></returns>
- /// <remarks>
- /// 陈冰 2014.09.18 新建
- /// </remarks>
- public ActionResult GetProcedureByID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ProcedureEntity procedureEntity = ServiceInvoker.Invoke<ProcedureEntity>(this,
- () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(procedureEntity);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- #region 校验
- /// <summary>
- /// 校验产品条码是否可以走到该工序
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="procedureID">工序ID</param>
- /// <param name="barcode">条码</param>
- /// <returns></returns>
- /// <remarks>
- /// 陈冰 2014.09.18 新建
- /// </remarks>
- public ActionResult CheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo));
- if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 校验产品条码是否可以进行干补
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="procedureID">工序ID</param>
- /// <param name="barcode">条码</param>
- /// <returns></returns>
- /// <remarks>
- /// 袁新成 2015.4.1 新建
- /// </remarks>
- public ActionResult CheckDryRepairBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
- if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 检验生产工号
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="procedureID">工序ID</param>
- /// <param name="procedureUserCode">生产工号</param>
- /// <remarks>
- /// 陈冰 2014.09.18 新建
- /// </remarks>
- public ActionResult CheckProcedureUser(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
- () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 校验窑车是否可装车并返回窑车信息
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="kilnCarCode">窑车号</param>
- /// <param name="modelType">工序类别</param>
- /// <returns></returns>
- /// <remarks>
- /// 陈冰 2014.10.04 新建
- /// </remarks>
- public ActionResult CheckKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
- () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- #region 保存条码信息
- /// <summary>
- /// 保存条码信息
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="procedureID">工序ID</param>
- /// <param name="productionDataEntitys">条码信息</param>
- public ActionResult AddWorkPiece(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
- if (!dtProductionData.Columns.Contains("IsPDA"))
- {
- dtProductionData.Columns.Add("IsPDA");
- }
- ProcedureEntity procedureInfo = null;
- DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
- () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
- actionResult.Result = JsonHelper.ToJson(resultDT);
- actionResult.Status = (int)Constant.PDAResult.Success;
- if (resultDT != null)
- {
- DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
- if (drs != null && drs.Length > 0)
- {
- return actionResult;
- }
- }
- #region PDA条码打印
- if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
- procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
- {
- try
- {
- if (procedureInfo.CollectType == 1)
- {
- //foreach (DataRow item in dtProductionData.Rows)
- //{
- // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
- // procedureInfo.BarCodePrintCopies, null, sUserInfo);
- // if (sre.Status != Constant.ServiceResultStatus.Success)
- // {
- // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
- // actionResult.Message = sre.Message;
- // return actionResult;
- // }
- //}
- }
- else
- {
- ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
- procedureInfo.BarCodePrintCopies, null, sUserInfo);
- if (sre.Status != Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.ServiceResultStatus.Other;
- actionResult.Message = sre.Message;
- return actionResult;
- }
- }
- }
- catch (Exception ex)
- {
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.ServiceResultStatus.Other;
- actionResult.Message = "条码打印异常";
- return actionResult;
- }
- }
- #endregion PDA条码打印
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- #region 获得系统/基数数据
- /// <summary>
- /// 获得数据字典
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="dicType">字典类型</param>
- /// <returns></returns>
- public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
- () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
- actionResult.Result = JsonHelper.ToJson(dicDataTable);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- #region 检验工序接口
- /// <summary>
- /// 获得检验标识
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <returns></returns>
- /// <remarks>
- /// 陈冰 2014.10.04 新建
- /// </remarks>
- public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- #region 构造缺陷标识的数据源
- DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
- #endregion
- actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 由条码和当前检验工序获取返工工序
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="procedureID">当前检验工序ID</param>
- /// <param name="barcode">条码</param>
- /// <returns></returns>
- /// <remarks>
- /// 陈冰 2014.10.04 新建
- /// </remarks>
- public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 由当前检验工序获取缺陷列表
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="procedureID">当前检验工序ID</param>
- /// <param name="defectCode">缺陷编码</param>
- /// <returns></returns>
- /// <remarks>
- /// 陈冰 2014.10.04 新建
- /// </remarks>
- public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- object defectDs = ServiceInvoker.Invoke<object>(this,
- () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
- if (defectDs != null)
- {
- actionResult.Result = JsonHelper.ToJson(defectDs);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 根据产品ID查出缺陷位置
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="goodsID">产品ID</param>
- /// <param name="positionCode">位置编码</param>
- /// <returns></returns>
- /// <remarks>
- /// 陈冰 2014.10.04 新建
- /// </remarks>
- public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- // 缺陷位置已经不用在关联产品
- //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
- object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
- if (defectDs != null)
- {
- actionResult.Result = JsonHelper.ToJson(defectDs);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 通过条码和缺陷查出责任工序
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="barcode">条码</param>
- /// <param name="defectid">缺陷ID</param>
- /// <returns></returns>
- /// <remarks>
- /// 陈冰 2014.10.04 新建
- /// </remarks>
- public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
- if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 通过条码与工序查出责任工号(己废)
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="barcode">条码</param>
- /// <param name="dutyProcedureID">责任工序</param>
- /// <returns></returns>
- /// <remarks>
- /// 陈冰 2014.10.04 新建
- /// </remarks>
- public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
- if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 通过条码与工序查出责任工号
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="ProductionDataID">生产数据ID</param>
- /// <returns></returns>
- public ActionResult GetDutyProcedureCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
- if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 通过生产数据与工号ID查询工种
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="productionDataID">生产数据ID</param>
- /// <param name="userID">工号ID</param>
- /// <returns></returns>
- /// <remarks>
- /// 陈冰 2014.10.08 新建
- /// </remarks>
- public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey,
- //int productionDataID, int userID)
- int classesSettingID, int defectid, int procedureID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
- //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
- () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
- if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 根据生产数据ID,用户ID及工种选出责任员工
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="productionDataID">生产数据ID</param>
- /// <param name="userID">工号ID</param>
- /// <param name="jobsID">工种ID</param>
- /// <returns></returns>
- /// <remarks>
- /// 陈冰 2014.10.08 新建
- /// </remarks>
- public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey,
- //int productionDataID, int userID, int jobsID)
- int classesSettingID, int jobsID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
- //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
- () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
- if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获得产品分级
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <returns></returns>
- /// <remarks>
- /// 陈冰 2014.10.08 新建
- /// </remarks>
- public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- #region 构造产品分级的数据源
- //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
- DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2, sUserInfo);
- if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- #endregion
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- #region 保存检验条码
- /// <summary>
- /// 保存检验条码
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="procedureID">工序ID</param>
- /// <param name="productionDataEntitys">条码信息</param>
- /// <returns></returns>
- public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- //if(productionDataEntitys.Length>0)
- //{
- // if(productionDataEntitys[0].ProductionDataID>0)
- // {
- // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
- // }
- //}
- string err = ServiceInvoker.Invoke<string>(this,
- //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
- () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
- if (err == null)
- {
- err = "";
- }
- //actionResult.Result = JsonHelper.ToJson(err);
- actionResult.Result = err;// JsonHelper.ToJson(err);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- #region 文件上传下载
- /// <summary>
- /// 软件更新
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <returns></returns>
- public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- try
- {
- return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- return null;
- }
- }
- /// <summary>
- /// 上传临时文件
- /// </summary>
- /// <param name="imgStream"></param>
- /// <returns></returns>
- public ActionResult SaveImg(Stream mageStream)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- string err = PDAModuleLogic.SaveImg(mageStream);
- if (err == null)
- {
- err = "";
- }
- actionResult.Result = err;
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- public Stream GetFileTest(string path)
- {
- return PDAModuleLogic.GetImg(path);
- }
- public Stream GetFileStream()
- {
- FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
- long l = fs.Length;
- return fs;
- }
- public byte[] GetFileTestByte(string path)
- {
- FileStream stream = new FileInfo(path).OpenRead();
- Byte[] buffer = new Byte[stream.Length];
- //从流中读取字节块并将该数据写入给定缓冲区buffer中
- stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
- return buffer;
- }
- public string GetFile(string path)
- {
- string imgFilePath = path;
- System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
- int i = (int)fs.Length;
- byte[] content = new byte[i];
- fs.Read(content, 0, i);
- string result = Convert.ToBase64String(content);
- fs.Close();
- FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
- StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
- sw.Write(result);
- sw.Close();
- fsTxt.Close();
- return result;
- }
- #endregion
- /// <summary>
- /// 获得产品分级
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="procedureID">当前工序ID</param>
- /// <returns></returns>
- /// <remarks>
- /// 陈冰 2014.10.22 新建
- /// </remarks>
- public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获得产品分级
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="barcode">条码</param>
- /// <returns></returns>
- public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetKilnCarByBarCode(barcode));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #region 统计
- /// <summary>
- /// 统计当日计数数量
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="procedureID">工序ID</param>
- /// <returns></returns>
- public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 统计当日计数数量
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="procedureID">工序ID</param>
- /// <returns></returns>
- public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 统计产品跟踪
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="procedureID">工序ID</param>
- /// <returns></returns>
- public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- RPT020101_SE se = new RPT020101_SE();
- se.Barcode = barcode;
- ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
- if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Messages.MSG_CMN_I002;
- }
- else
- {
- actionResult.Result = JsonHelper.ToJson(sre.Data);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
- // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
- //if (productionDataEntity != null)
- //{
- // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
- // actionResult.Status = (int)Constant.PDAResult.Success;
- //}
- //else
- //{
- // actionResult.Status = (int)Constant.PDAResult.Fail;
- // actionResult.Message = Messages.MSG_CMN_I002;
- //}
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString() + ex.HelpLink,
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- #region 撤销装车及成检
- /// <summary>
- /// 检验条码是否可以撤销装车
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="procedureID">当前工序ID</param>
- /// <param name="barcode">条码</param>
- /// <returns></returns>
- public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
- () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 保存撤销装车的条码
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="procedureID">当前工序ID</param>
- /// <param name="barcode">条码</param>
- /// <returns></returns>
- public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- string err = ServiceInvoker.Invoke<string>(this,
- () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
- if (err == null)
- {
- err = "";
- }
- actionResult.Result = JsonHelper.ToJson(err);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 由产品条码获取注浆信息
- /// </summary>
- /// <param name="barcode"></param>
- /// <returns></returns>
- public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取工号下的所有工种信息
- /// </summary>
- /// <param name="UserID">工号ID</param>
- /// <returns></returns>
- public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 根据所选工号对应的工种,查出缺陷责任员工
- /// </summary>
- /// <param name="jobs">工种ID</param>
- /// <returns></returns>
- public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 根据所选工号,查出漏检责任员工
- /// </summary>
- /// <param name="userid">工号</param>
- /// <returns></returns>
- public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取用户列表
- /// </summary>
- /// <param name="requestEntity">用户实体</param>
- /// <returns></returns>
- public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- SUserEntity requestEntity = new SUserEntity();
- requestEntity.IsWorker = IsWorker;
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取数据字典管理的数据
- /// </summary>
- /// <param name="Pvalue">显示停用标识</param>
- /// <param name="dictionaryType">字典类别</param>
- /// <returns></returns>
- /// <remarks>
- /// 2014.12.03 新建
- /// </remarks>
- public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- #region 保存半检数据
- /// <summary>
- /// 保存半检数据
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="productionDataEntitys">半检信息</param>
- /// <returns></returns>
- public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- string err = ServiceInvoker.Invoke<string>(this,
- () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
- if (err == null)
- {
- err = "";
- }
- actionResult.Result = JsonHelper.ToJson(err);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- /// <summary>
- /// 获取产品列表
- /// </summary>
- /// <returns></returns>
- public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- GoodsEntity goodsEntity = new GoodsEntity();
- goodsEntity.ValueFlag = 1;//有效标记
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
- /// </summary>
- /// <param name="searchEntity">生产数据实体类</param>
- /// <returns>DataTable</returns>
- public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
- searchEntity.ProcedureID = ProcedureID;
- searchEntity.BarCode = BarCode;
- DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
- () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
- if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 根据所选生产数据ID,显示成检数据信息
- /// </summary>
- /// <param name="productionDataID">生产数据ID</param>
- /// <returns>DataSet</returns>
- public ActionResult GetProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.GetProductionDataByID(productionDataID));
- PDAProductionDataResult productionDatas = new PDAProductionDataResult();
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
- {
- for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
- {
- PDAProductionDataResult productionData = new PDAProductionDataResult();
- productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
- if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
- {
- productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
- }
- productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
- productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
- if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
- {
- productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
- }
- if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
- {
- productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
- }
- productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
- if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
- {
- productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
- }
- if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
- {
- productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
- }
- productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
- productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
- productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
- productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
- productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
- productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
- if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
- {
- productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
- productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
- productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
- }
- productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
- if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
- {
- productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
- }
- DataView dvDefect = reworkDs.Tables[1].DefaultView;
- dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
- DataTable dtDefect = dvDefect.ToTable();
- for (int row = 0; row < dtDefect.Rows.Count; row++)
- {
- // 产品缺陷
- PDADefectResult defect = new PDADefectResult();
- defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
- defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
- if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
- {
- defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
- }
- defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
- if (dtDefect.Rows[row]["DefectID"].ToString() != "")
- {
- defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
- }
- defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
- defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
- if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
- {
- defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
- }
- defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
- defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
- if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
- {
- defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
- }
- defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
- defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
- if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
- {
- defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
- }
- defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
- defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
- if (dtDefect.Rows[row]["Jobs"].ToString() != "")
- {
- defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
- }
- if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
- {
- defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
- }
- defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
- defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
- defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
- defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
- if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
- {
- defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
- }
- if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
- {
- defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
- }
- if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
- {
- defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
- }
- defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
- defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
- //--------责任员工-------------------
- DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
- if (drRow.Length > Constant.INT_IS_ZERO)
- {
- foreach (DataRow r in drRow)
- {
- PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
- if (r["ProductionDefectID"].ToString() != "")
- {
- defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
- }
- if (r["StaffID"].ToString() != "")
- {
- defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
- }
- defectResponsible.StaffCode = r["StaffCode"].ToString();
- defectResponsible.StaffName = r["StaffName"].ToString();
- if (r["StaffStatus"].ToString() != "")
- {
- defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
- }
- if (r["UJobsID"].ToString() != "")
- {
- defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
- }
- if (r["SJobsID"].ToString() != "")
- {
- defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
- }
- defect.PDADefectResponsibles.Add(defectResponsible);
- }
- }
- //------------------------------
- //--------漏检员工-------------------
- DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
- if (drMissedRow.Length > Constant.INT_IS_ZERO)
- {
- foreach (DataRow r in drMissedRow)
- {
- PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
- if (r["ProductionDefectID"].ToString() != "")
- {
- defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
- }
- if (r["StaffID"].ToString() != "")
- {
- defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
- }
- defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
- defectMissedResponsible.StaffName = r["StaffName"].ToString();
- if (r["StaffStatus"].ToString() != "")
- {
- defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
- }
- if (r["UJobsID"].ToString() != "")
- {
- defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
- }
- if (r["SJobsID"].ToString() != "")
- {
- defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
- }
- defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
- }
- }
- //------------------------------
- DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
- if (drImageRow.Length > Constant.INT_IS_ZERO)
- {
- foreach (DataRow r in drImageRow)
- {
- PDADefectImageResult defectImage = new PDADefectImageResult();
- if (r["ProductionDefectID"].ToString() != "")
- {
- defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
- }
- defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
- //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
- //{
- defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
- //}
- defect.PDADefectImageResults.Add(defectImage);
- }
- }
- productionData.PDADefects.Add(defect);
- }
- if (productionDatas.PDAProductionData == null)
- {
- productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
- }
- productionDatas.PDAProductionData.Add(productionData);
- //---------------------------------------------------------------------------------
- }
- }
- actionResult.Result = JsonHelper.ToJson(productionDatas);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 编辑后删除生产数据
- /// </summary>
- /// <param name="productionDataID">生产数据ID</param>
- /// <returns>int</returns>
- public ActionResult DeleteProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int row = ServiceInvoker.Invoke<int>(this,
- () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
- actionResult.Result = JsonHelper.ToJson(row);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取产品完成工序的ID
- /// </summary>
- /// <param name="barcode">产品条码</param>
- /// <returns>int</returns>
- public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int row = ServiceInvoker.Invoke<int>(this,
- () => PMModuleLogic.GetCompleteProcedureID(barcode));
- actionResult.Result = JsonHelper.ToJson(row);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 绑定图片
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="imagePath">图片路径</param>
- /// <returns></returns>
- public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
- {
- try
- {
- return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- return null;
- }
- }
- /// <summary>
- /// 根据所选工号对应的工种,查出缺陷责任员工
- /// </summary>
- /// <param name="jobs">工种ID</param>
- /// <returns></returns>
- public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #region 产品报废
- /// <summary>
- /// 验证废弃产品唯一性
- /// </summary>
- /// <param name="barcode">产品条码</param>
- /// <returns>int</returns>
- public ActionResult ScrapProductChack(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- string row = ServiceInvoker.Invoke<string>(this,
- () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
- string[] rm = row.Split(':');
- actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
- if (rm.Length > 1)
- {
- actionResult.Message = rm[1];
- }
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 根据条码获取该产品的在产信息以及生产数据
- /// </summary>
- /// <param name="Barcode">产品条码</param>
- /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
- public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 根据工号查询员工档案信息
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="userId"></param>
- /// <returns></returns>
- public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 添加废弃产品记录
- /// </summary>
- /// <param name="SProductEntity">废弃产品实体</param>
- /// <param name="RProcedureEntity">废弃责任工序实体</param>
- /// <param name="SResponsibleList">责任者集合</param>
- /// <param name="userInfo">用户基本信息</param>
- /// <returns>int结果返回值</returns>
- /// <remarks>
- /// 庄天威 2014.09.24 新建
- /// </remarks>
- public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey,
- ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
- ScrapResponsibleEntity[] SResponsibleList)
- {
- ActionResult actionResult = new ActionResult();
- if (SResponsibleList == null || SResponsibleList.Length == 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "没有选择责任人";
- }
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int addRow = ServiceInvoker.Invoke<int>(this,
- () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(addRow);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- // TODO 空指针异常问题检测
- try
- {
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
- LocalPath.LogExePath);
- string json1 = JsonHelper.ToJson(SProductEntity);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- "SProductEntity:" + json1,
- LocalPath.LogExePath);
- string json2 = JsonHelper.ToJson(RProcedureEntity);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- "RProcedureEntity:" + json2,
- LocalPath.LogExePath);
- string json3 = JsonHelper.ToJson(SResponsibleList);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- "SResponsibleList:" + json3,
- LocalPath.LogExePath);
- }
- catch (Exception exc)
- {
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- "参数输入异常:" + exc.Message,
- LocalPath.LogExePath);
- }
- }
- return actionResult;
- }
- /// <summary>
- /// 获取产品分级的数据(根据ID)
- /// </summary>
- /// <param name="GoodsLevelTypeID">分类类别ID</param>
- /// <param name="GoodsLevelID">分类ID</param>
- /// <param name="sUserInfo">用户基本信息</param>
- /// <returns>DataSet</returns>
- /// <remarks>
- /// 2014.10.22 庄天威 新建
- public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取账务日期
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
- () => CommonModuleLogic.GetAccountDate(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(reworkDs);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取登陆帐户有无报损权限
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="usercode">工号编码</param>
- /// <returns></returns>
- public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- /// <summary>
- /// 获取是否存在报损未审核产品
- /// </summary>
- /// <param name="barcode">产品条码</param>
- /// <returns>int</returns>
- public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int row = ServiceInvoker.Invoke<int>(this,
- () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
- actionResult.Result = JsonHelper.ToJson(row);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 查询报废产品信息
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="barCode">产品条码</param>
- /// <param name="scrapProductID">报废产品ID</param>
- /// <returns></returns>
- public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ScrapProductEntity selectProEntity = new ScrapProductEntity();
- selectProEntity.BarCode = barCode;
- selectProEntity.ScrapProductID = scrapProductID;
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 根据废弃产品ID获取责任工序
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="scrapProductID">报废产品ID</param>
- /// <returns></returns>
- public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 根据废弃产品ID获取责任人列表
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="scrapProductID">报废产品ID</param>
- /// <returns></returns>
- public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 添加废弃产品记录
- /// </summary>
- /// <param name="SProductEntity">废弃产品实体</param>
- /// <param name="RProcedureEntity">废弃责任工序实体</param>
- /// <param name="SResponsibleList">责任者集合</param>
- /// <param name="userInfo">用户基本信息</param>
- /// <returns>int结果返回值</returns>
- /// <remarks>
- /// 庄天威 2014.09.24 新建
- /// </remarks>
- public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
- ResponProcedureEntity UpdateRProcedureEntity,
- ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int addRow = ServiceInvoker.Invoke<int>(this,
- () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(addRow);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取产品窑炉
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns>Datase</returns>
- public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取次品产品条码允许编辑
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="barcode">产品条码</param>
- /// <returns>Datase</returns>
- public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.GetSubstandardInfo(barcode));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(1);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Result = JsonHelper.ToJson(0);
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "次品条码:" + barcode + "不允许修改";
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取产品条码是否重烧
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="barcode">产品条码</param>
- /// <returns>Datase</returns>
- public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.GetReFine(barcode));
- if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
- }
- else
- {
- actionResult.Result = JsonHelper.ToJson(0);
- }
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取登陆帐户有无成检编辑权限
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="usercode">工号编码</param>
- /// <returns></returns>
- public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 根据条码及工序判断是否漏扫
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="usercode">工号编码</param>
- /// <param name="barcode">产品条码</param>
- /// <param name="produceid">工序ID</param>
- /// <returns></returns>
- public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = 1;
- //int returnValue = ServiceInvoker.Invoke<int>(this,
- // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取登陆帐户有无报损审批权限
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="usercode">工号编码</param>
- /// <returns></returns>
- public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取登陆帐户有无报损审批权限
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="usercode">工号编码</param>
- /// <returns></returns>
- public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取窑车对应产品列表
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="KilnCarID">窑车ID</param>
- /// <returns>Dataset</returns>
- public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 更换条码
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- ///<param name="barcode">原条码</param>
- /// <param name="newBarcode">新条码</param>
- /// <param name="remarks">备注</param>
- /// <returns>操作结果</returns>
- public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
- if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Result = 1;
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = serviceResultEntity.Message;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取(注浆登记)的查询数据
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="se">查询条件</param>
- /// <returns>Dataset</returns>
- public ActionResult GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
- if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
- {
- // PDA不显示的列删除掉
- //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
- //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
- serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
- serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
- serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
- serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
- serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
- serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
- serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
- //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
- serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
- actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
- actionResult.Message = "无查询数据";
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取(注浆登记)的查询数据
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="se">查询条件</param>
- /// <returns>Dataset</returns>
- public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
- if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
- {
- actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
- actionResult.Message = "无查询数据";
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- ///获得成型线信息
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="se">查询条件</param>
- /// <returns>Dataset</returns>
- public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
- () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
- if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
- {
- actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
- actionResult.Message = "无查询数据";
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- ///获取在产产品的信息标识列表
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="barcode">查询条件</param>
- /// <returns>Dataset</returns>
- public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetInProductionDataList(barcode));
- if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
- {
- actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
- actionResult.Message = "无查询数据";
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- ///获取条码是否注浆登记过,0行无效
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="barcode">查询条件</param>
- /// <returns>Dataset</returns>
- public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
- if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
- {
- actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
- actionResult.Message = "该产品条码无效,无法报损!";
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取登陆帐户有变更条码权限
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 成检时获取此条码是否报损
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="barcode">产品条码</param>
- /// <returns></returns>
- public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PMModuleLogic.CheckScrapProduct(barcode));
- if (returnValue == -100)
- {
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- if (returnValue == 0)
- {
- actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
- }
- else
- {
- actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
- }
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取产品完成工序的ID(PDA)
- /// </summary>
- /// <param name="barcode">产品条码</param>
- /// <returns>int</returns>
- public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
- actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取产品完成工序的ID(PDA)
- /// </summary>
- /// <param name="barcode">产品条码</param>
- /// <returns>int</returns>
- public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
- actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 成检-校验生产工号
- /// </summary>
- /// <param name="usercode">生产工号</param>
- /// <returns>int</returns>
- public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.GetUserCode(usercode, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(ds);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 更新漏扫的成型工号
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="groutingUserCode">成型工号</param>
- /// <param name="missingID">漏扫ID</param>
- /// <returns></returns>
- public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
- if (returnValue != -1)
- {
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "存在无效的漏扫工号";
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 在入窑工序检验窑车号是否存在
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="kilncarcode">窑车编码</param>
- /// <param name="procedureid">工序ID</param>
- /// <returns></returns>
- public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
- if (returnValue == 1)
- {
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- if (returnValue == -99)
- actionResult.Message = "窑炉车号无效";
- else if (returnValue == -98)
- actionResult.Message = "窑车己无产品";
- else if (returnValue == -97)
- actionResult.Message = "窑车没有入窑,不可以撤销";
- else if (returnValue == -1)
- actionResult.Message = "保存失败";
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取盘点单列表
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetInCheckedList(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(ds);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 进行盘点操作
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="InCheckedID">盘点单ID</param>
- /// <param name="BarCode">产品条码</param>
- /// <returns></returns>
- public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
- if (returnValue > 0)
- {
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Message = "产品" + BarCode + "盘点成功";
- }
- else if (returnValue == 10)
- {
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Message = "产品" + BarCode + "盘盈成功";
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- if (returnValue == -2)
- actionResult.Message = "产品" + BarCode + "不是在产产品";
- //if (returnValue == 10)
- // actionResult.Message = "产品" + BarCode + "盘盈成功";
- //if (returnValue > 0)
- // actionResult.Message = "产品" + BarCode + "盘点成功";
- if (returnValue == -22)
- actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
- if (returnValue == -23)
- actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
- if (returnValue == -24)
- actionResult.Message = "产品" + BarCode + "己被此工号盘点";
- if (returnValue == -25)
- actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
- else if (returnValue == 0)
- actionResult.Message = "盘点失败";
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #region 班次配置
- /// <summary>
- /// 班次配置-通过工号获取工种列表
- /// </summary>
- /// <param name="userId">工号ID</param>
- /// <returns></returns>
- public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => SystemModuleLogic.GetJobByUserId(userId));
- actionResult.Result = JsonHelper.ToJson(ds);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- ///// <summary>
- ///// 班次配置-根据工号查询员工档案信息
- ///// </summary>
- ///// <param name="userId">工号ID</param>
- ///// <returns></returns>
- //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
- //{
- // ActionResult actionResult = new ActionResult();
- // try
- // {
- // // 验证请求头信息
- // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // // 验证失败
- // if (actionResult.Status != (int)Constant.PDAResult.Success)
- // {
- // return actionResult;
- // }
- // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
- // actionResult.Result = JsonHelper.ToJson(ds);
- // actionResult.Status = (int)Constant.PDAResult.Success;
- // }
- // catch (Exception ex)
- // {
- // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- // OutputLog.TraceLog(LogPriority.Error,
- // this.ToString(),
- // System.Reflection.MethodBase.GetCurrentMethod().Name,
- // ex.ToString(),
- // LocalPath.LogExePath);
- // actionResult.Status = (int)Constant.PDAResult.Exception;
- // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- // }
- // return actionResult;
- //}
- /// <summary>
- /// 班次配置-根据员工姓名查员工信息
- /// </summary>
- /// <param name="searchStaffEntity"></param>
- /// <returns></returns>
- public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(ds);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取班次配置信息
- /// </summary>
- /// <param name="searchEntity"></param>
- /// <returns></returns>
- public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
- searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(ds);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
- if (returnValue > 0)
- {
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "保存失败";
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 班次配置--获取详细信息
- /// </summary>
- /// <param name="searchEntity"></param>
- /// <returns></returns>
- public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(ds);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取用户是否有班次配置权限
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取盘点单列表
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
- entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(ds);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- #region PDA报表
- /// <summary>
- /// 产品质量跟踪
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="se"></param>
- /// <returns></returns>
- public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
- se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
- ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
- if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Messages.MSG_CMN_I002;
- }
- else
- {
- actionResult.Result = JsonHelper.ToJson(sre.Data);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 工号产量质量分析表
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="se"></param>
- /// <returns></returns>
- public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey,
- int rptSProcedureID, string workcode, string date)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
- if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Messages.MSG_CMN_I002;
- }
- else
- {
- actionResult.Result = JsonHelper.ToJson(sre.Data);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 半检数据统计表
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="se"></param>
- /// <returns></returns>
- public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
- string workcode, string datebegin, string dateend)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DateTime datetimebegin = Convert.ToDateTime(datebegin);
- DateTime datetimeend = Convert.ToDateTime(dateend);
- datetimebegin = datetimebegin.Date;
- datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
- ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
- if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Messages.MSG_CMN_I002;
- }
- else
- {
- actionResult.Result = JsonHelper.ToJson(sre.Data);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 工号质量统计表
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="se"></param>
- /// <returns></returns>
- public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
- int rptSProcedureID, string workcode, string datebegin, string dateend)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DateTime datetimebegin = Convert.ToDateTime(datebegin);
- DateTime datetimeend = Convert.ToDateTime(dateend);
- datetimebegin = datetimebegin.Date;
- datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
- ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
- if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Messages.MSG_CMN_I002;
- }
- else
- {
- actionResult.Result = JsonHelper.ToJson(sre.Data);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 损坯数据统计表
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="se"></param>
- /// <returns></returns>
- public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey,
- string workcode, string datebegin, string dateend)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DateTime datetimebegin = Convert.ToDateTime(datebegin);
- DateTime datetimeend = Convert.ToDateTime(dateend);
- datetimebegin = datetimebegin.Date;
- datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
- ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
- if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Messages.MSG_CMN_I002;
- }
- else
- {
- actionResult.Result = JsonHelper.ToJson(sre.Data);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- /// <summary>
- /// 取得报表数据源数据
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
- if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Messages.MSG_CMN_I002;
- }
- else
- {
- actionResult.Result = JsonHelper.ToJson(sre.Data);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 取得报表的查询数据源统计工序数据
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="RptProcedureID"></param>
- /// <returns></returns>
- public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
- if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Messages.MSG_CMN_I002;
- }
- else
- {
- actionResult.Result = JsonHelper.ToJson(sre.Data);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取用户是否有统计产成品权限
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取用户是否有盘点权限
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 根据条件查询是否存在班次配置
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="userCode">工号编码</param>
- /// <returns></returns>
- public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(ds);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 报损工序查出工号根据生产数据ID
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="ProductionDataID">生产数据ID</param>
- /// <returns></returns>
- public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
- if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 在入窑工序检验窑车号是否存在
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="kilncarcode">窑车编码</param>
- /// <param name="procedureid">工序ID</param>
- /// <returns></returns>
- public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
- if (returnValue == 1)
- {
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- if (returnValue == -99)
- actionResult.Message = "窑炉车号无效";
- else if (returnValue == -98)
- actionResult.Message = "窑车己无产品";
- else if (returnValue == -97)
- actionResult.Message = "窑车没有入窑,不可以撤销";
- else if (returnValue == -1)
- actionResult.Message = "保存失败";
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 撤销包装
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="barcode"></param>
- /// <returns></returns>
- public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
- if (Convert.ToInt32(returnValue.Result) > 0)
- {
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- if (Convert.ToInt32(returnValue.Result) == -1)
- actionResult.Message = "产品条码不存在包装记录";
- else if (Convert.ToInt32(returnValue.Result) == -200)
- actionResult.Message = returnValue.Message;
- else
- actionResult.Message = "成品撤销失败";
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /*
- /// <summary>
- /// 获取用户是否有撤销包装权限
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- */
- /// <summary>
- /// 窑车状态明细表查询
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="kilnCarCode"></param>
- /// <returns></returns>
- public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
- if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Messages.MSG_CMN_I002;
- }
- else
- {
- actionResult.Result = JsonHelper.ToJson(sre.Data);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 损坯撤销
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="barcode"></param>
- /// <returns></returns>
- public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
- if (Convert.ToInt32(returnValue.Result) > 0)
- {
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- if (Convert.ToInt32(returnValue.Result) == -1)
- actionResult.Message = "此产品没有损坯,不能撤销";
- else if (Convert.ToInt32(returnValue.Result) == -200)
- actionResult.Message = returnValue.Message;
- else
- actionResult.Message = "损坯撤销失败";
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /*
- /// <summary>
- /// 获取用户是否有损坯撤销权限
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- */
- /// <summary>
- /// 获取条码注浆信息
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
- if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取条码注浆信息
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
- if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 公坯设定
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="barcode"></param>
- /// <returns></returns>
- public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
- if (returnValue > 0)
- {
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- if (returnValue == -1)
- actionResult.Message = "此产品不在生产线上";
- else if (returnValue == -2)
- actionResult.Message = "该产品已经标识为公坯";
- else
- actionResult.Message = "公坯设定失败";
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /*
- /// <summary>
- /// 获取用户是否有公坯设定
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- */
- /// <summary>
- /// 校验产品条码是否可以走到该工序
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="procedureID">工序ID</param>
- /// <param name="barcode">条码</param>
- /// <returns></returns>
- /// <remarks>
- /// 陈冰 2014.09.18 新建
- /// </remarks>
- public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
- if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取用户所有菜单权限
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
- if (Convert.ToInt32(returnValue.Result) > 0)
- {
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- if (Convert.ToInt32(returnValue.Result) == -1)
- actionResult.Message = "无效条码";
- else if (Convert.ToInt32(returnValue.Result) == -2)
- actionResult.Message = "已经生产完成";
- else if (Convert.ToInt32(returnValue.Result) == -3)
- actionResult.Message = "条码已经申请报废";
- else if (Convert.ToInt32(returnValue.Result) == -4)
- actionResult.Message = "此条码当前工序不允许进行撤销";
- else if (Convert.ToInt32(returnValue.Result) == -5)
- actionResult.Message = "此条码没有生产数据";
- else if (Convert.ToInt32(returnValue.Result) == -6)
- actionResult.Message = "没有当前工序权限";
- else if (Convert.ToInt32(returnValue.Result) == -7)
- actionResult.Message = "条码不在生产线上";
- else if (Convert.ToInt32(returnValue.Result) == -8)
- actionResult.Message = "操作用户无此工序的撤销范围权限";
- else if (Convert.ToInt32(returnValue.Result) == -9)
- actionResult.Message = "条码已经是返工状态";
- else if (Convert.ToInt32(returnValue.Result) == -200)
- actionResult.Message = returnValue.Message;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
- if (Convert.ToInt32(returnValue.Result) > 0)
- {
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- if (Convert.ToInt32(returnValue.Result) == -1)
- actionResult.Message = "无效条码";
- else if (Convert.ToInt32(returnValue.Result) == -2)
- actionResult.Message = "已经生产完成";
- else if (Convert.ToInt32(returnValue.Result) == -3)
- actionResult.Message = "条码已经申请报废";
- else if (Convert.ToInt32(returnValue.Result) == -4)
- actionResult.Message = "此条码当前工序不允许进行撤销";
- else if (Convert.ToInt32(returnValue.Result) == -5)
- actionResult.Message = "此条码没有生产数据";
- else if (Convert.ToInt32(returnValue.Result) == -55)
- actionResult.Message = "条码已经不在交坯工序,不允许撤销";
- else if (Convert.ToInt32(returnValue.Result) == -6)
- actionResult.Message = "没有任何影响行";
- else if (Convert.ToInt32(returnValue.Result) == -7)
- actionResult.Message = "条码不在生产线上";
- else if (Convert.ToInt32(returnValue.Result) == -8)
- actionResult.Message = "条码已经是返工状态";
- else if (Convert.ToInt32(returnValue.Result) == -200)
- actionResult.Message = returnValue.Message;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
- //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
- () => SystemModuleLogic.GetLogoInfo(sUserInfo));
- if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
- {
- //DataView dv = returnValue.Tables[0].DefaultView;
- //dv.RowFilter = "ValueFlag=1";
- //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
- actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
- if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
- {
- actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 半检时,入窑前检验获取此条码是否报损为废品
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="barcode">产品条码</param>
- /// <returns></returns>
- public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PMModuleLogic.CheckWasteScrapProduct(barcode));
- if (returnValue != -100)
- {
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取登陆帐户有无入窑前检验数据编辑权限
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="usercode">工号编码</param>
- /// <returns></returns>
- public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取登陆帐户有无半检验数据编辑权限
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="usercode">工号编码</param>
- /// <returns></returns>
- public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取缺陷扣罚管理的全部数据
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
- if (ds != null && ds.Tables[0].Rows.Count > 0)
- {
- DataView dv = ds.Tables[0].DefaultView;
- dv.RowFilter = "valueflag=1";
- actionResult.Result = JsonHelper.ToJson(dv.ToTable());
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取缺陷扣除数管理的全部数据
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
- if (ds != null && ds.Tables[0].Rows.Count > 0)
- {
- DataView dv = ds.Tables[0].DefaultView;
- dv.RowFilter = "valueflag=1";
- actionResult.Result = JsonHelper.ToJson(dv.ToTable());
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取缺陷扣罚关系管理的全部数据
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
- DataTable dt = new DataTable();
- dt.Columns.Add("DefectID");
- dt.Columns.Add("DefectFineID");
- DataView dv = ds.Tables[0].DefaultView;
- DataTable dtFor = dv.ToTable("defectid", true);
- for (int i = 0; i < dtFor.Rows.Count; i++)
- {
- DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
- string substring = "";
- foreach (DataRow r1 in r)
- {
- substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
- }
- if (substring != "")
- {
- DataRow drnew = dt.NewRow();
- drnew["DefectID"] = dtFor.Rows[i]["defectid"];
- drnew["DefectFineID"] = substring.TrimEnd(',');
- dt.Rows.Add(drnew);
- }
- }
- actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取缺陷扣除数关系管理的全部数据
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
- DataTable dt = new DataTable();
- dt.Columns.Add("DefectID");
- dt.Columns.Add("DefectDeductionNum");
- DataView dv = ds.Tables[0].DefaultView;
- DataTable dtFor = dv.ToTable("defectid", true);
- for (int i = 0; i < dtFor.Rows.Count; i++)
- {
- DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
- string substring = "";
- foreach (DataRow r1 in r)
- {
- substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
- }
- if (substring != "")
- {
- DataRow drnew = dt.NewRow();
- drnew["DefectID"] = dtFor.Rows[i]["defectid"];
- drnew["DefectDeductionNum"] = substring.TrimEnd(',');
- dt.Rows.Add(drnew);
- }
- }
- actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取盘点单明细
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(ds);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 半检检验条码
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
- if (Convert.ToInt32(resultEntity.Result) < 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- actionResult.Message = resultEntity.Message;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 根据条码获取经过的工序,用于绑定返工工序
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
- actionResult.Result = JsonHelper.ToJson(resultEntity);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取登陆帐户有无半检状态权限
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int resultEntity = ServiceInvoker.Invoke<int>(this,
- () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(resultEntity);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 复检状态数据源
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
- () => SystemModuleLogic.GetSemiCheckType());
- actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 根据半成品检验数据ID,显示半成品数据信息
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
- SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
- if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
- {
- if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
- {
- for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
- {
- SemiCheckEntity productionData = new SemiCheckEntity();
- productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
- if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
- {
- productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
- }
- productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
- productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
- productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
- productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
- productionData.ReFine = 0;
- if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
- {
- productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
- }
- productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
- productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
- productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
- productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
- if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
- {
- productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
- productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
- }
- if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
- {
- productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
- }
- //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
- //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
- productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
- productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
- productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
- productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
- productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
- productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
- if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
- {
- productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
- productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
- }
- productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
- if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
- {
- productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
- productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
- productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
- }
- productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
- if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
- {
- productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
- }
- DataView dvDefect = reworkDs.Tables[1].DefaultView;
- dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
- DataTable dtDefect = dvDefect.ToTable();
- for (int row = 0; row < dtDefect.Rows.Count; row++)
- {
- // 产品缺陷
- SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
- //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
- //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
- //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
- //{
- // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
- //}
- //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
- if (dtDefect.Rows[row]["DefectID"].ToString() != "")
- {
- defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
- }
- defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
- defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
- if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
- {
- defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
- }
- defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
- defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
- if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
- {
- defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
- }
- defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
- defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
- if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
- {
- defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
- }
- defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
- defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
- //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
- //{
- // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
- //}
- //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
- //{
- // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
- //}
- //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
- //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
- //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
- defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
- if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
- {
- defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
- }
- if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
- {
- defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
- }
- //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
- //{
- // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
- //}
- //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
- //--------责任员工-------------------
- DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
- if (drRow.Length > Constant.INT_IS_ZERO)
- {
- if (defect.DefectResponsibles == null)
- {
- defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
- }
- foreach (DataRow r in drRow)
- {
- SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
- if (r["SemiCheckDefectID"].ToString() != "")
- {
- defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
- }
- if (r["StaffID"].ToString() != "")
- {
- defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
- }
- defectResponsible.StaffCode = r["StaffCode"].ToString();
- defectResponsible.StaffName = r["StaffName"].ToString();
- if (r["StaffStatus"].ToString() != "")
- {
- defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
- }
- if (r["UJobsID"].ToString() != "")
- {
- defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
- }
- if (r["SJobsID"].ToString() != "")
- {
- defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
- }
- defect.DefectResponsibles.Add(defectResponsible);
- }
- }
- //------------------------------
- if (productionData.SemiCheckDefects == null)
- {
- productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
- }
- productionData.SemiCheckDefects.Add(defect);
- }
- //if (productionDatas.PDAProductionData == null)
- //{
- // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
- //}
- productionDatas[0] = productionData;
- //---------------------------------------------------------------------------------
- }
- }
- }
- actionResult.Result = JsonHelper.ToJson(productionDatas);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 保存半检登记
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="entity">半检实体类</param>
- /// <param name="sUserInfo">用户基本信息</param>
- /// <returns></returns>
- public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
- string err = string.Empty;
- err = resultEntity.Message;
- if (err == null)
- {
- err = "";
- }
- SemiCheckEntity entity = entityobj[0];
- if (entity.SemiCheckCategory == 1) // 半检登记
- {
- }
- else if (entity.SemiCheckCategory == 2)// 复检登记
- {
- err = JsonHelper.ToJson(err);
- }
- else if (entity.SemiCheckCategory == 3)// 撤销复检
- {
- err = JsonHelper.ToJson(err);
- }
- //actionResult.Result = JsonHelper.ToJson(err);
- actionResult.Result = err;//JsonHelper.ToJson(err);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 根据所选工号,查出缺陷责任员工
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
- actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取半成品缺陷管理的全部数据
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
- () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取半成品缺陷位置管理的全部数据
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
- () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 复检验条码
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
- if (Convert.ToInt32(resultEntity.Result) < 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- actionResult.Message = resultEntity.Message;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 撤销复检验条码
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
- if (Convert.ToInt32(resultEntity.Result) < 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- actionResult.Message = resultEntity.Message;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 恢复数据
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int resultEntity = ServiceInvoker.Invoke<int>(this,
- () => PMModuleLogicDAL.ResetBarCode(barcode));
- if (resultEntity > 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Message = "恢复数据成功";
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- if (resultEntity == -1)
- {
- actionResult.Message = "此条码没有清除,不能恢复";
- }
- else if (resultEntity == 0)
- {
- actionResult.Message = "没有可恢复的数据";
- }
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 通过SettingCode获取系统参数管理的数据
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="settingcode">设置编码</param>
- /// <returns></returns>
- public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
- () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 校验条码是否允许撤销,如果不允许提示错误消息
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="orgTime">原时间</param>
- /// <param name="days">允许撤销天数</param>
- /// <param name="settingCode">设置code,用于返回不同错误消息</param>
- /// <returns></returns>
- public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- string[] subOrgTime = orgTime.Split('-');
- DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
- ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
- if (Convert.ToInt32(resultEntity.Result) < 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- actionResult.Message = resultEntity.Message;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取生产订单管理的全部数据
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.GetOrderList(order, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
- if (Convert.ToInt32(resultEntity.Result) < 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
- }
- else
- {
- actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- actionResult.Message = resultEntity.Message;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
- () => SystemModuleLogic.GetSystemData(sUserInfo));
- actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
- ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
- if (Convert.ToInt32(resultEntity.Result) < 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- actionResult.Message = resultEntity.Message;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
- if (Convert.ToInt32(resultEntity.Result) < 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- else
- {
- actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- actionResult.Message = resultEntity.Message;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
- if (Convert.ToInt32(resultEntity.Result) < 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- actionResult.Message = resultEntity.Message;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
- if (Convert.ToInt32(resultEntity.Result) < 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- actionResult.Message = resultEntity.Message;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #region PDA条码打印
- /// <summary>
- /// 获取条码打印机
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo);
- actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 打印条码样式
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey
- , string barcode, int copies, int printerID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
- copies, printerID, sUserInfo);
- if (sre.Status != Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.ServiceResultStatus.Other;
- actionResult.Message = sre.Message;
- return actionResult;
- }
- actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion PDA条码打印
- #region 统计报表
- /// <summary>
- /// 成型结算报表
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <returns></returns>
- public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
- int currentMonth)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DateTime date = DateTime.Now;
- if (currentMonth != 1)
- {
- date = date.AddMonths(-1);
- }
- ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
- if (resultEntity == null || resultEntity.Data == null)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "查询失败";
- return actionResult;
- }
- if (resultEntity.Status == Constant.ServiceResultStatus.Other)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = resultEntity.Message;
- return actionResult;
- }
- actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- #region 设置当期用户默认打印机配置
- /// <summary>
- /// 设置当期用户默认打印机配置
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="printerID"></param>
- /// <returns></returns>
- public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
- int printerID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
- if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- actionResult.Message = resultEntity.Message;
- }
- catch (Exception ex)
- {
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 校验产品条码是否可以进行回收
- /// </summary>
- /// <param name="accountCode">帐套code</param>
- /// <param name="userCode">用户code</param>
- /// <param name="userPassword">用户密码</param>
- /// <param name="sessionKey">本次登陆密钥</param>
- /// <param name="procedureID">工序ID</param>
- /// <param name="barcode">条码</param>
- /// <returns></returns>
- /// <remarks>
- /// 王鑫 2017.7.21 新建
- /// </remarks>
- public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
- () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
- if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
- {
- actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取回收标识
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="usercode">工号编码</param>
- /// <returns></returns>
- public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- int returnValue = ServiceInvoker.Invoke<int>(this,
- () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- #region 注浆盘点
- /// <summary>
- /// 获取注浆盘点单列表
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
- entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(ds);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- string json = JsonHelper.ToJson(entity);
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 进行盘点操作
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="InCheckedID">盘点单ID</param>
- /// <param name="BarCode">产品条码</param>
- /// <returns></returns>
- public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.Properties["CheckedID"] = CheckedID;
- cre.Properties["Barcode"] = BarCode;
- ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
- if (returnValue.Status == Constant.ServiceResultStatus.Success)
- {
- //actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Message = "产品【" + BarCode + "】盘点成功";
- }
- else
- {
- //actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = returnValue.Message;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取盘点单明细
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
- GetUpdateGBCheckedInfo(checkedID, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(ds);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- #region 模具盘点
- /// <summary>
- /// 获取模具盘点单列表
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
- entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(ds);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 进行盘点操作
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="InCheckedID">盘点单ID</param>
- /// <param name="BarCode">产品条码</param>
- /// <returns></returns>
- public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.Properties["CheckedID"] = CheckedID;
- cre.Properties["Barcode"] = BarCode;
- ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
- () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
- if (returnValue.Status == Constant.ServiceResultStatus.Success)
- {
- //actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Message = "产品【" + BarCode + "】盘点成功";
- }
- else
- {
- //actionResult.Result = JsonHelper.ToJson(returnValue);
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = returnValue.Message;
- }
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- /// <summary>
- /// 获取盘点单明细
- /// </summary>
- /// <param name="sUserInfo"></param>
- /// <returns></returns>
- public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
- {
- ActionResult actionResult = new ActionResult();
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
- () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
- GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
- actionResult.Result = JsonHelper.ToJson(ds);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- #region 通用接口
- /// <summary>
- /// PDA调用通用接口
- /// </summary>
- /// <param name="accountCode"></param>
- /// <param name="userCode"></param>
- /// <param name="userPassword"></param>
- /// <param name="sessionKey"></param>
- /// <param name="module"></param>
- /// <param name="action"></param>
- /// <param name="data"></param>
- /// <returns></returns>
- public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
- string module, string action, string jsonData)
- {
- ActionResult actionResult = null;
- try
- {
- // 验证请求头信息
- actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
- // 验证失败
- if (actionResult.Status != (int)Constant.PDAResult.Success)
- {
- return actionResult;
- }
- actionResult.Status = (int)Constant.PDAResult.Fail;
- Dictionary<string, object> data = null;
- if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
- {
- data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
- }
- #region PDA报表
- if (module == "Report")
- {
- // 成型月度结算
- if (action == "GetGroutingSettlementInfo")
- {
- DateTime month = DateTime.Now;
- month = new DateTime(month.Year, month.Month, 1);
- //month = new DateTime(2017, 6, 1);
- int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
- if (currentMonth != 1)
- {
- month = month.AddMonths(-1);
- }
- ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- // 成型月度结算-明细
- if (action == "GetGroutingSettlementDetail")
- {
- DateTime month = DateTime.Now;
- month = new DateTime(month.Year, month.Month, 1);
- //month = new DateTime(2017, 6, 1);
- int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
- if (currentMonth != 1)
- {
- month = month.AddMonths(-1);
- }
- string goodsCode = data["GoodsCode"].ToString();
- string detailDate = data["DetailDate"].ToString();
- DateTime? date = null;
- if (detailDate != "合计")
- {
- date = DateTime.Parse(detailDate);
- }
- ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- // 产成品交接汇总
- if (action == "GetFinishedProductHandoverSum")
- {
- DateTime date = DateTime.Parse(data["date"].ToString());
- ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
- data["goodscode"] as string, sUserInfo);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data);
- }
- else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- //xuwei add 2019-10-21
- //统计当前工号,当日,按产品编码分组统计半检返修数据数量
- if (action == "GetSemiReworkDayCount")
- {
- //不指定参数查询当天
- string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
- //dateStr = "2019-10-17";
- //指定参数查询特定日期
- if(data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
-
- ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- //xuwe end
- return actionResult;
- }
- #endregion
- #region 模具管理
- if (module == "PC_Mould")
- {
- #region 模具新建画面数据初始化
- if (action == "GetMouldAddInit")
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.Properties["MouldID"] = 0;
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- #endregion
- #region 验证模具产品型号
- if (action == "CheckGoodsCodeOnMould")
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.Properties["GoodsCode"] = data["GoodsCode"];
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
- if (sre.Status == Constant.ServiceResultStatus.Success &&
- sre.Data.Tables[0].Rows.Count > 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "无效产品型号";
- }
- return actionResult;
- }
- #endregion
- #region 验证模具生产工号
- if (action == "CheckUserCodeOnMould")
- {
- DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
- if (sre != null && sre.Rows.Count > 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "无效生产工号";
- }
- return actionResult;
- }
- #endregion
- #region 新建保存
- if (action == "SetMouldAdd" || action == "SetMouldEdit")
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- foreach (string item in data.Keys)
- {
- if (item == "ProductionDate")
- {
- cre.Properties.Add(item, Convert.ToDateTime(data[item]));
- }
- else
- {
- cre.Properties.Add(item, data[item]);
- }
- }
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = sre.OtherStatus;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- #endregion
- #region 模具编辑画面数据初始化
- if (action == "GetMouldEditInfo")
- {
- DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
- if (sre != null && sre.Rows.Count > 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "无效模具条码";
- }
- return actionResult;
- }
- #endregion
- #region 模具操作-画面初始化
- if (action == "GetMouldOperationInit")
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.Properties["MouldOperationType"] = data["MouldOperationType"];
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = sre.OtherStatus;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- #endregion
- #region 模具操作-验证模具条码
- if (action == "CheckMouldBarcode")
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.Properties["MouldBarcode"] = data["MouldBarcode"];
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- if (sre.Data.Tables[0].Rows.Count == 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = -1;
- actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
- return actionResult;
- }
- int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
- int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
- string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
- #region 报损
- if (mouldOperationType == 2)
- {
- if (mouldStatusID == 1 || mouldStatusID == 3)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = -2;
- actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
- }
- return actionResult;
- }
- #endregion
- #region 撤销
- if (mouldOperationType == 3)
- {
- if (mouldStatusID == 4)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = -2;
- actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
- }
- return actionResult;
- }
- #endregion
- #region 领用
- if (mouldOperationType == 4)
- {
- if (mouldStatusID == 1)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = -2;
- actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
- }
- return actionResult;
- }
- #endregion
- #region 回收
- if (mouldOperationType == 5)
- {
- if (mouldStatusID == 3)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = -2;
- actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
- }
- return actionResult;
- }
- #endregion
- #region 变更型号
- if (mouldOperationType == -1)
- {
- if (mouldStatusID != 4)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = -2;
- actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
- }
- return actionResult;
- }
- #endregion
- #region 替换条码
- if (mouldOperationType == -2)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- return actionResult;
- }
- #endregion
- return actionResult;
- }
- }
- #endregion
- #region 模具操作-保存
- if (action == "SetMouldOperation")
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
- cre.Properties["MouldOperationType"] = data["MouldOperationType"];
- cre.Properties["Remarks"] = data["Remarks"];
- int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
- if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
- {
- cre.Properties["GoodsID"] = data["GoodsID"];
- cre.Properties["GoodsCode"] = data["GoodsCode"];
- }
- else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
- {
- cre.Properties["ScrapReason"] = data["ScrapReason"];
- cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
- }
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- return actionResult;
- }
- #endregion
- #region 模具操作-替换条码
- if (action == "ChangedMouldBarcode")
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.Properties["MouldID"] = data["MouldID"];
- cre.Properties["MouldBarcode"] = data["MouldBarcode"];
- cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
- cre.Properties["Remarks"] = data["Remarks"];
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = sre.OtherStatus;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- #endregion
- #region 模具跟踪表
- if (action == "GetMoldTracking")
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.Properties["MouldBarcode"] = data["MouldBarcode"];
- ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "此模具条码不存在";
- }
- return actionResult;
- }
- #endregion
- return actionResult;
- }
- #endregion
- #region 成型线模具管理
- if (module == "PC_GroutingLineMould")
- {
- #region 获取当前用户成型线模具管理权限
- if (action == "GetGMouldStatusRight")
- {
- DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
- actionResult.Status = (int)Constant.PDAResult.Success;
- if (right != null && right.Rows.Count > 0)
- {
- actionResult.Result = JsonHelper.ToJson(right);
- }
- return actionResult;
- }
- #endregion
- #region 获取成型线状态等信息,和成型模具信息
- if (action == "GetGroutingLineMould")
- {
- int? groutingLineID = null;
- string groutingLineCode = null;
- if (data.ContainsKey("GroutingLineID"))
- {
- groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
- }
- else
- {
- groutingLineCode = data["GroutingLineCode"] + "";
- }
- DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
- if (lineInfo == null)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(lineInfo);
- }
- return actionResult;
- }
- #endregion
- #region 模具操作-画面初始化
- if (action == "GetMouldOperationInit")
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.Properties["MouldOperationType"] = 2;
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = sre.OtherStatus;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- #endregion
- #region 成型模具操作-画面初始化
- if (action == "GetGroutingMouldOperationInit")
- {
- DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
- if (initData != null && initData.Rows.Count > 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- Dictionary<string, string> syssetting = new Dictionary<string, string>();
- foreach (DataRow item in initData.Rows)
- {
- syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
- }
- actionResult.Result = JsonHelper.ToJson(syssetting);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- return actionResult;
- }
- #endregion
- #region 模具操作-验证模具条码
- if (action == "CheckMouldBarcode")
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.Properties["MouldBarcode"] = data["MouldBarcode"];
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- if (sre.Data.Tables[0].Rows.Count == 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = -1;
- actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
- return actionResult;
- }
- int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
- int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
- string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
- #region 上线
- if (mouldOperationType == 6)
- {
- if (mouldStatusID == 1 || mouldStatusID == 3)
- {
- if (data.ContainsKey("GoodsID"))
- {
- if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = -3;
- actionResult.Message =
- "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
- sre.Data.Tables[0].Rows[0]["GoodsCode"] +
- "】与当前不一致";
- return actionResult;
- }
- }
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = -2;
- actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
- }
- return actionResult;
- }
- #endregion
- return actionResult;
- }
- }
- #endregion
- #region 停用
- if (action == "StopGroutingLineDetail")
- {
- if (data == null || !data.ContainsKey("Details"))
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "参数错误";
- return actionResult;
- }
- Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
- DataTable gTable = new DataTable();
- gTable.Columns.Add("GroutingLineID", typeof(int));
- gTable.Columns.Add("GroutingLineCode");
- gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("GroutingLineDetailID", typeof(int));
- gTable.Columns.Add("GroutingMouldCode");
- gTable.Columns.Add("RecordRemarks");
- gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("MouldID", typeof(int));
- gTable.Columns.Add("MouldCode");
- int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
- string groutingLineCode = data["GroutingLineCode"] + "";
- DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
- foreach (Dictionary<string, object> item in details)
- {
- int? mouldID = null;
- if (item.ContainsKey("MouldID"))
- {
- mouldID = Convert.ToInt32(item["MouldID"]);
- if (mouldID == 0)
- {
- mouldID = null;
- }
- }
- gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
- item["GLineDetailID"], item["GLineDetailCode"],
- item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
- mouldID, item["MouldCode"]);
- }
- int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
- if (result > 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = result;
- actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
- return actionResult;
- }
- return actionResult;
- }
- #endregion
- #region 启用
- if (action == "StartGroutingLineDetail")
- {
- if (data == null || !data.ContainsKey("Details"))
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "参数错误";
- return actionResult;
- }
- Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
- DataTable gTable = new DataTable();
- gTable.Columns.Add("GroutingLineID", typeof(int));
- gTable.Columns.Add("GroutingLineCode");
- gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("GroutingLineDetailID", typeof(int));
- gTable.Columns.Add("GroutingMouldCode");
- gTable.Columns.Add("RecordRemarks");
- gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("MouldID", typeof(int));
- gTable.Columns.Add("MouldCode");
- int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
- string groutingLineCode = data["GroutingLineCode"] + "";
- DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
- foreach (Dictionary<string, object> item in details)
- {
- int? mouldID = null;
- if (item.ContainsKey("MouldID"))
- {
- mouldID = Convert.ToInt32(item["MouldID"]);
- if (mouldID == 0)
- {
- mouldID = null;
- }
- }
- gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
- item["GLineDetailID"], item["GLineDetailCode"],
- item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
- mouldID, item["MouldCode"]);
- }
- int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
- if (result > 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = result;
- actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
- return actionResult;
- }
- return actionResult;
- }
- #endregion
- #region 维修
- if (action == "RepairStartGroutingLineDetail")
- {
- if (data == null || !data.ContainsKey("Details"))
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "参数错误";
- return actionResult;
- }
- Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
- DataTable gTable = new DataTable();
- gTable.Columns.Add("GroutingLineID", typeof(int));
- gTable.Columns.Add("GroutingLineCode");
- gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("GroutingLineDetailID", typeof(int));
- gTable.Columns.Add("GroutingMouldCode");
- gTable.Columns.Add("RecordRemarks");
- gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("MouldID", typeof(int));
- gTable.Columns.Add("MouldCode");
- int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
- string groutingLineCode = data["GroutingLineCode"] + "";
- DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
- foreach (Dictionary<string, object> item in details)
- {
- int? mouldID = null;
- if (item.ContainsKey("MouldID"))
- {
- mouldID = Convert.ToInt32(item["MouldID"]);
- if (mouldID == 0)
- {
- mouldID = null;
- }
- }
- gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
- item["GLineDetailID"], item["GLineDetailCode"],
- item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
- mouldID, item["MouldCode"]);
- }
- int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
- if (result > 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = result;
- actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
- return actionResult;
- }
- return actionResult;
- }
- #endregion
- #region 结束维修
- if (action == "RepairEndGroutingLineDetail")
- {
- if (data == null || !data.ContainsKey("Details"))
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "参数错误";
- return actionResult;
- }
- Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
- DataTable gTable = new DataTable();
- gTable.Columns.Add("GroutingLineID", typeof(int));
- gTable.Columns.Add("GroutingLineCode");
- gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("GroutingLineDetailID", typeof(int));
- gTable.Columns.Add("GroutingMouldCode");
- gTable.Columns.Add("RecordRemarks");
- gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("MouldID", typeof(int));
- gTable.Columns.Add("MouldCode");
- int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
- string groutingLineCode = data["GroutingLineCode"] + "";
- DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
- foreach (Dictionary<string, object> item in details)
- {
- int? mouldID = null;
- if (item.ContainsKey("MouldID"))
- {
- mouldID = Convert.ToInt32(item["MouldID"]);
- if (mouldID == 0)
- {
- mouldID = null;
- }
- }
- gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
- item["GLineDetailID"], item["GLineDetailCode"],
- item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
- mouldID, item["MouldCode"]);
- }
- int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
- if (result > 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = result;
- actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
- return actionResult;
- }
- return actionResult;
- }
- #endregion
- #region 换模
- if (action == "ChangeGMouldStartGroutingLineDetail")
- {
- if (data == null || !data.ContainsKey("Details"))
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "参数错误";
- return actionResult;
- }
- Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
- DataTable gTable = new DataTable();
- gTable.Columns.Add("GroutingLineID", typeof(int));
- gTable.Columns.Add("GroutingLineCode");
- gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("GroutingLineDetailID", typeof(int));
- gTable.Columns.Add("GroutingMouldCode");
- gTable.Columns.Add("RecordRemarks");
- gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("MouldID", typeof(int));
- gTable.Columns.Add("MouldCode");
- gTable.Columns.Add("MouldOutputNo", typeof(int));
- gTable.Columns.Add("MouldStatus", typeof(int));
- gTable.Columns.Add("ScrapReason", typeof(int));
- gTable.Columns.Add("ScrapResponsibility");
- int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
- string groutingLineCode = data["GroutingLineCode"] + "";
- DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
- int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
- int scrapReason = Convert.ToInt32(data["ScrapReason"]);
- string scrapResponsibility = data["ScrapRemarks"] + "";
- foreach (Dictionary<string, object> item in details)
- {
- int? mouldID = null;
- if (item.ContainsKey("MouldID"))
- {
- mouldID = Convert.ToInt32(item["MouldID"]);
- if (mouldID == 0)
- {
- mouldID = null;
- }
- }
- gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
- item["GLineDetailID"], item["GLineDetailCode"],
- item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
- mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
- (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
- }
- int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
- if (result > 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = result;
- actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
- return actionResult;
- }
- return actionResult;
- }
- #endregion
- #region 变产
- if (action == "UpdateLineStartGroutingLineDetail")
- {
- if (data == null || !data.ContainsKey("Details"))
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "参数错误";
- return actionResult;
- }
- Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
- DataTable gTable = new DataTable();
- gTable.Columns.Add("GroutingLineID", typeof(int));
- gTable.Columns.Add("GroutingLineCode");
- gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("GroutingLineDetailID", typeof(int));
- gTable.Columns.Add("GroutingMouldCode");
- gTable.Columns.Add("RecordRemarks");
- gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("MouldID", typeof(int));
- gTable.Columns.Add("MouldCode");
- gTable.Columns.Add("MouldOutputNo", typeof(int));
- gTable.Columns.Add("MouldStatus", typeof(int));
- gTable.Columns.Add("ScrapReason", typeof(int));
- gTable.Columns.Add("ScrapResponsibility");
- int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
- string groutingLineCode = data["GroutingLineCode"] + "";
- DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
- int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
- int scrapReason = Convert.ToInt32(data["ScrapReason"]);
- string scrapResponsibility = data["ScrapRemarks"] + "";
- foreach (Dictionary<string, object> item in details)
- {
- int? mouldID = null;
- if (item.ContainsKey("MouldID"))
- {
- mouldID = Convert.ToInt32(item["MouldID"]);
- if (mouldID == 0)
- {
- mouldID = null;
- }
- }
- gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
- item["GLineDetailID"], item["GLineDetailCode"],
- item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
- mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
- (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
- }
- int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
- if (result > 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = result;
- actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
- return actionResult;
- }
- return actionResult;
- }
- #endregion
- #region 整线变产
- if (action == "UpdateAllLineStartGroutingLineDetail")
- {
- if (data == null || !data.ContainsKey("Details"))
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "参数错误";
- return actionResult;
- }
- Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
- DataTable gTable = new DataTable();
- gTable.Columns.Add("GroutingLineID", typeof(int));
- gTable.Columns.Add("GroutingLineCode");
- gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("GroutingLineDetailID", typeof(int));
- gTable.Columns.Add("GroutingMouldCode");
- gTable.Columns.Add("RecordRemarks");
- gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("MouldID", typeof(int));
- gTable.Columns.Add("MouldCode");
- gTable.Columns.Add("MouldOutputNo", typeof(int));
- gTable.Columns.Add("MouldStatus", typeof(int));
- gTable.Columns.Add("ScrapReason", typeof(int));
- gTable.Columns.Add("ScrapResponsibility");
- int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
- string groutingLineCode = data["GroutingLineCode"] + "";
- DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
- int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
- int scrapReason = Convert.ToInt32(data["ScrapReason"]);
- string scrapResponsibility = data["ScrapRemarks"] + "";
- foreach (Dictionary<string, object> item in details)
- {
- int? mouldID = null;
- if (item.ContainsKey("MouldID"))
- {
- mouldID = Convert.ToInt32(item["MouldID"]);
- if (mouldID == 0)
- {
- mouldID = null;
- }
- }
- gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
- item["GLineDetailID"], item["GLineDetailCode"],
- item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
- mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
- (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
- }
- int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
- if (result > 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = result;
- actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
- return actionResult;
- }
- return actionResult;
- }
- #endregion
- #region 卸模
- if (action == "UnloadGroutingLineDetail")
- {
- if (data == null || !data.ContainsKey("Details"))
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "参数错误";
- return actionResult;
- }
- Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
- DataTable gTable = new DataTable();
- gTable.Columns.Add("GroutingLineID", typeof(int));
- gTable.Columns.Add("GroutingLineCode");
- gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("GroutingLineDetailID", typeof(int));
- gTable.Columns.Add("GroutingMouldCode");
- gTable.Columns.Add("RecordRemarks");
- gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("MouldID", typeof(int));
- gTable.Columns.Add("MouldCode");
- gTable.Columns.Add("MouldOutputNo", typeof(int));
- gTable.Columns.Add("MouldStatus", typeof(int));
- gTable.Columns.Add("ScrapReason", typeof(int));
- gTable.Columns.Add("ScrapResponsibility");
- int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
- string groutingLineCode = data["GroutingLineCode"] + "";
- DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
- int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
- int scrapReason = Convert.ToInt32(data["ScrapReason"]);
- string scrapResponsibility = data["ScrapRemarks"] + "";
- foreach (Dictionary<string, object> item in details)
- {
- int? mouldID = null;
- if (item.ContainsKey("MouldID"))
- {
- mouldID = Convert.ToInt32(item["MouldID"]);
- if (mouldID == 0)
- {
- mouldID = null;
- }
- }
- gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
- item["GLineDetailID"], item["GLineDetailCode"],
- item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
- mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
- (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
- }
- int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
- if (result > 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = result;
- actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
- return actionResult;
- }
- return actionResult;
- }
- #endregion
- #region 结束换模
- if (action == "ChangeGMouldEndGroutingLineDetail")
- {
- if (data == null || !data.ContainsKey("Details"))
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "参数错误";
- return actionResult;
- }
- Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
- DataTable gTable = new DataTable();
- gTable.Columns.Add("GroutingLineID", typeof(int));
- gTable.Columns.Add("GroutingLineCode");
- gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("GroutingLineDetailID", typeof(int));
- gTable.Columns.Add("GroutingMouldCode");
- gTable.Columns.Add("RreasonRemarks");
- gTable.Columns.Add("RecordRemarks");
- gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("MouldID", typeof(int));
- gTable.Columns.Add("MouldCode");
- gTable.Columns.Add("MouldOutputNo", typeof(int));
- gTable.Columns.Add("GoodsID", typeof(int));
- gTable.Columns.Add("GoodsCode");
- gTable.Columns.Add("StandardGroutingCount", typeof(int));
- gTable.Columns.Add("GroutingCount", typeof(int));
- gTable.Columns.Add("MouldSource");
- int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
- string groutingLineCode = data["GroutingLineCode"] + "";
- DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
- foreach (Dictionary<string, object> item in details)
- {
- int? mouldID = null;
- if (item.ContainsKey("MouldID"))
- {
- mouldID = Convert.ToInt32(item["MouldID"]);
- if (mouldID == 0)
- {
- mouldID = null;
- }
- }
- gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
- item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
- item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
- mouldID, item["MouldCode"], item["MouldOutputNo"],
- item["GoodsID"], item["GoodsCode"],
- item["StandardGroutingCount"], item["GroutingCount"],
- (mouldID == null ? "0" : "1"));
- }
- ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
- if (result.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else if (result.OtherStatus == -100)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = -100;
- actionResult.Message = result.Message;
- return actionResult;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = -500;
- actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
- return actionResult;
- }
- return actionResult;
- }
- #endregion
- #region 结束变产
- if (action == "UpdateLineEndGroutingLineDetail")
- {
- if (data == null || !data.ContainsKey("Details"))
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "参数错误";
- return actionResult;
- }
- Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
- DataTable gTable = new DataTable();
- gTable.Columns.Add("GroutingLineID", typeof(int));
- gTable.Columns.Add("GroutingLineCode");
- gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("GroutingLineDetailID", typeof(int));
- gTable.Columns.Add("GroutingMouldCode");
- gTable.Columns.Add("RreasonRemarks");
- gTable.Columns.Add("RecordRemarks");
- gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("MouldID", typeof(int));
- gTable.Columns.Add("MouldCode");
- gTable.Columns.Add("MouldOutputNo", typeof(int));
- gTable.Columns.Add("GoodsID", typeof(int));
- gTable.Columns.Add("GoodsCode");
- gTable.Columns.Add("StandardGroutingCount", typeof(int));
- gTable.Columns.Add("GroutingCount", typeof(int));
- gTable.Columns.Add("MouldSource");
- int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
- string groutingLineCode = data["GroutingLineCode"] + "";
- DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
- foreach (Dictionary<string, object> item in details)
- {
- int? mouldID = null;
- if (item.ContainsKey("MouldID"))
- {
- mouldID = Convert.ToInt32(item["MouldID"]);
- if (mouldID == 0)
- {
- mouldID = null;
- }
- }
- gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
- item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
- item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
- mouldID, item["MouldCode"], item["MouldOutputNo"],
- item["GoodsID"], item["GoodsCode"],
- item["StandardGroutingCount"], item["GroutingCount"],
- (mouldID == null ? "0" : "1"));
- }
- ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
- if (result.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else if (result.OtherStatus == -100)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = -100;
- actionResult.Message = result.Message;
- return actionResult;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = -500;
- actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
- return actionResult;
- }
- return actionResult;
- }
- #endregion
- #region 结束整线变产
- if (action == "UpdateAllLineEndGroutingLineDetail")
- {
- if (data == null || !data.ContainsKey("Details"))
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "参数错误";
- return actionResult;
- }
- Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
- DataTable gTable = new DataTable();
- gTable.Columns.Add("GroutingLineID", typeof(int));
- gTable.Columns.Add("GroutingLineCode");
- gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("GroutingLineDetailID", typeof(int));
- gTable.Columns.Add("GroutingMouldCode");
- gTable.Columns.Add("Remarks");
- gTable.Columns.Add("RecordRemarks");
- //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("MouldID", typeof(int));
- gTable.Columns.Add("MouldCode");
- gTable.Columns.Add("MouldOutputNo", typeof(int));
- gTable.Columns.Add("GoodsID", typeof(int));
- gTable.Columns.Add("GoodsCode");
- gTable.Columns.Add("StandardGroutingCount", typeof(int));
- gTable.Columns.Add("GroutingCount", typeof(int));
- gTable.Columns.Add("MouldSource");
- int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
- string groutingLineCode = data["GroutingLineCode"] + "";
- DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
- foreach (Dictionary<string, object> item in details)
- {
- int? mouldID = null;
- if (item.ContainsKey("MouldID"))
- {
- mouldID = Convert.ToInt32(item["MouldID"]);
- if (mouldID == 0)
- {
- mouldID = null;
- }
- }
- gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
- item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
- item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
- mouldID, item["MouldCode"], item["MouldOutputNo"],
- item["GoodsID"], item["GoodsCode"],
- item["StandardGroutingCount"], item["GroutingCount"],
- (mouldID == null ? "0" : "1"));
- }
- ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
- if (result.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else if (result.OtherStatus == -100)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = -100;
- actionResult.Message = result.Message;
- return actionResult;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = -500;
- actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
- return actionResult;
- }
- return actionResult;
- }
- #endregion
- #region 上模
- if (action == "UpdateGroutingLine_AddMould")
- {
- if (data == null || !data.ContainsKey("Details"))
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "参数错误";
- return actionResult;
- }
- Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
- DataTable gTable = new DataTable();
- gTable.Columns.Add("GroutingLineID", typeof(int));
- gTable.Columns.Add("GroutingLineCode");
- gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("GroutingLineDetailID", typeof(int));
- gTable.Columns.Add("GroutingMouldCode");
- gTable.Columns.Add("Remarks");
- gTable.Columns.Add("RecordRemarks");
- gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
- gTable.Columns.Add("MouldID", typeof(int));
- gTable.Columns.Add("MouldCode");
- gTable.Columns.Add("MouldOutputNo", typeof(int));
- gTable.Columns.Add("GoodsID", typeof(int));
- gTable.Columns.Add("GoodsCode");
- gTable.Columns.Add("StandardGroutingCount", typeof(int));
- gTable.Columns.Add("GroutingCount", typeof(int));
- gTable.Columns.Add("MouldSource");
- int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
- string groutingLineCode = data["GroutingLineCode"] + "";
- DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
- foreach (Dictionary<string, object> item in details)
- {
- int? mouldID = null;
- if (item.ContainsKey("MouldID"))
- {
- mouldID = Convert.ToInt32(item["MouldID"]);
- if (mouldID == 0)
- {
- mouldID = null;
- }
- }
- int gldID = Convert.ToInt32(item["GLineDetailID"]);
- gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
- gldID, item["GLineDetailCode"],
- item["DetailRemarks"], item["RecordRemarks"],
- (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
- mouldID, item["MouldCode"], item["MouldOutputNo"],
- item["GoodsID"], item["GoodsCode"],
- item["StandardGroutingCount"], item["GroutingCount"],
- (mouldID == null ? "0" : "1"));
- }
- ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
- if (result.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else if (result.OtherStatus == -2 || result.OtherStatus == -100)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = result.OtherStatus;
- actionResult.Message = result.Message;
- return actionResult;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = -500;
- actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
- return actionResult;
- }
- return actionResult;
- }
- #endregion
- return actionResult;
- }
- #endregion
- #region 包装装板限制
- if (module == "FinishedLoadingCar")
- {
- if (action == "GetSetting")
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.Properties["GoodsID"] = data["GoodsID"];
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- foreach (DataRow item in sre.Data.Tables[0].Rows)
- {
- if (item["settingcode"].ToString() == "S_PM_011")
- {
- cre.Properties["S_PM_011"] = item["settingvalue"];
- }
- else if (item["settingcode"].ToString() == "S_PM_012")
- {
- cre.Properties["S_PM_012"] = item["settingvalue"];
- }
- else if (item["settingcode"].ToString() == "S_PM_013")
- {
- cre.Properties["S_PM_013"] = item["settingvalue"];
- }
- }
- cre.Properties["PlatelitNum"] = sre.Result;
- actionResult.Result = JsonHelper.ToJson(cre.Properties);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "";
- }
- return actionResult;
- }
- }
- #endregion
- #region 成型报损
- if (module == "GroutingScrapProduct")
- {
- // 查询注浆日报明细表
- if ("GetGroutingDailyDetail" == action)
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = module;
- cre.Name = action;
- if (!string.IsNullOrEmpty(jsonData))
- {
- cre.Properties["BarCode"] = data["BarCode"];
- }
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
- //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
- || sre.Data.Tables[0].Rows.Count == 0)
- {
- actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- else
- {
- DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
- // 判断是否进行了注浆
- if ("0".Equals(_barCodeRow["GroutingFlag"]))
- {
- actionResult.Message = "该产品还未进行注浆!";
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- // 判断是否进行了交坯
- if ("1".Equals(_barCodeRow["DeliverFlag"]))
- {
- actionResult.Message = "该产品已经交坯!";
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- // 判断是否已经报损
- if ("1".Equals(_barCodeRow["ScrapFlag"]))
- {
- actionResult.Message = "该产品已经报损!";
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- }
- // 获取成型报损原因
- else if ("GetScrapReasonData" == action)
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = module;
- cre.Name = action;
- ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo);
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- // 保存成型报损
- else if ("SaveGroutingScrapProduct" == action)
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = module;
- cre.Name = action;
- if (!string.IsNullOrEmpty(jsonData))
- {
- // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
- DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
- DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
- if (dt != null && dt.Rows.Count > 0)
- {
- // 总单信息
- DataRow properties = dt.Rows[0];
- cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
- cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
- cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
- cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
- cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
- cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
- cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
- cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
- cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
- cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
- cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
- cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
- cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
- cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
- cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
- cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
- cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
- cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
- cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
- cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
- cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
- cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
- cre.Properties["Remarks"] = properties["Remarks"]; // 备注
- cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
- // 责任员工
- cre.Data = new DataSet();
- //DataTable returnTable = returnData.Tables[1].Copy();
- cre.Data.Tables.Add(dtResponsible);
- }
- }
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = sre.Result;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = sre.OtherStatus;
- actionResult.Message = sre.Message;
- }
- }
- // 获取成型报损信息 用于撤销使用
- else if ("GetGroutingScrapProduct" == action)
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = module;
- cre.Name = action;
- if (!string.IsNullOrEmpty(jsonData))
- {
- cre.Properties["BarCode"] = data["BarCode"];
- }
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- // 撤销成型报损
- else if ("ReverseGroutingScrapProduct" == action)
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = module;
- cre.Name = action;
- if (!string.IsNullOrEmpty(jsonData))
- {
- cre.Properties["BarCode"] = data["BarCode"];
- }
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = sre.Result;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = sre.OtherStatus;
- actionResult.Message = sre.Message;
- }
- }
- }
- #endregion
- #region 产品挂起
- if (module == "ProductSuspend")
- {
- // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
- if (action == "GetSuspendProcedure")
- {
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- // 验证挂起条码
- if (action == "CheckSuspendBarcode")
- {
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- // 挂起条码
- if (action == "SaveSuspendProduct")
- {
- int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
- int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- // 撤销挂起条码
- if (action == "DeleteSuspendProduct")
- {
- int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
- int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- // 查询挂起条码
- if (action == "GetSuspendProduct")
- {
- ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- if (sre.Data.Tables[0].Rows.Count == 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "此条码没有可撤销的挂起信息";
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- }
- #endregion
- #region 品保抽查
- if (module == "QASpotCheck")
- {
- if (action == "GetAllQASpotCheck")
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = module;
- cre.Name = action;
- if (data != null && data.Count > 0)
- {
- foreach (string item in data.Keys)
- {
- if (item.StartsWith("checktime"))
- {
- cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
- }
- else
- {
- cre.Properties.Add(item, data[item]);
- }
- }
- }
- ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- if (action == "AutoSaveQASpotCheck")
- {
- string barcode = data["barcode"] + "";
- string remarks = data["remarks"] + "";
- ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- if (action == "CheckQASpotCheck")
- {
- ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- if (action == "SaveQASpotCheck")
- {
- data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
- ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- return null;
- }
- #endregion
- #region 产成品交接
- if (module == "FinishedProduct")
- {
- // 设定商标
- if (action == "GetFinishedBarcode")
- {
- string barcode = data["barcode"].ToString();
- ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
- //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
- if (Convert.ToInt32(resultEntity.Result) < 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
- actionResult.Message = resultEntity.Message;
- }
- else
- {
- actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Message = resultEntity.Message;
- }
- return actionResult;
- }
- if (action == "GetHandoveredBarcode")
- {
- string barcode = data["barcode"].ToString();
- ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
- //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
- if (Convert.ToInt32(resultEntity.Result) < 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
- actionResult.Message = resultEntity.Message;
- }
- else
- {
- actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Message = resultEntity.Message;
- }
- return actionResult;
- }
- if (action == "SetFinishedLogo")
- {
- int logoid = Convert.ToInt32(data["logoid"]);
- string[] barcodes = data["barcodes"].ToString().Split(',');
- int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo);
- //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
- if (result < 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- return actionResult;
- }
- if (action == "SetHandoveredOrder")
- {
- int orderID = Convert.ToInt32(data["orderID"]);
- string[] barcodes = data["barcodes"].ToString().Split(',');
- int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
- //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
- if (result < 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- return actionResult;
- }
- }
- #endregion
- #region 产成品装车
- /*
- if (module == "FinishedLoading")
- {
- // 设定商标
- if (action == "GetMaxLoadingNo")
- {
- int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = no;
- return actionResult;
- }
- if (action == "CheckFinishedLaodingBarcode")
- {
- string barcode = data["barcode"].ToString();
- ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
- if (resultEntity.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Message = resultEntity.Message;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = resultEntity.OtherStatus;
- actionResult.Message = resultEntity.Message;
- }
- return actionResult;
- }
- if (action == "SaveFinishedLoading")
- {
- int loadingNo = Convert.ToInt32(data["loadingNo"]);
- string carLicense = data["carLicense"] + "";
- int palletNum = Convert.ToInt32(data["palletNum"]);
- int goodsNum = Convert.ToInt32(data["goodsNum"]);
- string remarks = data["remarks"] + "";
- Dictionary<string, object>[] details =
- JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
- //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
- ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
- loadingNo, carLicense, palletNum, goodsNum, remarks, details);
- if (result.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Message = result.Message;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = result.OtherStatus;
- actionResult.Message = result.Message;
- }
- return actionResult;
- }
- }
- */
- #endregion
- #region 产成品质量改判
- if (module == "FinishedProductTamper")
- {
- // 获取产成品信息及缺陷数据
- if (action == "GetDefectData")
- {
- string barcode = data["barcode"].ToString();
- ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Result);
- actionResult.Message = sre.Message;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = sre.OtherStatus;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- // 获取产成品信息及缺陷数据
- if (action == "SaveDefectData")
- {
- ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
- ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Message = sre.Message;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- // 通过条码查出责任工序(成品改判用)
- if (action == "GetDutyProcedureByBarCodeForTamper")
- {
- string barcode = data["barcode"] + "";
- int defectid = int.Parse(data["defectid"] + "");
- ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Data);
- actionResult.Message = sre.Message;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = sre.OtherStatus;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- }
- #endregion
- #region PDA独立功能
- #region 水效标识
- if (module == "WaterEffect")
- {
- // 获取产成品信息及水效标识
- if (action == "GetGoodsByBarCode")
- {
- string barcode = data["barcode"].ToString();
- ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- actionResult.Result = JsonHelper.ToJson(sre.Result);
- actionResult.Message = sre.Message;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = sre.OtherStatus;
- actionResult.Message = sre.Message;
- }
- return actionResult;
- }
- }
- #endregion
- #region 盖板型号
- if (module == "SeatCoverType")
- {
- // 获取产成品信息及水效标识
- if (action == "SendGoodsCodeToPLC")
- {
- string barcode = data["barcode"].ToString();
- int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
- if (sre == 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = sre;
- switch (sre)
- {
- case 1:
- case 2:
- actionResult.Message = "无效条码";
- break;
- case 3:
- actionResult.Message = "此产品型号没有设置盖板标识码";
- break;
- case 4:
- actionResult.Message = "当前用户没有设置PLC参数";
- break;
- case 5:
- actionResult.Message = "PLC参数设置不全";
- break;
- default:
- actionResult.Message = "PLC通信异常";
- break;
- }
- }
- return actionResult;
- }
- }
- #endregion
- #region PDA PLC 相关功能
- if (module == "PDA_FUN_PLC")
- {
- // PDA扫码发送到PLCServer
- if (action == "SendBarcodeToPLCServer")
- {
- string barcode = data["barcode"].ToString();
- int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
- if (sre == 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Result = sre;
- switch (sre)
- {
- case 1:
- case 2:
- actionResult.Message = "无效条码";
- break;
- case 3:
- actionResult.Message = "PLC通信异常";
- break;
- case 4:
- actionResult.Message = "当前用户没有设置PLC参数";
- break;
- case 5:
- actionResult.Message = "PLC参数设置不全";
- break;
- default:
- actionResult.Message = "PLC通信异常";
- break;
- }
- }
- return actionResult;
- }
- }
- #endregion
- #endregion
- #region 半检返修
- if (module == "SemiRework")
- {
- // 验证半检返修条码
- if (action == "CheckSemiReworkBarcode")
- {
- ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
- PMModuleLogic.CheckSemiReworkBarcode(jsonData);
- actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
- if (Convert.ToInt32(resultEntity.Result) < 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- actionResult.Message = resultEntity.Message;
- return actionResult;
- }
- // 可以返修的工序
- if (action == "GetSemiReworkProcedure")
- {
- ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
- PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
- actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
- actionResult.Status = (int)Constant.PDAResult.Success;
- return actionResult;
- }
- // 根据条码获取经过的工序,用于责任工序
- if (action == "GetSemiReworkPassProcedure")
- {
- ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
- PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
- actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
- actionResult.Status = (int)Constant.PDAResult.Success;
- return actionResult;
- }
- // 根据所选生产工序(生产数据ID)查询责任员工
- if (action == "GetSemiReworkDefectStaffByProductionDataID")
- {
- int productionDataID = Convert.ToInt32(jsonData);
- ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
- PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
- actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
- actionResult.Status = (int)Constant.PDAResult.Success;
- return actionResult;
- }
- // 根据所选工号,查出缺陷责任员工
- if (action == "GetSemiReworkDefectStaffByUserID")
- {
- int userID = Convert.ToInt32(jsonData);
- ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
- PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
- actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
- actionResult.Status = (int)Constant.PDAResult.Success;
- return actionResult;
- }
- // 新建半检返修
- if (action == "AddSemiRework")
- {
- SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"]+"");
- ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
- PMModuleLogic.AddSemiRework(entity, sUserInfo);
- actionResult.Result = resultEntity.Result;
- actionResult.Message = resultEntity.Message;
- if (Convert.ToInt32(resultEntity.Result) > 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- return actionResult;
- }
- // 编辑半检返修
- if (action == "EditSemiRework")
- {
- SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
- ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
- PMModuleLogic.EditSemiRework(entity, sUserInfo);
- actionResult.Result = resultEntity.Result;
- actionResult.Message = resultEntity.Message;
- if (Convert.ToInt32(resultEntity.Result) > 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- return actionResult;
- }
- // 撤销半检返修
- if (action == "CancelSemiRework")
- {
- SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
- ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
- PMModuleLogic.CancelSemiRework(entity, sUserInfo);
- actionResult.Result = resultEntity.Result;
- actionResult.Message = resultEntity.Message;
- if (Convert.ToInt32(resultEntity.Result) > 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- else
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- }
- return actionResult;
- }
- // 获取半检返修数据(PDA编辑用)
- if (action == "GetSemiReworkByID")
- {
- int id = Convert.ToInt32(jsonData);
- ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
- PMModuleLogic.GetSemiReworkByID(id,sUserInfo.UserCode);
- DataTable data1 = resultEntity.Data.Tables[0];
- DataTable data2 = resultEntity.Data.Tables[1];
- DataTable data3 = resultEntity.Data.Tables[2];
- if (data1.Rows.Count == 0)
- {
- actionResult.Status = (int)Constant.PDAResult.Fail;
- actionResult.Message = "半检返修信息不存在";
- return actionResult;
- }
- SemiReworkEntity srEntity = new SemiReworkEntity();
- srEntity.SemiReworkID = id;
- srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
- srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
- srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
- srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
- foreach (DataRow row2 in data2.Rows)
- {
- SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
- srEntity.SemiReworkDefects.Add(defectEntity);
- defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
- defectEntity.SemiReworkID = id;
- defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
- defectEntity.DefectCode = row2["DefectCode"] + "";
- defectEntity.DefectName = row2["DefectName"] + "";
- defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
- defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
- defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
- defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
- defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
- defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
- defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
- defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
- defectEntity.Remarks = row2["Remarks"] + "";
- defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
- defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
- defectEntity.DefectUserName = row2["DefectUserName"] + "";
- defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
- defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
- DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
- if (row3s.Length == 0)
- {
- continue;
- }
- foreach (DataRow row3 in row3s)
- {
- SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
- defectEntity.DefectResponsibles.Add(semiReworkRPS);
- semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
- semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
- semiReworkRPS.StaffName = row3["StaffName"] + "";
- semiReworkRPS.StaffCode = row3["StaffCode"] + "";
- semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
- semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
- semiReworkRPS.UserCode = row3["UserCode"] + "";
- semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
- semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
- }
- }
- //xuwei note 总单用于显示,信息较全
- actionResult.Message = JsonHelper.ToJson(data1);
- //xuwei note 总单信息不全,但有明细,用于回传保存
- actionResult.Result = JsonHelper.ToJson(srEntity);
- actionResult.Status = (int)Constant.PDAResult.Success;
- }
- }
- #endregion
- return actionResult;
- }
- catch (Exception ex)
- {
- //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
- OutputLog.TraceLog(LogPriority.Error,
- this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
- JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
- " module:" + module + " action:" + action + " json:" + jsonData,
- ex.ToString(),
- LocalPath.LogExePath);
- actionResult.Status = (int)Constant.PDAResult.Exception;
- actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
- }
- return actionResult;
- }
- #endregion
- }
- }
|