PDAModuleService.cs 385 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:PDAModuleService.cs
  5. * 2.功能描述:PDA模块WCF服务
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 陈晓野 2014/09/16 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.IO;
  14. using System.ServiceModel;
  15. using System.ServiceModel.Activation;
  16. using Curtain.Log;
  17. using Dongke.IBOSS.PRD.Basics.BaseResources;
  18. using Dongke.IBOSS.PRD.Basics.Library;
  19. using Dongke.IBOSS.PRD.Service.BarcodePrintService;
  20. using Dongke.IBOSS.PRD.Service.CommonModuleLogic;
  21. using Dongke.IBOSS.PRD.Service.DataModels;
  22. using Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic;
  23. using Dongke.IBOSS.PRD.Service.PCModuleLogic;
  24. using Dongke.IBOSS.PRD.Service.PDAModuleLogic;
  25. using Dongke.IBOSS.PRD.Service.PMModuleLogic;
  26. using Dongke.IBOSS.PRD.Service.PublicModuleService;
  27. using Dongke.IBOSS.PRD.Service.ReportModuleLogic;
  28. using Dongke.IBOSS.PRD.Service.SmartDeviceService;
  29. using Dongke.IBOSS.PRD.Service.SystemModuleLogic;
  30. using Dongke.IBOSS.PRD.WCF.Contracts;
  31. using Dongke.IBOSS.PRD.WCF.DataModels;
  32. using Dongke.IBOSS.PRD.WCF.DataModels.ConfigModule;
  33. using Dongke.IBOSS.PRD.WCF.DataModels.HRModule;
  34. using Dongke.IBOSS.PRD.WCF.DataModels.PCModule;
  35. using Dongke.IBOSS.PRD.WCF.DataModels.PMModule;
  36. namespace Dongke.IBOSS.PRD.WCF.Services
  37. {
  38. // 服务实现类,继承服务声明接口
  39. // 该标签声明该服务可以在ASP.NET下运行
  40. [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
  41. [ServiceBehavior(ConfigurationName = "PDAModuleService",
  42. InstanceContextMode = InstanceContextMode.PerCall,
  43. ConcurrencyMode = ConcurrencyMode.Multiple,
  44. UseSynchronizationContext = false)]
  45. public partial class PDAModuleService : IPDAModule
  46. {
  47. #region 属性
  48. /// <summary>
  49. /// 用户登陆的信息
  50. /// </summary>
  51. SUserInfo sUserInfo
  52. {
  53. get;
  54. set;
  55. }
  56. #endregion
  57. #region 构造函数
  58. /// <summary>
  59. /// 构造函数
  60. /// </summary>
  61. public PDAModuleService()
  62. : base()
  63. {
  64. }
  65. #endregion
  66. #region 验证
  67. /// <summary>
  68. /// 验证访问头
  69. /// </summary>
  70. /// <param name="accountCode">帐套编码</param>
  71. /// <param name="userCode">用户编码</param>
  72. /// <param name="userPassword">用户密码</param>
  73. /// <param name="sessionKey">访问密钥</param>
  74. /// <returns></returns>
  75. private ActionResult DoPDACheck(string accountCode, string userCode, string userPassword, string sessionKey)
  76. {
  77. try
  78. {
  79. ActionResult actionResult = new ActionResult();
  80. LoginRequestEntity requestEntity = new LoginRequestEntity();
  81. requestEntity.AccountCode = accountCode;
  82. requestEntity.UserCode = userCode;
  83. requestEntity.Password = userPassword;
  84. requestEntity.SessionKey = sessionKey;
  85. SUserInfo userInfo = null;
  86. string loginStatus = DKIBOSSPRDLogic.AuthenticateRepeatLogin(requestEntity, out userInfo);
  87. // 用户登录信息错误
  88. if (Constant.INT_IS_ONE.ToString().Equals(loginStatus))
  89. {
  90. actionResult.Status = (int)Constant.PDAResult.LoginInfoError;
  91. actionResult.Message = Constant.PDA_RESULT_LOGININFOERROR;
  92. }
  93. // 用户在其它终端登陆
  94. else if (Constant.INT_IS_TWO.ToString().Equals(loginStatus))
  95. {
  96. actionResult.Status = (int)Constant.PDAResult.RepeatLogin;
  97. actionResult.Message = Constant.PDA_RESULT_REPEATLOGIN;
  98. }
  99. // Lic错误
  100. else if ("3".Equals(loginStatus))
  101. {
  102. actionResult.Status = (int)Constant.PDAResult.LicInfoError;
  103. actionResult.Message = "授权信息错误,请联系管理员。";
  104. }
  105. else
  106. {
  107. actionResult.Status = (int)Constant.PDAResult.Success;
  108. }
  109. sUserInfo = userInfo;
  110. return actionResult;
  111. }
  112. catch (Exception ex)
  113. {
  114. throw ex;
  115. }
  116. }
  117. #endregion
  118. #region WCF服务
  119. /// <summary>
  120. /// 测试PDA连接WCF服务
  121. /// </summary>
  122. /// <param name="value">测试文本</param>
  123. /// <returns>返回文本</returns>
  124. public string TestConnectionEx(string value)
  125. {
  126. return "连接成功!" + value;
  127. }
  128. public string TestConnection()
  129. {
  130. return "连接成功!";
  131. }
  132. #endregion
  133. #region 系统登录
  134. /// <summary>
  135. /// 系统登录
  136. /// </summary>
  137. /// <param name="accountCode"></param>
  138. /// <param name="userCode"></param>
  139. /// <param name="userPassword"></param>
  140. /// <param name="macAddress"></param>
  141. /// <param name="ipAddress"></param>
  142. /// <param name="phoneCode"></param>
  143. /// <param name="phoneType"></param>
  144. /// <param name="appVersion"></param>
  145. /// <param name="systemType"></param>
  146. /// <param name="systemVersion"></param>
  147. /// <returns></returns>
  148. public PDALoginResult DoPDALogin(string accountCode, string userCode, string userPassword,
  149. string macAddress, string ipAddress, string phoneCode, string phoneType,
  150. string appVersion, string systemType, string systemVersion)
  151. {
  152. try
  153. {
  154. LoginRequestEntity requestEntity = new LoginRequestEntity();
  155. requestEntity.AccountCode = accountCode;
  156. requestEntity.UserCode = userCode;
  157. requestEntity.Password = userPassword;
  158. requestEntity.ComputerName = phoneCode;
  159. requestEntity.IPAddress = ipAddress;
  160. requestEntity.MACAddress = macAddress;
  161. PDALoginResult result = ServiceInvoker.Invoke<PDALoginResult>(this,
  162. () => PDAModuleLogic.DoPDALogin(requestEntity));
  163. return result;
  164. }
  165. catch (Exception ex)
  166. {
  167. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  168. OutputLog.TraceLog(LogPriority.Error,
  169. this.ToString(),
  170. System.Reflection.MethodBase.GetCurrentMethod().Name,
  171. ex.ToString(),
  172. LocalPath.LogExePath);
  173. PDALoginResult result = new PDALoginResult();
  174. result.Status = (int)Constant.PDAResult.Exception;
  175. result.Message = Constant.PDA_RESULT_EXCEPTION;
  176. return result;
  177. }
  178. }
  179. /// <summary>
  180. /// 退出
  181. /// </summary>
  182. /// <param name="accountCode">帐套code</param>
  183. /// <param name="userCode">用户code</param>
  184. /// <param name="userPassword">用户密码</param>
  185. /// <param name="sessionKey">本次登陆密钥</param>
  186. /// <returns></returns>
  187. public ActionResult DoPDAOut(string accountCode, string userCode, string userPassword, string sessionKey)
  188. {
  189. ActionResult actionResult = new ActionResult();
  190. try
  191. {
  192. // 验证请求头信息
  193. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  194. // 验证失败
  195. if (actionResult.Status != (int)Constant.PDAResult.Success)
  196. {
  197. return actionResult;
  198. }
  199. bool result = DKIBOSSPRDLogic.Logout(sUserInfo.UserID, "3", sUserInfo);
  200. actionResult.Result = JsonHelper.ToJson(result);
  201. actionResult.Status = (int)Constant.PDAResult.Success;
  202. }
  203. catch (Exception ex)
  204. {
  205. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  206. OutputLog.TraceLog(LogPriority.Error,
  207. this.ToString(),
  208. System.Reflection.MethodBase.GetCurrentMethod().Name,
  209. ex.ToString(),
  210. LocalPath.LogExePath);
  211. actionResult.Status = (int)Constant.PDAResult.Exception;
  212. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  213. }
  214. return actionResult;
  215. }
  216. /// <summary>
  217. /// 修改密码
  218. /// </summary>
  219. /// <param name="accountCode"></param>
  220. /// <param name="userCode"></param>
  221. /// <param name="userPassword"></param>
  222. /// <param name="sessionKey"></param>
  223. /// <returns></returns>
  224. public ActionResult ChangeUserPassword(string accountCode, string userCode, string userPassword, string sessionKey,
  225. string newPassWord)
  226. {
  227. ActionResult actionResult = new ActionResult();
  228. try
  229. {
  230. // 验证请求头信息
  231. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  232. // 验证失败
  233. if (actionResult.Status != (int)Constant.PDAResult.Success)
  234. {
  235. return actionResult;
  236. }
  237. string result = ServiceInvoker.Invoke<string>(this,
  238. () => SystemModuleDAL.SaveUserPassWord(newPassWord, userCode, null, sUserInfo));
  239. actionResult.Status = (int)Constant.PDAResult.Success;
  240. }
  241. catch (Exception ex)
  242. {
  243. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  244. OutputLog.TraceLog(LogPriority.Error,
  245. this.ToString(),
  246. System.Reflection.MethodBase.GetCurrentMethod().Name,
  247. ex.ToString(),
  248. LocalPath.LogExePath);
  249. actionResult.Status = (int)Constant.PDAResult.Exception;
  250. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  251. }
  252. return actionResult;
  253. }
  254. #endregion
  255. #region 取得展示数据
  256. /// <summary>
  257. /// 获得生产线菜单
  258. /// </summary>
  259. /// <param name="accountCode">帐套code</param>
  260. /// <param name="userCode">用户code</param>
  261. /// <param name="userPassword">用户密码</param>
  262. /// <param name="sessionKey">本次登陆密钥</param>
  263. /// <returns></returns>
  264. /// <remarks>
  265. /// 陈冰 2014.09.18 新建
  266. /// </remarks>
  267. public ActionResult GetProductionLineMenu(string accountCode, string userCode, string userPassword, string sessionKey)
  268. {
  269. ActionResult actionResult = new ActionResult();
  270. try
  271. {
  272. // 验证请求头信息
  273. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  274. // 验证失败
  275. if (actionResult.Status != (int)Constant.PDAResult.Success)
  276. {
  277. return actionResult;
  278. }
  279. // 查询菜单
  280. DataTable dtPLM = ServiceInvoker.Invoke<DataTable>(this,
  281. () => PDAModuleLogic.GetProductionLineMenu(sUserInfo));
  282. PDAFunctionResult pdaFunction = new PDAFunctionResult();
  283. pdaFunction.MenuCode = "Root";
  284. DataRow[] navigationRows = dtPLM.Select("LEN(MenuCode) = " + Constant.INT_IS_TWO.ToString(), "MenuCode ASC"); // 编号2为一级菜单
  285. foreach (DataRow newRow in navigationRows)
  286. {
  287. #region 插入子节点数据
  288. int? intProcedureID = null;
  289. int? intModelType = null;
  290. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  291. {
  292. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  293. }
  294. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  295. {
  296. intModelType = Convert.ToInt32(newRow["ModelType"]);
  297. }
  298. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  299. //xuwei add 2020-01-02
  300. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  301. //pdaFunctionChild.IsGlazeChange = 0;
  302. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  303. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  304. pdaFunctionChild.ProcedureID = intProcedureID;
  305. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  306. pdaFunctionChild.ModelType = intModelType;
  307. pdaFunction.PDAFunctions.Add(pdaFunctionChild);
  308. #endregion
  309. InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild);
  310. }
  311. //actionResult.Result = JsonHelper.ToJson(dtPLM);
  312. actionResult.Result = JsonHelper.ToJson(pdaFunction);
  313. actionResult.Status = (int)Constant.PDAResult.Success;
  314. }
  315. catch (Exception ex)
  316. {
  317. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  318. OutputLog.TraceLog(LogPriority.Error,
  319. this.ToString(),
  320. System.Reflection.MethodBase.GetCurrentMethod().Name,
  321. ex.ToString(),
  322. LocalPath.LogExePath);
  323. actionResult.Status = (int)Constant.PDAResult.Exception;
  324. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  325. }
  326. return actionResult;
  327. }
  328. /// <summary>
  329. /// 初始化树形控件
  330. /// </summary>
  331. /// <param name="treeTable">菜单数据表</param>
  332. /// <param name="rows">待处理的菜单集合</param>
  333. /// <param name="node">当前树节点</param>
  334. private void InitTreeView(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions)
  335. {
  336. string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = "
  337. + (pFuncCode.Length + Constant.INT_IS_TWO);
  338. DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC");
  339. //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC");
  340. foreach (DataRow newRow in subRows)
  341. {
  342. #region 插入子节点数据
  343. int? intProcedureID = null;
  344. int? intModelType = null;
  345. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  346. {
  347. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  348. }
  349. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  350. {
  351. intModelType = Convert.ToInt32(newRow["ModelType"]);
  352. }
  353. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  354. //xuwei add 2020-01-02
  355. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  356. //pdaFunctionChild.IsGlazeChange = 0;
  357. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  358. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  359. pdaFunctionChild.ProcedureID = intProcedureID;
  360. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  361. pdaFunctionChild.ModelType = intModelType;
  362. pFunctions.PDAFunctions.Add(pdaFunctionChild);
  363. #endregion
  364. // 递归方法
  365. InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild);
  366. }
  367. }
  368. #endregion
  369. #region 获得工序信息
  370. /// <summary>
  371. /// 获得工序信息
  372. /// </summary>
  373. /// <param name="accountCode">帐套code</param>
  374. /// <param name="userCode">用户code</param>
  375. /// <param name="userPassword">用户密码</param>
  376. /// <param name="sessionKey">本次登陆密钥</param>
  377. /// <param name="procedureID">工序ID</param>
  378. /// <returns></returns>
  379. /// <remarks>
  380. /// 陈冰 2014.09.18 新建
  381. /// </remarks>
  382. public ActionResult GetProcedureByID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  383. {
  384. ActionResult actionResult = new ActionResult();
  385. try
  386. {
  387. // 验证请求头信息
  388. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  389. // 验证失败
  390. if (actionResult.Status != (int)Constant.PDAResult.Success)
  391. {
  392. return actionResult;
  393. }
  394. ProcedureEntity procedureEntity = ServiceInvoker.Invoke<ProcedureEntity>(this,
  395. () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo));
  396. actionResult.Result = JsonHelper.ToJson(procedureEntity);
  397. actionResult.Status = (int)Constant.PDAResult.Success;
  398. }
  399. catch (Exception ex)
  400. {
  401. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  402. OutputLog.TraceLog(LogPriority.Error,
  403. this.ToString(),
  404. System.Reflection.MethodBase.GetCurrentMethod().Name,
  405. ex.ToString(),
  406. LocalPath.LogExePath);
  407. actionResult.Status = (int)Constant.PDAResult.Exception;
  408. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  409. }
  410. return actionResult;
  411. }
  412. #endregion
  413. #region 校验
  414. /// <summary>
  415. /// 校验产品条码是否可以走到该工序
  416. /// </summary>
  417. /// <param name="accountCode">帐套code</param>
  418. /// <param name="userCode">用户code</param>
  419. /// <param name="userPassword">用户密码</param>
  420. /// <param name="sessionKey">本次登陆密钥</param>
  421. /// <param name="procedureID">工序ID</param>
  422. /// <param name="barcode">条码</param>
  423. /// <returns></returns>
  424. /// <remarks>
  425. /// 陈冰 2014.09.18 新建
  426. /// </remarks>
  427. public ActionResult CheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  428. {
  429. ActionResult actionResult = new ActionResult();
  430. try
  431. {
  432. // 验证请求头信息
  433. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  434. // 验证失败
  435. if (actionResult.Status != (int)Constant.PDAResult.Success)
  436. {
  437. return actionResult;
  438. }
  439. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  440. () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo));
  441. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  442. {
  443. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  444. actionResult.Status = (int)Constant.PDAResult.Success;
  445. }
  446. else
  447. {
  448. actionResult.Status = (int)Constant.PDAResult.Fail;
  449. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  450. }
  451. }
  452. catch (Exception ex)
  453. {
  454. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  455. OutputLog.TraceLog(LogPriority.Error,
  456. this.ToString(),
  457. System.Reflection.MethodBase.GetCurrentMethod().Name,
  458. ex.ToString(),
  459. LocalPath.LogExePath);
  460. actionResult.Status = (int)Constant.PDAResult.Exception;
  461. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  462. }
  463. return actionResult;
  464. }
  465. /// <summary>
  466. /// 校验产品条码是否可以进行干补
  467. /// </summary>
  468. /// <param name="accountCode">帐套code</param>
  469. /// <param name="userCode">用户code</param>
  470. /// <param name="userPassword">用户密码</param>
  471. /// <param name="sessionKey">本次登陆密钥</param>
  472. /// <param name="procedureID">工序ID</param>
  473. /// <param name="barcode">条码</param>
  474. /// <returns></returns>
  475. /// <remarks>
  476. /// 袁新成 2015.4.1 新建
  477. /// </remarks>
  478. public ActionResult CheckDryRepairBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  479. {
  480. ActionResult actionResult = new ActionResult();
  481. try
  482. {
  483. // 验证请求头信息
  484. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  485. // 验证失败
  486. if (actionResult.Status != (int)Constant.PDAResult.Success)
  487. {
  488. return actionResult;
  489. }
  490. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  491. () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
  492. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  493. {
  494. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  495. actionResult.Status = (int)Constant.PDAResult.Success;
  496. }
  497. else
  498. {
  499. actionResult.Status = (int)Constant.PDAResult.Fail;
  500. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  501. }
  502. }
  503. catch (Exception ex)
  504. {
  505. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  506. OutputLog.TraceLog(LogPriority.Error,
  507. this.ToString(),
  508. System.Reflection.MethodBase.GetCurrentMethod().Name,
  509. ex.ToString(),
  510. LocalPath.LogExePath);
  511. actionResult.Status = (int)Constant.PDAResult.Exception;
  512. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  513. }
  514. return actionResult;
  515. }
  516. /// <summary>
  517. /// 检验生产工号
  518. /// </summary>
  519. /// <param name="accountCode">帐套code</param>
  520. /// <param name="userCode">用户code</param>
  521. /// <param name="userPassword">用户密码</param>
  522. /// <param name="sessionKey">本次登陆密钥</param>
  523. /// <param name="procedureID">工序ID</param>
  524. /// <param name="procedureUserCode">生产工号</param>
  525. /// <remarks>
  526. /// 陈冰 2014.09.18 新建
  527. /// </remarks>
  528. public ActionResult CheckProcedureUser(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
  529. {
  530. ActionResult actionResult = new ActionResult();
  531. try
  532. {
  533. // 验证请求头信息
  534. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  535. // 验证失败
  536. if (actionResult.Status != (int)Constant.PDAResult.Success)
  537. {
  538. return actionResult;
  539. }
  540. CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
  541. () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
  542. actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
  543. actionResult.Status = (int)Constant.PDAResult.Success;
  544. }
  545. catch (Exception ex)
  546. {
  547. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  548. OutputLog.TraceLog(LogPriority.Error,
  549. this.ToString(),
  550. System.Reflection.MethodBase.GetCurrentMethod().Name,
  551. ex.ToString(),
  552. LocalPath.LogExePath);
  553. actionResult.Status = (int)Constant.PDAResult.Exception;
  554. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  555. }
  556. return actionResult;
  557. }
  558. /// <summary>
  559. /// 校验窑车是否可装车并返回窑车信息
  560. /// </summary>
  561. /// <param name="accountCode">帐套code</param>
  562. /// <param name="userCode">用户code</param>
  563. /// <param name="userPassword">用户密码</param>
  564. /// <param name="sessionKey">本次登陆密钥</param>
  565. /// <param name="kilnCarCode">窑车号</param>
  566. /// <param name="modelType">工序类别</param>
  567. /// <returns></returns>
  568. /// <remarks>
  569. /// 陈冰 2014.10.04 新建
  570. /// </remarks>
  571. public ActionResult CheckKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
  572. {
  573. ActionResult actionResult = new ActionResult();
  574. try
  575. {
  576. // 验证请求头信息
  577. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  578. // 验证失败
  579. if (actionResult.Status != (int)Constant.PDAResult.Success)
  580. {
  581. return actionResult;
  582. }
  583. CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
  584. () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
  585. actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
  586. actionResult.Status = (int)Constant.PDAResult.Success;
  587. }
  588. catch (Exception ex)
  589. {
  590. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  591. OutputLog.TraceLog(LogPriority.Error,
  592. this.ToString(),
  593. System.Reflection.MethodBase.GetCurrentMethod().Name,
  594. ex.ToString(),
  595. LocalPath.LogExePath);
  596. actionResult.Status = (int)Constant.PDAResult.Exception;
  597. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  598. }
  599. return actionResult;
  600. }
  601. #endregion
  602. #region 保存条码信息
  603. /// <summary>
  604. /// 保存条码信息
  605. /// </summary>
  606. /// <param name="accountCode">帐套code</param>
  607. /// <param name="userCode">用户code</param>
  608. /// <param name="userPassword">用户密码</param>
  609. /// <param name="sessionKey">本次登陆密钥</param>
  610. /// <param name="procedureID">工序ID</param>
  611. /// <param name="productionDataEntitys">条码信息</param>
  612. public ActionResult AddWorkPiece(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  613. {
  614. ActionResult actionResult = new ActionResult();
  615. try
  616. {
  617. // 验证请求头信息
  618. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  619. // 验证失败
  620. if (actionResult.Status != (int)Constant.PDAResult.Success)
  621. {
  622. return actionResult;
  623. }
  624. DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
  625. if (!dtProductionData.Columns.Contains("IsPDA"))
  626. {
  627. dtProductionData.Columns.Add("IsPDA");
  628. }
  629. ProcedureEntity procedureInfo = null;
  630. DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
  631. () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
  632. actionResult.Result = JsonHelper.ToJson(resultDT);
  633. actionResult.Status = (int)Constant.PDAResult.Success;
  634. if (resultDT != null)
  635. {
  636. DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
  637. if (drs != null && drs.Length > 0)
  638. {
  639. return actionResult;
  640. }
  641. }
  642. #region PDA条码打印
  643. if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
  644. procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
  645. {
  646. try
  647. {
  648. if (procedureInfo.CollectType == 1)
  649. {
  650. //foreach (DataRow item in dtProductionData.Rows)
  651. //{
  652. // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
  653. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  654. // if (sre.Status != Constant.ServiceResultStatus.Success)
  655. // {
  656. // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  657. // actionResult.Message = sre.Message;
  658. // return actionResult;
  659. // }
  660. //}
  661. }
  662. else
  663. {
  664. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
  665. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  666. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(dtProductionData.Rows[0]["barcode"].ToString(),
  667. procedureInfo.BarCodePrintCopies, null, sUserInfo, 0);
  668. if (sre.Status != Constant.ServiceResultStatus.Success)
  669. {
  670. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  671. actionResult.Message = sre.Message;
  672. return actionResult;
  673. }
  674. }
  675. }
  676. catch (Exception ex)
  677. {
  678. OutputLog.TraceLog(LogPriority.Error,
  679. this.ToString(),
  680. System.Reflection.MethodBase.GetCurrentMethod().Name,
  681. ex.ToString(),
  682. LocalPath.LogExePath);
  683. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  684. actionResult.Message = "条码打印异常";
  685. return actionResult;
  686. }
  687. }
  688. #endregion PDA条码打印
  689. }
  690. catch (Exception ex)
  691. {
  692. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  693. OutputLog.TraceLog(LogPriority.Error,
  694. this.ToString(),
  695. System.Reflection.MethodBase.GetCurrentMethod().Name,
  696. ex.ToString(),
  697. LocalPath.LogExePath);
  698. try
  699. {
  700. string ss = JsonHelper.ToJson(productionDataEntitys);
  701. OutputLog.TraceLog(LogPriority.Error,
  702. this.ToString(),
  703. System.Reflection.MethodBase.GetCurrentMethod().Name,
  704. $" userCode:{userCode} procedureID:{procedureID} " + ss,
  705. LocalPath.LogExePath);
  706. }
  707. catch
  708. {
  709. }
  710. actionResult.Status = (int)Constant.PDAResult.Exception;
  711. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  712. }
  713. return actionResult;
  714. }
  715. #endregion
  716. #region 获得系统/基数数据
  717. /// <summary>
  718. /// 获得数据字典
  719. /// </summary>
  720. /// <param name="accountCode">帐套code</param>
  721. /// <param name="userCode">用户code</param>
  722. /// <param name="userPassword">用户密码</param>
  723. /// <param name="sessionKey">本次登陆密钥</param>
  724. /// <param name="dicType">字典类型</param>
  725. /// <returns></returns>
  726. public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  727. {
  728. ActionResult actionResult = new ActionResult();
  729. try
  730. {
  731. // 验证请求头信息
  732. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  733. // 验证失败
  734. if (actionResult.Status != (int)Constant.PDAResult.Success)
  735. {
  736. return actionResult;
  737. }
  738. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  739. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  740. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  741. actionResult.Status = (int)Constant.PDAResult.Success;
  742. }
  743. catch (Exception ex)
  744. {
  745. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  746. OutputLog.TraceLog(LogPriority.Error,
  747. this.ToString(),
  748. System.Reflection.MethodBase.GetCurrentMethod().Name,
  749. ex.ToString(),
  750. LocalPath.LogExePath);
  751. actionResult.Status = (int)Constant.PDAResult.Exception;
  752. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  753. }
  754. return actionResult;
  755. }
  756. #endregion
  757. #region 检验工序接口
  758. /// <summary>
  759. /// 获得检验标识
  760. /// </summary>
  761. /// <param name="accountCode">帐套code</param>
  762. /// <param name="userCode">用户code</param>
  763. /// <param name="userPassword">用户密码</param>
  764. /// <param name="sessionKey">本次登陆密钥</param>
  765. /// <returns></returns>
  766. /// <remarks>
  767. /// 陈冰 2014.10.04 新建
  768. /// </remarks>
  769. public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey)
  770. {
  771. ActionResult actionResult = new ActionResult();
  772. try
  773. {
  774. // 验证请求头信息
  775. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  776. // 验证失败
  777. if (actionResult.Status != (int)Constant.PDAResult.Success)
  778. {
  779. return actionResult;
  780. }
  781. #region 构造缺陷标识的数据源
  782. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  783. #endregion
  784. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  785. actionResult.Status = (int)Constant.PDAResult.Success;
  786. }
  787. catch (Exception ex)
  788. {
  789. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  790. OutputLog.TraceLog(LogPriority.Error,
  791. this.ToString(),
  792. System.Reflection.MethodBase.GetCurrentMethod().Name,
  793. ex.ToString(),
  794. LocalPath.LogExePath);
  795. actionResult.Status = (int)Constant.PDAResult.Exception;
  796. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  797. }
  798. return actionResult;
  799. }
  800. /// <summary>
  801. /// 由条码和当前检验工序获取返工工序
  802. /// </summary>
  803. /// <param name="accountCode">帐套code</param>
  804. /// <param name="userCode">用户code</param>
  805. /// <param name="userPassword">用户密码</param>
  806. /// <param name="sessionKey">本次登陆密钥</param>
  807. /// <param name="procedureID">当前检验工序ID</param>
  808. /// <param name="barcode">条码</param>
  809. /// <returns></returns>
  810. /// <remarks>
  811. /// 陈冰 2014.10.04 新建
  812. /// </remarks>
  813. public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  814. {
  815. ActionResult actionResult = new ActionResult();
  816. try
  817. {
  818. // 验证请求头信息
  819. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  820. // 验证失败
  821. if (actionResult.Status != (int)Constant.PDAResult.Success)
  822. {
  823. return actionResult;
  824. }
  825. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  826. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  827. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  828. {
  829. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  830. actionResult.Status = (int)Constant.PDAResult.Success;
  831. }
  832. else
  833. {
  834. actionResult.Status = (int)Constant.PDAResult.Fail;
  835. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  836. }
  837. }
  838. catch (Exception ex)
  839. {
  840. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  841. OutputLog.TraceLog(LogPriority.Error,
  842. this.ToString(),
  843. System.Reflection.MethodBase.GetCurrentMethod().Name,
  844. ex.ToString(),
  845. LocalPath.LogExePath);
  846. actionResult.Status = (int)Constant.PDAResult.Exception;
  847. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  848. }
  849. return actionResult;
  850. }
  851. /// <summary>
  852. /// 由当前检验工序获取缺陷列表
  853. /// </summary>
  854. /// <param name="accountCode">帐套code</param>
  855. /// <param name="userCode">用户code</param>
  856. /// <param name="userPassword">用户密码</param>
  857. /// <param name="sessionKey">本次登陆密钥</param>
  858. /// <param name="procedureID">当前检验工序ID</param>
  859. /// <param name="defectCode">缺陷编码</param>
  860. /// <returns></returns>
  861. /// <remarks>
  862. /// 陈冰 2014.10.04 新建
  863. /// </remarks>
  864. public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  865. {
  866. ActionResult actionResult = new ActionResult();
  867. try
  868. {
  869. // 验证请求头信息
  870. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  871. // 验证失败
  872. if (actionResult.Status != (int)Constant.PDAResult.Success)
  873. {
  874. return actionResult;
  875. }
  876. object defectDs = ServiceInvoker.Invoke<object>(this,
  877. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  878. if (defectDs != null)
  879. {
  880. actionResult.Result = JsonHelper.ToJson(defectDs);
  881. actionResult.Status = (int)Constant.PDAResult.Success;
  882. }
  883. else
  884. {
  885. actionResult.Status = (int)Constant.PDAResult.Fail;
  886. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  887. }
  888. }
  889. catch (Exception ex)
  890. {
  891. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  892. OutputLog.TraceLog(LogPriority.Error,
  893. this.ToString(),
  894. System.Reflection.MethodBase.GetCurrentMethod().Name,
  895. ex.ToString(),
  896. LocalPath.LogExePath);
  897. actionResult.Status = (int)Constant.PDAResult.Exception;
  898. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  899. }
  900. return actionResult;
  901. }
  902. /// <summary>
  903. /// 根据产品ID查出缺陷位置
  904. /// </summary>
  905. /// <param name="accountCode">帐套code</param>
  906. /// <param name="userCode">用户code</param>
  907. /// <param name="userPassword">用户密码</param>
  908. /// <param name="sessionKey">本次登陆密钥</param>
  909. /// <param name="goodsID">产品ID</param>
  910. /// <param name="positionCode">位置编码</param>
  911. /// <returns></returns>
  912. /// <remarks>
  913. /// 陈冰 2014.10.04 新建
  914. /// </remarks>
  915. public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  916. {
  917. ActionResult actionResult = new ActionResult();
  918. try
  919. {
  920. // 验证请求头信息
  921. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  922. // 验证失败
  923. if (actionResult.Status != (int)Constant.PDAResult.Success)
  924. {
  925. return actionResult;
  926. }
  927. // 缺陷位置已经不用在关联产品
  928. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  929. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  930. if (defectDs != null)
  931. {
  932. actionResult.Result = JsonHelper.ToJson(defectDs);
  933. actionResult.Status = (int)Constant.PDAResult.Success;
  934. }
  935. else
  936. {
  937. actionResult.Status = (int)Constant.PDAResult.Fail;
  938. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  939. }
  940. }
  941. catch (Exception ex)
  942. {
  943. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  944. OutputLog.TraceLog(LogPriority.Error,
  945. this.ToString(),
  946. System.Reflection.MethodBase.GetCurrentMethod().Name,
  947. ex.ToString(),
  948. LocalPath.LogExePath);
  949. actionResult.Status = (int)Constant.PDAResult.Exception;
  950. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  951. }
  952. return actionResult;
  953. }
  954. /// <summary>
  955. /// 通过条码和缺陷查出责任工序
  956. /// </summary>
  957. /// <param name="accountCode">帐套code</param>
  958. /// <param name="userCode">用户code</param>
  959. /// <param name="userPassword">用户密码</param>
  960. /// <param name="sessionKey">本次登陆密钥</param>
  961. /// <param name="barcode">条码</param>
  962. /// <param name="defectid">缺陷ID</param>
  963. /// <returns></returns>
  964. /// <remarks>
  965. /// 陈冰 2014.10.04 新建
  966. /// </remarks>
  967. public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  968. {
  969. ActionResult actionResult = new ActionResult();
  970. try
  971. {
  972. // 验证请求头信息
  973. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  974. // 验证失败
  975. if (actionResult.Status != (int)Constant.PDAResult.Success)
  976. {
  977. return actionResult;
  978. }
  979. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  980. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  981. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  982. {
  983. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  984. actionResult.Status = (int)Constant.PDAResult.Success;
  985. }
  986. else
  987. {
  988. actionResult.Status = (int)Constant.PDAResult.Fail;
  989. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  990. }
  991. }
  992. catch (Exception ex)
  993. {
  994. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  995. OutputLog.TraceLog(LogPriority.Error,
  996. this.ToString(),
  997. System.Reflection.MethodBase.GetCurrentMethod().Name,
  998. ex.ToString(),
  999. LocalPath.LogExePath);
  1000. actionResult.Status = (int)Constant.PDAResult.Exception;
  1001. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1002. }
  1003. return actionResult;
  1004. }
  1005. /// <summary>
  1006. /// 通过条码与工序查出责任工号(己废)
  1007. /// </summary>
  1008. /// <param name="accountCode">帐套code</param>
  1009. /// <param name="userCode">用户code</param>
  1010. /// <param name="userPassword">用户密码</param>
  1011. /// <param name="sessionKey">本次登陆密钥</param>
  1012. /// <param name="barcode">条码</param>
  1013. /// <param name="dutyProcedureID">责任工序</param>
  1014. /// <returns></returns>
  1015. /// <remarks>
  1016. /// 陈冰 2014.10.04 新建
  1017. /// </remarks>
  1018. public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  1019. {
  1020. ActionResult actionResult = new ActionResult();
  1021. try
  1022. {
  1023. // 验证请求头信息
  1024. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1025. // 验证失败
  1026. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1027. {
  1028. return actionResult;
  1029. }
  1030. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1031. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  1032. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1033. {
  1034. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1035. actionResult.Status = (int)Constant.PDAResult.Success;
  1036. }
  1037. else
  1038. {
  1039. actionResult.Status = (int)Constant.PDAResult.Fail;
  1040. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1041. }
  1042. }
  1043. catch (Exception ex)
  1044. {
  1045. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1046. OutputLog.TraceLog(LogPriority.Error,
  1047. this.ToString(),
  1048. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1049. ex.ToString(),
  1050. LocalPath.LogExePath);
  1051. actionResult.Status = (int)Constant.PDAResult.Exception;
  1052. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1053. }
  1054. return actionResult;
  1055. }
  1056. /// <summary>
  1057. /// 通过条码与工序查出责任工号
  1058. /// </summary>
  1059. /// <param name="accountCode"></param>
  1060. /// <param name="userCode"></param>
  1061. /// <param name="userPassword"></param>
  1062. /// <param name="sessionKey"></param>
  1063. /// <param name="ProductionDataID">生产数据ID</param>
  1064. /// <returns></returns>
  1065. public ActionResult GetDutyProcedureCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1066. {
  1067. ActionResult actionResult = new ActionResult();
  1068. try
  1069. {
  1070. // 验证请求头信息
  1071. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1072. // 验证失败
  1073. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1074. {
  1075. return actionResult;
  1076. }
  1077. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1078. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1079. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1080. {
  1081. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1082. actionResult.Status = (int)Constant.PDAResult.Success;
  1083. }
  1084. else
  1085. {
  1086. actionResult.Status = (int)Constant.PDAResult.Fail;
  1087. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1088. }
  1089. }
  1090. catch (Exception ex)
  1091. {
  1092. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1093. OutputLog.TraceLog(LogPriority.Error,
  1094. this.ToString(),
  1095. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1096. ex.ToString(),
  1097. LocalPath.LogExePath);
  1098. actionResult.Status = (int)Constant.PDAResult.Exception;
  1099. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1100. }
  1101. return actionResult;
  1102. }
  1103. /// <summary>
  1104. /// 通过生产数据与工号ID查询工种
  1105. /// </summary>
  1106. /// <param name="accountCode">帐套code</param>
  1107. /// <param name="userCode">用户code</param>
  1108. /// <param name="userPassword">用户密码</param>
  1109. /// <param name="sessionKey">本次登陆密钥</param>
  1110. /// <param name="productionDataID">生产数据ID</param>
  1111. /// <param name="userID">工号ID</param>
  1112. /// <returns></returns>
  1113. /// <remarks>
  1114. /// 陈冰 2014.10.08 新建
  1115. /// </remarks>
  1116. public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey,
  1117. //int productionDataID, int userID)
  1118. int classesSettingID, int defectid, int procedureID)
  1119. {
  1120. ActionResult actionResult = new ActionResult();
  1121. try
  1122. {
  1123. // 验证请求头信息
  1124. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1125. // 验证失败
  1126. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1127. {
  1128. return actionResult;
  1129. }
  1130. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1131. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1132. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  1133. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1134. {
  1135. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1136. actionResult.Status = (int)Constant.PDAResult.Success;
  1137. }
  1138. else
  1139. {
  1140. actionResult.Status = (int)Constant.PDAResult.Fail;
  1141. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1142. }
  1143. }
  1144. catch (Exception ex)
  1145. {
  1146. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1147. OutputLog.TraceLog(LogPriority.Error,
  1148. this.ToString(),
  1149. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1150. ex.ToString(),
  1151. LocalPath.LogExePath);
  1152. actionResult.Status = (int)Constant.PDAResult.Exception;
  1153. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1154. }
  1155. return actionResult;
  1156. }
  1157. /// <summary>
  1158. /// 根据生产数据ID,用户ID及工种选出责任员工
  1159. /// </summary>
  1160. /// <param name="accountCode">帐套code</param>
  1161. /// <param name="userCode">用户code</param>
  1162. /// <param name="userPassword">用户密码</param>
  1163. /// <param name="sessionKey">本次登陆密钥</param>
  1164. /// <param name="productionDataID">生产数据ID</param>
  1165. /// <param name="userID">工号ID</param>
  1166. /// <param name="jobsID">工种ID</param>
  1167. /// <returns></returns>
  1168. /// <remarks>
  1169. /// 陈冰 2014.10.08 新建
  1170. /// </remarks>
  1171. public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey,
  1172. //int productionDataID, int userID, int jobsID)
  1173. int classesSettingID, int jobsID)
  1174. {
  1175. ActionResult actionResult = new ActionResult();
  1176. try
  1177. {
  1178. // 验证请求头信息
  1179. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1180. // 验证失败
  1181. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1182. {
  1183. return actionResult;
  1184. }
  1185. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1186. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1187. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1188. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1189. {
  1190. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1191. actionResult.Status = (int)Constant.PDAResult.Success;
  1192. }
  1193. else
  1194. {
  1195. actionResult.Status = (int)Constant.PDAResult.Fail;
  1196. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1197. }
  1198. }
  1199. catch (Exception ex)
  1200. {
  1201. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1202. OutputLog.TraceLog(LogPriority.Error,
  1203. this.ToString(),
  1204. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1205. ex.ToString(),
  1206. LocalPath.LogExePath);
  1207. actionResult.Status = (int)Constant.PDAResult.Exception;
  1208. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1209. }
  1210. return actionResult;
  1211. }
  1212. /// <summary>
  1213. /// 获得产品分级
  1214. /// </summary>
  1215. /// <param name="accountCode">帐套code</param>
  1216. /// <param name="userCode">用户code</param>
  1217. /// <param name="userPassword">用户密码</param>
  1218. /// <param name="sessionKey">本次登陆密钥</param>
  1219. /// <returns></returns>
  1220. /// <remarks>
  1221. /// 陈冰 2014.10.08 新建
  1222. /// xuwei 2019-12-4 添加参数type 默认为2成检 为1时 半检
  1223. /// </remarks>
  1224. public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey, int type = 2)
  1225. {
  1226. ActionResult actionResult = new ActionResult();
  1227. try
  1228. {
  1229. // 验证请求头信息
  1230. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1231. // 验证失败
  1232. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1233. {
  1234. return actionResult;
  1235. }
  1236. #region 构造产品分级的数据源
  1237. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1238. //xuwei modify 2019-12-04 支持半检 没传参数 type=0
  1239. //DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2 , sUserInfo);
  1240. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(type == 0 ? 2 : type, sUserInfo);
  1241. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1242. {
  1243. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1244. actionResult.Status = (int)Constant.PDAResult.Success;
  1245. }
  1246. else
  1247. {
  1248. actionResult.Status = (int)Constant.PDAResult.Fail;
  1249. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1250. }
  1251. #endregion
  1252. }
  1253. catch (Exception ex)
  1254. {
  1255. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1256. OutputLog.TraceLog(LogPriority.Error,
  1257. this.ToString(),
  1258. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1259. ex.ToString(),
  1260. LocalPath.LogExePath);
  1261. OutputLog.TraceLog(LogPriority.Error,
  1262. this.ToString(),
  1263. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1264. ex.ToString(),
  1265. LocalPath.LogExePath);
  1266. actionResult.Status = (int)Constant.PDAResult.Exception;
  1267. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1268. }
  1269. return actionResult;
  1270. }
  1271. #endregion
  1272. #region 保存检验条码
  1273. /// <summary>
  1274. /// 保存检验条码
  1275. /// </summary>
  1276. /// <param name="accountCode">帐套code</param>
  1277. /// <param name="userCode">用户code</param>
  1278. /// <param name="userPassword">用户密码</param>
  1279. /// <param name="sessionKey">本次登陆密钥</param>
  1280. /// <param name="procedureID">工序ID</param>
  1281. /// <param name="productionDataEntitys">条码信息</param>
  1282. /// <returns></returns>
  1283. public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1284. {
  1285. ActionResult actionResult = new ActionResult();
  1286. try
  1287. {
  1288. // 验证请求头信息
  1289. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1290. // 验证失败
  1291. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1292. {
  1293. return actionResult;
  1294. }
  1295. //if(productionDataEntitys.Length>0)
  1296. //{
  1297. // if(productionDataEntitys[0].ProductionDataID>0)
  1298. // {
  1299. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1300. // }
  1301. //}
  1302. string err = ServiceInvoker.Invoke<string>(this,
  1303. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1304. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1305. if (err == null)
  1306. {
  1307. err = "";
  1308. }
  1309. //actionResult.Result = JsonHelper.ToJson(err);
  1310. actionResult.Result = err;// JsonHelper.ToJson(err);
  1311. actionResult.Status = (int)Constant.PDAResult.Success;
  1312. }
  1313. catch (Exception ex)
  1314. {
  1315. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1316. OutputLog.TraceLog(LogPriority.Error,
  1317. this.ToString(),
  1318. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1319. ex.ToString(),
  1320. LocalPath.LogExePath);
  1321. actionResult.Status = (int)Constant.PDAResult.Exception;
  1322. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1323. }
  1324. return actionResult;
  1325. }
  1326. #endregion
  1327. #region 文件上传下载
  1328. /// <summary>
  1329. /// 软件更新
  1330. /// </summary>
  1331. /// <param name="accountCode">帐套code</param>
  1332. /// <param name="userCode">用户code</param>
  1333. /// <param name="userPassword">用户密码</param>
  1334. /// <param name="sessionKey">本次登陆密钥</param>
  1335. /// <returns></returns>
  1336. public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey)
  1337. {
  1338. try
  1339. {
  1340. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1341. }
  1342. catch (Exception ex)
  1343. {
  1344. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1345. OutputLog.TraceLog(LogPriority.Error,
  1346. this.ToString(),
  1347. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1348. ex.ToString(),
  1349. LocalPath.LogExePath);
  1350. return null;
  1351. }
  1352. }
  1353. /// <summary>
  1354. /// 上传临时文件
  1355. /// </summary>
  1356. /// <param name="imgStream"></param>
  1357. /// <returns></returns>
  1358. public ActionResult SaveImg(Stream mageStream)
  1359. {
  1360. ActionResult actionResult = new ActionResult();
  1361. try
  1362. {
  1363. string err = PDAModuleLogic.SaveImg(mageStream);
  1364. if (err == null)
  1365. {
  1366. err = "";
  1367. }
  1368. actionResult.Result = err;
  1369. actionResult.Status = (int)Constant.PDAResult.Success;
  1370. }
  1371. catch (Exception ex)
  1372. {
  1373. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1374. OutputLog.TraceLog(LogPriority.Error,
  1375. this.ToString(),
  1376. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1377. ex.ToString(),
  1378. LocalPath.LogExePath);
  1379. actionResult.Status = (int)Constant.PDAResult.Exception;
  1380. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1381. }
  1382. return actionResult;
  1383. }
  1384. public Stream GetFileTest(string path)
  1385. {
  1386. return PDAModuleLogic.GetImg(path);
  1387. }
  1388. public Stream GetFileStream()
  1389. {
  1390. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1391. long l = fs.Length;
  1392. return fs;
  1393. }
  1394. public byte[] GetFileTestByte(string path)
  1395. {
  1396. FileStream stream = new FileInfo(path).OpenRead();
  1397. Byte[] buffer = new Byte[stream.Length];
  1398. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1399. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1400. return buffer;
  1401. }
  1402. public string GetFile(string path)
  1403. {
  1404. string imgFilePath = path;
  1405. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1406. int i = (int)fs.Length;
  1407. byte[] content = new byte[i];
  1408. fs.Read(content, 0, i);
  1409. string result = Convert.ToBase64String(content);
  1410. fs.Close();
  1411. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1412. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1413. sw.Write(result);
  1414. sw.Close();
  1415. fsTxt.Close();
  1416. return result;
  1417. }
  1418. #endregion
  1419. /// <summary>
  1420. /// 获得产品分级
  1421. /// </summary>
  1422. /// <param name="accountCode">帐套code</param>
  1423. /// <param name="userCode">用户code</param>
  1424. /// <param name="userPassword">用户密码</param>
  1425. /// <param name="sessionKey">本次登陆密钥</param>
  1426. /// <param name="procedureID">当前工序ID</param>
  1427. /// <returns></returns>
  1428. /// <remarks>
  1429. /// 陈冰 2014.10.22 新建
  1430. /// </remarks>
  1431. public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1432. {
  1433. ActionResult actionResult = new ActionResult();
  1434. try
  1435. {
  1436. // 验证请求头信息
  1437. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1438. // 验证失败
  1439. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1440. {
  1441. return actionResult;
  1442. }
  1443. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1444. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1445. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1446. {
  1447. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1448. actionResult.Status = (int)Constant.PDAResult.Success;
  1449. }
  1450. else
  1451. {
  1452. actionResult.Status = (int)Constant.PDAResult.Fail;
  1453. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1454. }
  1455. }
  1456. catch (Exception ex)
  1457. {
  1458. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1459. OutputLog.TraceLog(LogPriority.Error,
  1460. this.ToString(),
  1461. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1462. ex.ToString(),
  1463. LocalPath.LogExePath);
  1464. actionResult.Status = (int)Constant.PDAResult.Exception;
  1465. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1466. }
  1467. return actionResult;
  1468. }
  1469. /// <summary>
  1470. /// 获得产品分级
  1471. /// </summary>
  1472. /// <param name="accountCode">帐套code</param>
  1473. /// <param name="userCode">用户code</param>
  1474. /// <param name="userPassword">用户密码</param>
  1475. /// <param name="sessionKey">本次登陆密钥</param>
  1476. /// <param name="barcode">条码</param>
  1477. /// <returns></returns>
  1478. public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1479. {
  1480. ActionResult actionResult = new ActionResult();
  1481. try
  1482. {
  1483. // 验证请求头信息
  1484. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1485. // 验证失败
  1486. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1487. {
  1488. return actionResult;
  1489. }
  1490. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1491. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1492. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1493. {
  1494. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1495. actionResult.Status = (int)Constant.PDAResult.Success;
  1496. }
  1497. else
  1498. {
  1499. actionResult.Status = (int)Constant.PDAResult.Fail;
  1500. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1501. }
  1502. }
  1503. catch (Exception ex)
  1504. {
  1505. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1506. OutputLog.TraceLog(LogPriority.Error,
  1507. this.ToString(),
  1508. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1509. ex.ToString(),
  1510. LocalPath.LogExePath);
  1511. actionResult.Status = (int)Constant.PDAResult.Exception;
  1512. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1513. }
  1514. return actionResult;
  1515. }
  1516. #region 统计
  1517. /// <summary>
  1518. /// 统计当日计数数量
  1519. /// </summary>
  1520. /// <param name="accountCode">帐套code</param>
  1521. /// <param name="userCode">用户code</param>
  1522. /// <param name="userPassword">用户密码</param>
  1523. /// <param name="sessionKey">本次登陆密钥</param>
  1524. /// <param name="procedureID">工序ID</param>
  1525. /// <returns></returns>
  1526. public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1527. {
  1528. ActionResult actionResult = new ActionResult();
  1529. try
  1530. {
  1531. // 验证请求头信息
  1532. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1533. // 验证失败
  1534. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1535. {
  1536. return actionResult;
  1537. }
  1538. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1539. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1540. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1541. {
  1542. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1543. actionResult.Status = (int)Constant.PDAResult.Success;
  1544. }
  1545. else
  1546. {
  1547. actionResult.Status = (int)Constant.PDAResult.Fail;
  1548. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1549. }
  1550. }
  1551. catch (Exception ex)
  1552. {
  1553. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1554. OutputLog.TraceLog(LogPriority.Error,
  1555. this.ToString(),
  1556. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1557. ex.ToString(),
  1558. LocalPath.LogExePath);
  1559. actionResult.Status = (int)Constant.PDAResult.Exception;
  1560. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1561. }
  1562. return actionResult;
  1563. }
  1564. /// <summary>
  1565. /// 统计当日计数数量
  1566. /// </summary>
  1567. /// <param name="accountCode">帐套code</param>
  1568. /// <param name="userCode">用户code</param>
  1569. /// <param name="userPassword">用户密码</param>
  1570. /// <param name="sessionKey">本次登陆密钥</param>
  1571. /// <param name="procedureID">工序ID</param>
  1572. /// <returns></returns>
  1573. public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1574. {
  1575. ActionResult actionResult = new ActionResult();
  1576. try
  1577. {
  1578. // 验证请求头信息
  1579. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1580. // 验证失败
  1581. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1582. {
  1583. return actionResult;
  1584. }
  1585. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1586. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1587. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1588. {
  1589. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1590. actionResult.Status = (int)Constant.PDAResult.Success;
  1591. }
  1592. else
  1593. {
  1594. actionResult.Status = (int)Constant.PDAResult.Fail;
  1595. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1596. }
  1597. }
  1598. catch (Exception ex)
  1599. {
  1600. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1601. OutputLog.TraceLog(LogPriority.Error,
  1602. this.ToString(),
  1603. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1604. ex.ToString(),
  1605. LocalPath.LogExePath);
  1606. actionResult.Status = (int)Constant.PDAResult.Exception;
  1607. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1608. }
  1609. return actionResult;
  1610. }
  1611. /// <summary>
  1612. /// 统计产品跟踪
  1613. /// </summary>
  1614. /// <param name="accountCode">帐套code</param>
  1615. /// <param name="userCode">用户code</param>
  1616. /// <param name="userPassword">用户密码</param>
  1617. /// <param name="sessionKey">本次登陆密钥</param>
  1618. /// <param name="procedureID">工序ID</param>
  1619. /// <returns></returns>
  1620. public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1621. {
  1622. ActionResult actionResult = new ActionResult();
  1623. try
  1624. {
  1625. // 验证请求头信息
  1626. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1627. // 验证失败
  1628. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1629. {
  1630. return actionResult;
  1631. }
  1632. RPT020101_SE se = new RPT020101_SE();
  1633. se.Barcode = barcode;
  1634. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1635. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1636. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1637. {
  1638. actionResult.Status = (int)Constant.PDAResult.Fail;
  1639. actionResult.Message = Messages.MSG_CMN_I002;
  1640. }
  1641. else
  1642. {
  1643. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1644. actionResult.Status = (int)Constant.PDAResult.Success;
  1645. }
  1646. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1647. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1648. //if (productionDataEntity != null)
  1649. //{
  1650. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1651. // actionResult.Status = (int)Constant.PDAResult.Success;
  1652. //}
  1653. //else
  1654. //{
  1655. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1656. // actionResult.Message = Messages.MSG_CMN_I002;
  1657. //}
  1658. }
  1659. catch (Exception ex)
  1660. {
  1661. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1662. OutputLog.TraceLog(LogPriority.Error,
  1663. this.ToString(),
  1664. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1665. ex.ToString() + ex.HelpLink,
  1666. LocalPath.LogExePath);
  1667. actionResult.Status = (int)Constant.PDAResult.Exception;
  1668. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1669. }
  1670. return actionResult;
  1671. }
  1672. #endregion
  1673. #region 撤销装车及成检
  1674. /// <summary>
  1675. /// 检验条码是否可以撤销装车
  1676. /// </summary>
  1677. /// <param name="accountCode">帐套code</param>
  1678. /// <param name="userCode">用户code</param>
  1679. /// <param name="userPassword">用户密码</param>
  1680. /// <param name="sessionKey">本次登陆密钥</param>
  1681. /// <param name="procedureID">当前工序ID</param>
  1682. /// <param name="barcode">条码</param>
  1683. /// <returns></returns>
  1684. public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1685. {
  1686. ActionResult actionResult = new ActionResult();
  1687. try
  1688. {
  1689. // 验证请求头信息
  1690. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1691. // 验证失败
  1692. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1693. {
  1694. return actionResult;
  1695. }
  1696. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1697. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1698. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1699. actionResult.Status = (int)Constant.PDAResult.Success;
  1700. }
  1701. catch (Exception ex)
  1702. {
  1703. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1704. OutputLog.TraceLog(LogPriority.Error,
  1705. this.ToString(),
  1706. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1707. ex.ToString(),
  1708. LocalPath.LogExePath);
  1709. actionResult.Status = (int)Constant.PDAResult.Exception;
  1710. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1711. }
  1712. return actionResult;
  1713. }
  1714. /// <summary>
  1715. /// 保存撤销装车的条码
  1716. /// </summary>
  1717. /// <param name="accountCode">帐套code</param>
  1718. /// <param name="userCode">用户code</param>
  1719. /// <param name="userPassword">用户密码</param>
  1720. /// <param name="sessionKey">本次登陆密钥</param>
  1721. /// <param name="procedureID">当前工序ID</param>
  1722. /// <param name="barcode">条码</param>
  1723. /// <returns></returns>
  1724. public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1725. {
  1726. ActionResult actionResult = new ActionResult();
  1727. try
  1728. {
  1729. // 验证请求头信息
  1730. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1731. // 验证失败
  1732. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1733. {
  1734. return actionResult;
  1735. }
  1736. string err = ServiceInvoker.Invoke<string>(this,
  1737. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1738. if (err == null)
  1739. {
  1740. err = "";
  1741. }
  1742. actionResult.Result = JsonHelper.ToJson(err);
  1743. actionResult.Status = (int)Constant.PDAResult.Success;
  1744. }
  1745. catch (Exception ex)
  1746. {
  1747. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1748. OutputLog.TraceLog(LogPriority.Error,
  1749. this.ToString(),
  1750. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1751. ex.ToString(),
  1752. LocalPath.LogExePath);
  1753. actionResult.Status = (int)Constant.PDAResult.Exception;
  1754. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1755. }
  1756. return actionResult;
  1757. }
  1758. /// <summary>
  1759. /// 由产品条码获取注浆信息
  1760. /// </summary>
  1761. /// <param name="barcode"></param>
  1762. /// <returns></returns>
  1763. public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1764. {
  1765. ActionResult actionResult = new ActionResult();
  1766. try
  1767. {
  1768. // 验证请求头信息
  1769. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1770. // 验证失败
  1771. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1772. {
  1773. return actionResult;
  1774. }
  1775. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1776. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1777. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1778. {
  1779. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1780. actionResult.Status = (int)Constant.PDAResult.Success;
  1781. }
  1782. else
  1783. {
  1784. actionResult.Status = (int)Constant.PDAResult.Fail;
  1785. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1786. }
  1787. }
  1788. catch (Exception ex)
  1789. {
  1790. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1791. OutputLog.TraceLog(LogPriority.Error,
  1792. this.ToString(),
  1793. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1794. ex.ToString(),
  1795. LocalPath.LogExePath);
  1796. actionResult.Status = (int)Constant.PDAResult.Exception;
  1797. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1798. }
  1799. return actionResult;
  1800. }
  1801. /// <summary>
  1802. /// 获取工号下的所有工种信息
  1803. /// </summary>
  1804. /// <param name="UserID">工号ID</param>
  1805. /// <returns></returns>
  1806. public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1807. {
  1808. ActionResult actionResult = new ActionResult();
  1809. try
  1810. {
  1811. // 验证请求头信息
  1812. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1813. // 验证失败
  1814. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1815. {
  1816. return actionResult;
  1817. }
  1818. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1819. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1820. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1821. {
  1822. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1823. actionResult.Status = (int)Constant.PDAResult.Success;
  1824. }
  1825. else
  1826. {
  1827. actionResult.Status = (int)Constant.PDAResult.Fail;
  1828. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1829. }
  1830. }
  1831. catch (Exception ex)
  1832. {
  1833. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1834. OutputLog.TraceLog(LogPriority.Error,
  1835. this.ToString(),
  1836. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1837. ex.ToString(),
  1838. LocalPath.LogExePath);
  1839. actionResult.Status = (int)Constant.PDAResult.Exception;
  1840. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1841. }
  1842. return actionResult;
  1843. }
  1844. /// <summary>
  1845. /// 根据所选工号对应的工种,查出缺陷责任员工
  1846. /// </summary>
  1847. /// <param name="jobs">工种ID</param>
  1848. /// <returns></returns>
  1849. public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  1850. {
  1851. ActionResult actionResult = new ActionResult();
  1852. try
  1853. {
  1854. // 验证请求头信息
  1855. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1856. // 验证失败
  1857. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1858. {
  1859. return actionResult;
  1860. }
  1861. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1862. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  1863. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1864. {
  1865. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1866. actionResult.Status = (int)Constant.PDAResult.Success;
  1867. }
  1868. else
  1869. {
  1870. actionResult.Status = (int)Constant.PDAResult.Fail;
  1871. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1872. }
  1873. }
  1874. catch (Exception ex)
  1875. {
  1876. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1877. OutputLog.TraceLog(LogPriority.Error,
  1878. this.ToString(),
  1879. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1880. ex.ToString(),
  1881. LocalPath.LogExePath);
  1882. actionResult.Status = (int)Constant.PDAResult.Exception;
  1883. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1884. }
  1885. return actionResult;
  1886. }
  1887. /// <summary>
  1888. /// 根据所选工号,查出漏检责任员工
  1889. /// </summary>
  1890. /// <param name="userid">工号</param>
  1891. /// <returns></returns>
  1892. public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  1893. {
  1894. ActionResult actionResult = new ActionResult();
  1895. try
  1896. {
  1897. // 验证请求头信息
  1898. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1899. // 验证失败
  1900. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1901. {
  1902. return actionResult;
  1903. }
  1904. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1905. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  1906. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1907. {
  1908. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1909. actionResult.Status = (int)Constant.PDAResult.Success;
  1910. }
  1911. else
  1912. {
  1913. actionResult.Status = (int)Constant.PDAResult.Fail;
  1914. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1915. }
  1916. }
  1917. catch (Exception ex)
  1918. {
  1919. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1920. OutputLog.TraceLog(LogPriority.Error,
  1921. this.ToString(),
  1922. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1923. ex.ToString(),
  1924. LocalPath.LogExePath);
  1925. actionResult.Status = (int)Constant.PDAResult.Exception;
  1926. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1927. }
  1928. return actionResult;
  1929. }
  1930. /// <summary>
  1931. /// 获取用户列表
  1932. /// </summary>
  1933. /// <param name="requestEntity">用户实体</param>
  1934. /// <returns></returns>
  1935. public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  1936. {
  1937. ActionResult actionResult = new ActionResult();
  1938. try
  1939. {
  1940. // 验证请求头信息
  1941. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1942. // 验证失败
  1943. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1944. {
  1945. return actionResult;
  1946. }
  1947. SUserEntity requestEntity = new SUserEntity();
  1948. requestEntity.IsWorker = IsWorker;
  1949. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1950. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  1951. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1952. {
  1953. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1954. actionResult.Status = (int)Constant.PDAResult.Success;
  1955. }
  1956. else
  1957. {
  1958. actionResult.Status = (int)Constant.PDAResult.Fail;
  1959. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1960. }
  1961. }
  1962. catch (Exception ex)
  1963. {
  1964. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1965. OutputLog.TraceLog(LogPriority.Error,
  1966. this.ToString(),
  1967. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1968. ex.ToString(),
  1969. LocalPath.LogExePath);
  1970. actionResult.Status = (int)Constant.PDAResult.Exception;
  1971. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1972. }
  1973. return actionResult;
  1974. }
  1975. /// <summary>
  1976. /// 获取数据字典管理的数据
  1977. /// </summary>
  1978. /// <param name="Pvalue">显示停用标识</param>
  1979. /// <param name="dictionaryType">字典类别</param>
  1980. /// <returns></returns>
  1981. /// <remarks>
  1982. /// 2014.12.03 新建
  1983. /// </remarks>
  1984. public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  1985. {
  1986. ActionResult actionResult = new ActionResult();
  1987. try
  1988. {
  1989. // 验证请求头信息
  1990. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1991. // 验证失败
  1992. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1993. {
  1994. return actionResult;
  1995. }
  1996. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1997. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  1998. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1999. {
  2000. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2001. actionResult.Status = (int)Constant.PDAResult.Success;
  2002. }
  2003. else
  2004. {
  2005. actionResult.Status = (int)Constant.PDAResult.Fail;
  2006. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2007. }
  2008. }
  2009. catch (Exception ex)
  2010. {
  2011. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2012. OutputLog.TraceLog(LogPriority.Error,
  2013. this.ToString(),
  2014. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2015. ex.ToString(),
  2016. LocalPath.LogExePath);
  2017. actionResult.Status = (int)Constant.PDAResult.Exception;
  2018. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2019. }
  2020. return actionResult;
  2021. }
  2022. #endregion
  2023. #region 保存半检数据
  2024. /// <summary>
  2025. /// 保存半检数据
  2026. /// </summary>
  2027. /// <param name="accountCode">帐套code</param>
  2028. /// <param name="userCode">用户code</param>
  2029. /// <param name="userPassword">用户密码</param>
  2030. /// <param name="sessionKey">本次登陆密钥</param>
  2031. /// <param name="productionDataEntitys">半检信息</param>
  2032. /// <returns></returns>
  2033. public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  2034. {
  2035. ActionResult actionResult = new ActionResult();
  2036. try
  2037. {
  2038. // 验证请求头信息
  2039. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2040. // 验证失败
  2041. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2042. {
  2043. return actionResult;
  2044. }
  2045. string err = ServiceInvoker.Invoke<string>(this,
  2046. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2047. if (err == null)
  2048. {
  2049. err = "";
  2050. }
  2051. actionResult.Result = JsonHelper.ToJson(err);
  2052. actionResult.Status = (int)Constant.PDAResult.Success;
  2053. }
  2054. catch (Exception ex)
  2055. {
  2056. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2057. OutputLog.TraceLog(LogPriority.Error,
  2058. this.ToString(),
  2059. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2060. ex.ToString(),
  2061. LocalPath.LogExePath);
  2062. actionResult.Status = (int)Constant.PDAResult.Exception;
  2063. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2064. }
  2065. return actionResult;
  2066. }
  2067. #endregion
  2068. /// <summary>
  2069. /// 获取产品列表
  2070. /// </summary>
  2071. /// <returns></returns>
  2072. public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  2073. {
  2074. ActionResult actionResult = new ActionResult();
  2075. try
  2076. {
  2077. // 验证请求头信息
  2078. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2079. // 验证失败
  2080. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2081. {
  2082. return actionResult;
  2083. }
  2084. GoodsEntity goodsEntity = new GoodsEntity();
  2085. goodsEntity.ValueFlag = 1;//有效标记
  2086. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2087. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2088. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2089. {
  2090. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2091. actionResult.Status = (int)Constant.PDAResult.Success;
  2092. }
  2093. else
  2094. {
  2095. actionResult.Status = (int)Constant.PDAResult.Fail;
  2096. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2097. }
  2098. }
  2099. catch (Exception ex)
  2100. {
  2101. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2102. OutputLog.TraceLog(LogPriority.Error,
  2103. this.ToString(),
  2104. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2105. ex.ToString(),
  2106. LocalPath.LogExePath);
  2107. actionResult.Status = (int)Constant.PDAResult.Exception;
  2108. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2109. }
  2110. return actionResult;
  2111. }
  2112. /// <summary>
  2113. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2114. /// </summary>
  2115. /// <param name="searchEntity">生产数据实体类</param>
  2116. /// <returns>DataTable</returns>
  2117. public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2118. {
  2119. ActionResult actionResult = new ActionResult();
  2120. try
  2121. {
  2122. // 验证请求头信息
  2123. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2124. // 验证失败
  2125. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2126. {
  2127. return actionResult;
  2128. }
  2129. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2130. searchEntity.ProcedureID = ProcedureID;
  2131. searchEntity.BarCode = BarCode;
  2132. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2133. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2134. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2135. {
  2136. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2137. actionResult.Status = (int)Constant.PDAResult.Success;
  2138. }
  2139. else
  2140. {
  2141. actionResult.Status = (int)Constant.PDAResult.Fail;
  2142. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2143. }
  2144. }
  2145. catch (Exception ex)
  2146. {
  2147. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2148. OutputLog.TraceLog(LogPriority.Error,
  2149. this.ToString(),
  2150. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2151. ex.ToString(),
  2152. LocalPath.LogExePath);
  2153. actionResult.Status = (int)Constant.PDAResult.Exception;
  2154. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2155. }
  2156. return actionResult;
  2157. }
  2158. /// <summary>
  2159. /// xuwei add 2020-03-23 此方法用于成检后 回收 再次成检 获取正确ID
  2160. /// </summary>
  2161. /// <param name="searchEntity">生产数据实体类</param>
  2162. /// <returns>DataTable</returns>
  2163. public ActionResult GetProductionDataCheckID(string accountCode, string userCode, string userPassword, string sessionKey, string BarCode)
  2164. {
  2165. ActionResult actionResult = new ActionResult();
  2166. try
  2167. {
  2168. // 验证请求头信息
  2169. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2170. // 验证失败
  2171. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2172. {
  2173. return actionResult;
  2174. }
  2175. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2176. searchEntity.BarCode = BarCode;
  2177. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2178. () => PDAModuleLogic.GetProductionDataCheckID(searchEntity, sUserInfo));
  2179. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2180. {
  2181. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2182. actionResult.Status = (int)Constant.PDAResult.Success;
  2183. }
  2184. else
  2185. {
  2186. actionResult.Status = (int)Constant.PDAResult.Fail;
  2187. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2188. }
  2189. }
  2190. catch (Exception ex)
  2191. {
  2192. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2193. OutputLog.TraceLog(LogPriority.Error,
  2194. this.ToString(),
  2195. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2196. ex.ToString(),
  2197. LocalPath.LogExePath);
  2198. actionResult.Status = (int)Constant.PDAResult.Exception;
  2199. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2200. }
  2201. return actionResult;
  2202. }
  2203. /// <summary>
  2204. /// 根据所选生产数据ID,显示成检数据信息
  2205. /// </summary>
  2206. /// <param name="productionDataID">生产数据ID</param>
  2207. /// <returns>DataSet</returns>
  2208. public ActionResult GetProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2209. {
  2210. ActionResult actionResult = new ActionResult();
  2211. try
  2212. {
  2213. // 验证请求头信息
  2214. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2215. // 验证失败
  2216. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2217. {
  2218. return actionResult;
  2219. }
  2220. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2221. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2222. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2223. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2224. {
  2225. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2226. {
  2227. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2228. {
  2229. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2230. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2231. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2232. {
  2233. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2234. }
  2235. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2236. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2237. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2238. {
  2239. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2240. }
  2241. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2242. {
  2243. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2244. }
  2245. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2246. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2247. {
  2248. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2249. }
  2250. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2251. {
  2252. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2253. }
  2254. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2255. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2256. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2257. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2258. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2259. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2260. productionData.GlazeName = reworkDs.Tables[0].Rows[i]["GlazeName"].ToString();
  2261. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2262. {
  2263. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2264. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2265. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2266. }
  2267. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2268. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2269. {
  2270. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2271. }
  2272. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2273. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2274. DataTable dtDefect = dvDefect.ToTable();
  2275. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2276. {
  2277. // 产品缺陷
  2278. PDADefectResult defect = new PDADefectResult();
  2279. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2280. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2281. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2282. {
  2283. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2284. }
  2285. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2286. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2287. {
  2288. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2289. }
  2290. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2291. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2292. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2293. {
  2294. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2295. }
  2296. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2297. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2298. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2299. {
  2300. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2301. }
  2302. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2303. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2304. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2305. {
  2306. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2307. }
  2308. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2309. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2310. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2311. {
  2312. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2313. }
  2314. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2315. {
  2316. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2317. }
  2318. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2319. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2320. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2321. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2322. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2323. {
  2324. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2325. }
  2326. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2327. {
  2328. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2329. }
  2330. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2331. {
  2332. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2333. }
  2334. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2335. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2336. //--------责任员工-------------------
  2337. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2338. if (drRow.Length > Constant.INT_IS_ZERO)
  2339. {
  2340. foreach (DataRow r in drRow)
  2341. {
  2342. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2343. if (r["ProductionDefectID"].ToString() != "")
  2344. {
  2345. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2346. }
  2347. if (r["StaffID"].ToString() != "")
  2348. {
  2349. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2350. }
  2351. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2352. defectResponsible.StaffName = r["StaffName"].ToString();
  2353. if (r["StaffStatus"].ToString() != "")
  2354. {
  2355. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2356. }
  2357. if (r["UJobsID"].ToString() != "")
  2358. {
  2359. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2360. }
  2361. if (r["SJobsID"].ToString() != "")
  2362. {
  2363. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2364. }
  2365. defect.PDADefectResponsibles.Add(defectResponsible);
  2366. }
  2367. }
  2368. //------------------------------
  2369. //--------漏检员工-------------------
  2370. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2371. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2372. {
  2373. foreach (DataRow r in drMissedRow)
  2374. {
  2375. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2376. if (r["ProductionDefectID"].ToString() != "")
  2377. {
  2378. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2379. }
  2380. if (r["StaffID"].ToString() != "")
  2381. {
  2382. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2383. }
  2384. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2385. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2386. if (r["StaffStatus"].ToString() != "")
  2387. {
  2388. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2389. }
  2390. if (r["UJobsID"].ToString() != "")
  2391. {
  2392. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2393. }
  2394. if (r["SJobsID"].ToString() != "")
  2395. {
  2396. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2397. }
  2398. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2399. }
  2400. }
  2401. //------------------------------
  2402. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2403. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2404. {
  2405. foreach (DataRow r in drImageRow)
  2406. {
  2407. PDADefectImageResult defectImage = new PDADefectImageResult();
  2408. if (r["ProductionDefectID"].ToString() != "")
  2409. {
  2410. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2411. }
  2412. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2413. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2414. //{
  2415. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2416. //}
  2417. defect.PDADefectImageResults.Add(defectImage);
  2418. }
  2419. }
  2420. productionData.PDADefects.Add(defect);
  2421. }
  2422. if (productionDatas.PDAProductionData == null)
  2423. {
  2424. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2425. }
  2426. productionDatas.PDAProductionData.Add(productionData);
  2427. //---------------------------------------------------------------------------------
  2428. }
  2429. }
  2430. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2431. actionResult.Status = (int)Constant.PDAResult.Success;
  2432. }
  2433. else
  2434. {
  2435. actionResult.Status = (int)Constant.PDAResult.Fail;
  2436. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2437. }
  2438. }
  2439. catch (Exception ex)
  2440. {
  2441. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2442. OutputLog.TraceLog(LogPriority.Error,
  2443. this.ToString(),
  2444. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2445. ex.ToString(),
  2446. LocalPath.LogExePath);
  2447. actionResult.Status = (int)Constant.PDAResult.Exception;
  2448. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2449. }
  2450. return actionResult;
  2451. }
  2452. /// <summary>
  2453. /// 编辑后删除生产数据
  2454. /// </summary>
  2455. /// <param name="productionDataID">生产数据ID</param>
  2456. /// <returns>int</returns>
  2457. public ActionResult DeleteProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2458. {
  2459. ActionResult actionResult = new ActionResult();
  2460. try
  2461. {
  2462. // 验证请求头信息
  2463. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2464. // 验证失败
  2465. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2466. {
  2467. return actionResult;
  2468. }
  2469. int row = ServiceInvoker.Invoke<int>(this,
  2470. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2471. actionResult.Result = JsonHelper.ToJson(row);
  2472. actionResult.Status = (int)Constant.PDAResult.Success;
  2473. }
  2474. catch (Exception ex)
  2475. {
  2476. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2477. OutputLog.TraceLog(LogPriority.Error,
  2478. this.ToString(),
  2479. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2480. ex.ToString(),
  2481. LocalPath.LogExePath);
  2482. actionResult.Status = (int)Constant.PDAResult.Exception;
  2483. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2484. }
  2485. return actionResult;
  2486. }
  2487. /// <summary>
  2488. /// 获取产品完成工序的ID
  2489. /// </summary>
  2490. /// <param name="barcode">产品条码</param>
  2491. /// <returns>int</returns>
  2492. public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2493. {
  2494. ActionResult actionResult = new ActionResult();
  2495. try
  2496. {
  2497. // 验证请求头信息
  2498. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2499. // 验证失败
  2500. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2501. {
  2502. return actionResult;
  2503. }
  2504. int row = ServiceInvoker.Invoke<int>(this,
  2505. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2506. actionResult.Result = JsonHelper.ToJson(row);
  2507. actionResult.Status = (int)Constant.PDAResult.Success;
  2508. }
  2509. catch (Exception ex)
  2510. {
  2511. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2512. OutputLog.TraceLog(LogPriority.Error,
  2513. this.ToString(),
  2514. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2515. ex.ToString(),
  2516. LocalPath.LogExePath);
  2517. actionResult.Status = (int)Constant.PDAResult.Exception;
  2518. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2519. }
  2520. return actionResult;
  2521. }
  2522. /// <summary>
  2523. /// 绑定图片
  2524. /// </summary>
  2525. /// <param name="accountCode">帐套code</param>
  2526. /// <param name="userCode">用户code</param>
  2527. /// <param name="userPassword">用户密码</param>
  2528. /// <param name="sessionKey">本次登陆密钥</param>
  2529. /// <param name="imagePath">图片路径</param>
  2530. /// <returns></returns>
  2531. public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2532. {
  2533. try
  2534. {
  2535. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2536. }
  2537. catch (Exception ex)
  2538. {
  2539. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2540. OutputLog.TraceLog(LogPriority.Error,
  2541. this.ToString(),
  2542. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2543. ex.ToString(),
  2544. LocalPath.LogExePath);
  2545. return null;
  2546. }
  2547. }
  2548. /// <summary>
  2549. /// 根据所选工号对应的工种,查出缺陷责任员工
  2550. /// </summary>
  2551. /// <param name="jobs">工种ID</param>
  2552. /// <returns></returns>
  2553. public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2554. {
  2555. ActionResult actionResult = new ActionResult();
  2556. try
  2557. {
  2558. // 验证请求头信息
  2559. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2560. // 验证失败
  2561. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2562. {
  2563. return actionResult;
  2564. }
  2565. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2566. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2567. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2568. {
  2569. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2570. actionResult.Status = (int)Constant.PDAResult.Success;
  2571. }
  2572. else
  2573. {
  2574. actionResult.Status = (int)Constant.PDAResult.Fail;
  2575. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2576. }
  2577. }
  2578. catch (Exception ex)
  2579. {
  2580. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2581. OutputLog.TraceLog(LogPriority.Error,
  2582. this.ToString(),
  2583. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2584. ex.ToString(),
  2585. LocalPath.LogExePath);
  2586. actionResult.Status = (int)Constant.PDAResult.Exception;
  2587. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2588. }
  2589. return actionResult;
  2590. }
  2591. #region 产品报废
  2592. /// <summary>
  2593. /// 验证废弃产品唯一性
  2594. /// </summary>
  2595. /// <param name="barcode">产品条码</param>
  2596. /// <returns>int</returns>
  2597. public ActionResult ScrapProductChack(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2598. {
  2599. ActionResult actionResult = new ActionResult();
  2600. try
  2601. {
  2602. // 验证请求头信息
  2603. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2604. // 验证失败
  2605. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2606. {
  2607. return actionResult;
  2608. }
  2609. string row = ServiceInvoker.Invoke<string>(this,
  2610. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2611. string[] rm = row.Split(':');
  2612. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2613. if (rm.Length > 1)
  2614. {
  2615. actionResult.Message = rm[1];
  2616. }
  2617. actionResult.Status = (int)Constant.PDAResult.Success;
  2618. }
  2619. catch (Exception ex)
  2620. {
  2621. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2622. OutputLog.TraceLog(LogPriority.Error,
  2623. this.ToString(),
  2624. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2625. ex.ToString(),
  2626. LocalPath.LogExePath);
  2627. actionResult.Status = (int)Constant.PDAResult.Exception;
  2628. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2629. }
  2630. return actionResult;
  2631. }
  2632. /// <summary>
  2633. /// 根据条码获取该产品的在产信息以及生产数据
  2634. /// </summary>
  2635. /// <param name="Barcode">产品条码</param>
  2636. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2637. public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2638. {
  2639. ActionResult actionResult = new ActionResult();
  2640. try
  2641. {
  2642. // 验证请求头信息
  2643. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2644. // 验证失败
  2645. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2646. {
  2647. return actionResult;
  2648. }
  2649. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2650. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2651. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2652. {
  2653. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2654. actionResult.Status = (int)Constant.PDAResult.Success;
  2655. }
  2656. else
  2657. {
  2658. actionResult.Status = (int)Constant.PDAResult.Fail;
  2659. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2660. }
  2661. }
  2662. catch (Exception ex)
  2663. {
  2664. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2665. OutputLog.TraceLog(LogPriority.Error,
  2666. this.ToString(),
  2667. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2668. ex.ToString(),
  2669. LocalPath.LogExePath);
  2670. actionResult.Status = (int)Constant.PDAResult.Exception;
  2671. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2672. }
  2673. return actionResult;
  2674. }
  2675. /// <summary>
  2676. /// 根据工号查询员工档案信息
  2677. /// </summary>
  2678. /// <param name="accountCode"></param>
  2679. /// <param name="userCode"></param>
  2680. /// <param name="userPassword"></param>
  2681. /// <param name="sessionKey"></param>
  2682. /// <param name="userId"></param>
  2683. /// <returns></returns>
  2684. public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2685. {
  2686. ActionResult actionResult = new ActionResult();
  2687. try
  2688. {
  2689. // 验证请求头信息
  2690. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2691. // 验证失败
  2692. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2693. {
  2694. return actionResult;
  2695. }
  2696. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2697. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2698. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2699. {
  2700. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2701. actionResult.Status = (int)Constant.PDAResult.Success;
  2702. }
  2703. else
  2704. {
  2705. actionResult.Status = (int)Constant.PDAResult.Fail;
  2706. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2707. }
  2708. }
  2709. catch (Exception ex)
  2710. {
  2711. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2712. OutputLog.TraceLog(LogPriority.Error,
  2713. this.ToString(),
  2714. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2715. ex.ToString(),
  2716. LocalPath.LogExePath);
  2717. actionResult.Status = (int)Constant.PDAResult.Exception;
  2718. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2719. }
  2720. return actionResult;
  2721. }
  2722. /// <summary>
  2723. /// 添加废弃产品记录
  2724. /// </summary>
  2725. /// <param name="SProductEntity">废弃产品实体</param>
  2726. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2727. /// <param name="SResponsibleList">责任者集合</param>
  2728. /// <param name="userInfo">用户基本信息</param>
  2729. /// <returns>int结果返回值</returns>
  2730. /// <remarks>
  2731. /// 庄天威 2014.09.24 新建
  2732. /// </remarks>
  2733. public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey,
  2734. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2735. ScrapResponsibleEntity[] SResponsibleList)
  2736. {
  2737. ActionResult actionResult = new ActionResult();
  2738. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2739. {
  2740. actionResult.Status = (int)Constant.PDAResult.Fail;
  2741. actionResult.Message = "没有选择责任人";
  2742. }
  2743. try
  2744. {
  2745. // 验证请求头信息
  2746. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2747. // 验证失败
  2748. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2749. {
  2750. return actionResult;
  2751. }
  2752. int addRow = ServiceInvoker.Invoke<int>(this,
  2753. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  2754. actionResult.Result = JsonHelper.ToJson(addRow);
  2755. actionResult.Status = (int)Constant.PDAResult.Success;
  2756. }
  2757. catch (Exception ex)
  2758. {
  2759. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2760. OutputLog.TraceLog(LogPriority.Error,
  2761. this.ToString(),
  2762. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2763. ex.ToString(),
  2764. LocalPath.LogExePath);
  2765. actionResult.Status = (int)Constant.PDAResult.Exception;
  2766. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2767. // TODO 空指针异常问题检测
  2768. try
  2769. {
  2770. OutputLog.TraceLog(LogPriority.Error,
  2771. this.ToString(),
  2772. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2773. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  2774. LocalPath.LogExePath);
  2775. string json1 = JsonHelper.ToJson(SProductEntity);
  2776. OutputLog.TraceLog(LogPriority.Error,
  2777. this.ToString(),
  2778. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2779. "SProductEntity:" + json1,
  2780. LocalPath.LogExePath);
  2781. string json2 = JsonHelper.ToJson(RProcedureEntity);
  2782. OutputLog.TraceLog(LogPriority.Error,
  2783. this.ToString(),
  2784. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2785. "RProcedureEntity:" + json2,
  2786. LocalPath.LogExePath);
  2787. string json3 = JsonHelper.ToJson(SResponsibleList);
  2788. OutputLog.TraceLog(LogPriority.Error,
  2789. this.ToString(),
  2790. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2791. "SResponsibleList:" + json3,
  2792. LocalPath.LogExePath);
  2793. }
  2794. catch (Exception exc)
  2795. {
  2796. OutputLog.TraceLog(LogPriority.Error,
  2797. this.ToString(),
  2798. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2799. "参数输入异常:" + exc.Message,
  2800. LocalPath.LogExePath);
  2801. }
  2802. }
  2803. return actionResult;
  2804. }
  2805. /// <summary>
  2806. /// 获取产品分级的数据(根据ID)
  2807. /// </summary>
  2808. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  2809. /// <param name="GoodsLevelID">分类ID</param>
  2810. /// <param name="sUserInfo">用户基本信息</param>
  2811. /// <returns>DataSet</returns>
  2812. /// <remarks>
  2813. /// 2014.10.22 庄天威 新建
  2814. public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  2815. {
  2816. ActionResult actionResult = new ActionResult();
  2817. try
  2818. {
  2819. // 验证请求头信息
  2820. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2821. // 验证失败
  2822. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2823. {
  2824. return actionResult;
  2825. }
  2826. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2827. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  2828. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2829. {
  2830. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2831. actionResult.Status = (int)Constant.PDAResult.Success;
  2832. }
  2833. else
  2834. {
  2835. actionResult.Status = (int)Constant.PDAResult.Fail;
  2836. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2837. }
  2838. }
  2839. catch (Exception ex)
  2840. {
  2841. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2842. OutputLog.TraceLog(LogPriority.Error,
  2843. this.ToString(),
  2844. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2845. ex.ToString(),
  2846. LocalPath.LogExePath);
  2847. actionResult.Status = (int)Constant.PDAResult.Exception;
  2848. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2849. }
  2850. return actionResult;
  2851. }
  2852. /// <summary>
  2853. /// 获取账务日期
  2854. /// </summary>
  2855. /// <param name="accountCode"></param>
  2856. /// <param name="userCode"></param>
  2857. /// <param name="userPassword"></param>
  2858. /// <param name="sessionKey"></param>
  2859. /// <returns></returns>
  2860. public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey)
  2861. {
  2862. ActionResult actionResult = new ActionResult();
  2863. try
  2864. {
  2865. // 验证请求头信息
  2866. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2867. // 验证失败
  2868. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2869. {
  2870. return actionResult;
  2871. }
  2872. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  2873. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  2874. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2875. actionResult.Status = (int)Constant.PDAResult.Success;
  2876. }
  2877. catch (Exception ex)
  2878. {
  2879. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2880. OutputLog.TraceLog(LogPriority.Error,
  2881. this.ToString(),
  2882. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2883. ex.ToString(),
  2884. LocalPath.LogExePath);
  2885. actionResult.Status = (int)Constant.PDAResult.Exception;
  2886. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2887. }
  2888. return actionResult;
  2889. }
  2890. /// <summary>
  2891. /// 获取登陆帐户有无报损权限
  2892. /// </summary>
  2893. /// <param name="accountCode"></param>
  2894. /// <param name="userCode"></param>
  2895. /// <param name="userPassword"></param>
  2896. /// <param name="sessionKey"></param>
  2897. /// <param name="usercode">工号编码</param>
  2898. /// <returns></returns>
  2899. public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  2900. {
  2901. ActionResult actionResult = new ActionResult();
  2902. try
  2903. {
  2904. // 验证请求头信息
  2905. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2906. // 验证失败
  2907. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2908. {
  2909. return actionResult;
  2910. }
  2911. int returnValue = ServiceInvoker.Invoke<int>(this,
  2912. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  2913. actionResult.Result = JsonHelper.ToJson(returnValue);
  2914. actionResult.Status = (int)Constant.PDAResult.Success;
  2915. }
  2916. catch (Exception ex)
  2917. {
  2918. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2919. OutputLog.TraceLog(LogPriority.Error,
  2920. this.ToString(),
  2921. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2922. ex.ToString(),
  2923. LocalPath.LogExePath);
  2924. actionResult.Status = (int)Constant.PDAResult.Exception;
  2925. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2926. }
  2927. return actionResult;
  2928. }
  2929. #endregion
  2930. /// <summary>
  2931. /// 获取是否存在报损未审核产品
  2932. /// </summary>
  2933. /// <param name="barcode">产品条码</param>
  2934. /// <returns>int</returns>
  2935. public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2936. {
  2937. ActionResult actionResult = new ActionResult();
  2938. try
  2939. {
  2940. // 验证请求头信息
  2941. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2942. // 验证失败
  2943. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2944. {
  2945. return actionResult;
  2946. }
  2947. int row = ServiceInvoker.Invoke<int>(this,
  2948. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  2949. actionResult.Result = JsonHelper.ToJson(row);
  2950. actionResult.Status = (int)Constant.PDAResult.Success;
  2951. }
  2952. catch (Exception ex)
  2953. {
  2954. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2955. OutputLog.TraceLog(LogPriority.Error,
  2956. this.ToString(),
  2957. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2958. ex.ToString(),
  2959. LocalPath.LogExePath);
  2960. actionResult.Status = (int)Constant.PDAResult.Exception;
  2961. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2962. }
  2963. return actionResult;
  2964. }
  2965. /// <summary>
  2966. /// 查询报废产品信息
  2967. /// </summary>
  2968. /// <param name="accountCode"></param>
  2969. /// <param name="userCode"></param>
  2970. /// <param name="userPassword"></param>
  2971. /// <param name="sessionKey"></param>
  2972. /// <param name="barCode">产品条码</param>
  2973. /// <param name="scrapProductID">报废产品ID</param>
  2974. /// <returns></returns>
  2975. public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  2976. {
  2977. ActionResult actionResult = new ActionResult();
  2978. try
  2979. {
  2980. // 验证请求头信息
  2981. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2982. // 验证失败
  2983. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2984. {
  2985. return actionResult;
  2986. }
  2987. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  2988. selectProEntity.BarCode = barCode;
  2989. selectProEntity.ScrapProductID = scrapProductID;
  2990. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2991. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  2992. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2993. {
  2994. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2995. actionResult.Status = (int)Constant.PDAResult.Success;
  2996. }
  2997. else
  2998. {
  2999. actionResult.Status = (int)Constant.PDAResult.Fail;
  3000. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3001. }
  3002. }
  3003. catch (Exception ex)
  3004. {
  3005. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3006. OutputLog.TraceLog(LogPriority.Error,
  3007. this.ToString(),
  3008. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3009. ex.ToString(),
  3010. LocalPath.LogExePath);
  3011. actionResult.Status = (int)Constant.PDAResult.Exception;
  3012. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3013. }
  3014. return actionResult;
  3015. }
  3016. /// <summary>
  3017. /// 根据废弃产品ID获取责任工序
  3018. /// </summary>
  3019. /// <param name="accountCode"></param>
  3020. /// <param name="userCode"></param>
  3021. /// <param name="userPassword"></param>
  3022. /// <param name="sessionKey"></param>
  3023. /// <param name="scrapProductID">报废产品ID</param>
  3024. /// <returns></returns>
  3025. public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3026. {
  3027. ActionResult actionResult = new ActionResult();
  3028. try
  3029. {
  3030. // 验证请求头信息
  3031. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3032. // 验证失败
  3033. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3034. {
  3035. return actionResult;
  3036. }
  3037. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3038. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  3039. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3040. {
  3041. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3042. actionResult.Status = (int)Constant.PDAResult.Success;
  3043. }
  3044. else
  3045. {
  3046. actionResult.Status = (int)Constant.PDAResult.Fail;
  3047. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3048. }
  3049. }
  3050. catch (Exception ex)
  3051. {
  3052. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3053. OutputLog.TraceLog(LogPriority.Error,
  3054. this.ToString(),
  3055. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3056. ex.ToString(),
  3057. LocalPath.LogExePath);
  3058. actionResult.Status = (int)Constant.PDAResult.Exception;
  3059. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3060. }
  3061. return actionResult;
  3062. }
  3063. /// <summary>
  3064. /// 根据废弃产品ID获取责任人列表
  3065. /// </summary>
  3066. /// <param name="accountCode"></param>
  3067. /// <param name="userCode"></param>
  3068. /// <param name="userPassword"></param>
  3069. /// <param name="sessionKey"></param>
  3070. /// <param name="scrapProductID">报废产品ID</param>
  3071. /// <returns></returns>
  3072. public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3073. {
  3074. ActionResult actionResult = new ActionResult();
  3075. try
  3076. {
  3077. // 验证请求头信息
  3078. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3079. // 验证失败
  3080. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3081. {
  3082. return actionResult;
  3083. }
  3084. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3085. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  3086. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3087. {
  3088. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3089. actionResult.Status = (int)Constant.PDAResult.Success;
  3090. }
  3091. else
  3092. {
  3093. actionResult.Status = (int)Constant.PDAResult.Fail;
  3094. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3095. }
  3096. }
  3097. catch (Exception ex)
  3098. {
  3099. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3100. OutputLog.TraceLog(LogPriority.Error,
  3101. this.ToString(),
  3102. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3103. ex.ToString(),
  3104. LocalPath.LogExePath);
  3105. actionResult.Status = (int)Constant.PDAResult.Exception;
  3106. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3107. }
  3108. return actionResult;
  3109. }
  3110. /// <summary>
  3111. /// 添加废弃产品记录
  3112. /// </summary>
  3113. /// <param name="SProductEntity">废弃产品实体</param>
  3114. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3115. /// <param name="SResponsibleList">责任者集合</param>
  3116. /// <param name="userInfo">用户基本信息</param>
  3117. /// <returns>int结果返回值</returns>
  3118. /// <remarks>
  3119. /// 庄天威 2014.09.24 新建
  3120. /// </remarks>
  3121. public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3122. ResponProcedureEntity UpdateRProcedureEntity,
  3123. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3124. {
  3125. ActionResult actionResult = new ActionResult();
  3126. try
  3127. {
  3128. // 验证请求头信息
  3129. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3130. // 验证失败
  3131. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3132. {
  3133. return actionResult;
  3134. }
  3135. int addRow = ServiceInvoker.Invoke<int>(this,
  3136. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3137. actionResult.Result = JsonHelper.ToJson(addRow);
  3138. actionResult.Status = (int)Constant.PDAResult.Success;
  3139. }
  3140. catch (Exception ex)
  3141. {
  3142. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3143. OutputLog.TraceLog(LogPriority.Error,
  3144. this.ToString(),
  3145. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3146. ex.ToString(),
  3147. LocalPath.LogExePath);
  3148. actionResult.Status = (int)Constant.PDAResult.Exception;
  3149. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3150. }
  3151. return actionResult;
  3152. }
  3153. /// <summary>
  3154. /// 获取产品窑炉
  3155. /// </summary>
  3156. /// <param name="accountCode"></param>
  3157. /// <param name="userCode"></param>
  3158. /// <param name="userPassword"></param>
  3159. /// <param name="sessionKey"></param>
  3160. /// <returns>Datase</returns>
  3161. public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  3162. {
  3163. ActionResult actionResult = new ActionResult();
  3164. try
  3165. {
  3166. // 验证请求头信息
  3167. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3168. // 验证失败
  3169. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3170. {
  3171. return actionResult;
  3172. }
  3173. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3174. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3175. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3176. {
  3177. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3178. actionResult.Status = (int)Constant.PDAResult.Success;
  3179. }
  3180. else
  3181. {
  3182. actionResult.Status = (int)Constant.PDAResult.Fail;
  3183. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3184. }
  3185. }
  3186. catch (Exception ex)
  3187. {
  3188. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3189. OutputLog.TraceLog(LogPriority.Error,
  3190. this.ToString(),
  3191. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3192. ex.ToString(),
  3193. LocalPath.LogExePath);
  3194. actionResult.Status = (int)Constant.PDAResult.Exception;
  3195. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3196. }
  3197. return actionResult;
  3198. }
  3199. /// <summary>
  3200. /// 获取次品产品条码允许编辑
  3201. /// </summary>
  3202. /// <param name="accountCode"></param>
  3203. /// <param name="userCode"></param>
  3204. /// <param name="userPassword"></param>
  3205. /// <param name="sessionKey"></param>
  3206. /// <param name="barcode">产品条码</param>
  3207. /// <returns>Datase</returns>
  3208. public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3209. {
  3210. ActionResult actionResult = new ActionResult();
  3211. try
  3212. {
  3213. // 验证请求头信息
  3214. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3215. // 验证失败
  3216. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3217. {
  3218. return actionResult;
  3219. }
  3220. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3221. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3222. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3223. {
  3224. actionResult.Result = JsonHelper.ToJson(1);
  3225. actionResult.Status = (int)Constant.PDAResult.Success;
  3226. }
  3227. else
  3228. {
  3229. actionResult.Result = JsonHelper.ToJson(0);
  3230. actionResult.Status = (int)Constant.PDAResult.Fail;
  3231. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3232. }
  3233. }
  3234. catch (Exception ex)
  3235. {
  3236. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3237. OutputLog.TraceLog(LogPriority.Error,
  3238. this.ToString(),
  3239. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3240. ex.ToString(),
  3241. LocalPath.LogExePath);
  3242. actionResult.Status = (int)Constant.PDAResult.Exception;
  3243. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3244. }
  3245. return actionResult;
  3246. }
  3247. /// <summary>
  3248. /// 获取产品条码是否重烧
  3249. /// </summary>
  3250. /// <param name="accountCode"></param>
  3251. /// <param name="userCode"></param>
  3252. /// <param name="userPassword"></param>
  3253. /// <param name="sessionKey"></param>
  3254. /// <param name="barcode">产品条码</param>
  3255. /// <returns>Datase</returns>
  3256. public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3257. {
  3258. ActionResult actionResult = new ActionResult();
  3259. try
  3260. {
  3261. // 验证请求头信息
  3262. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3263. // 验证失败
  3264. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3265. {
  3266. return actionResult;
  3267. }
  3268. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3269. () => PDAModuleLogic.GetReFine(barcode));
  3270. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3271. {
  3272. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3273. }
  3274. else
  3275. {
  3276. actionResult.Result = JsonHelper.ToJson(0);
  3277. }
  3278. actionResult.Status = (int)Constant.PDAResult.Success;
  3279. }
  3280. catch (Exception ex)
  3281. {
  3282. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3283. OutputLog.TraceLog(LogPriority.Error,
  3284. this.ToString(),
  3285. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3286. ex.ToString(),
  3287. LocalPath.LogExePath);
  3288. actionResult.Status = (int)Constant.PDAResult.Exception;
  3289. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3290. }
  3291. return actionResult;
  3292. }
  3293. /// <summary>
  3294. /// 获取登陆帐户有无成检编辑权限
  3295. /// </summary>
  3296. /// <param name="accountCode"></param>
  3297. /// <param name="userCode"></param>
  3298. /// <param name="userPassword"></param>
  3299. /// <param name="sessionKey"></param>
  3300. /// <param name="usercode">工号编码</param>
  3301. /// <returns></returns>
  3302. public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3303. {
  3304. ActionResult actionResult = new ActionResult();
  3305. try
  3306. {
  3307. // 验证请求头信息
  3308. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3309. // 验证失败
  3310. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3311. {
  3312. return actionResult;
  3313. }
  3314. int returnValue = ServiceInvoker.Invoke<int>(this,
  3315. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3316. actionResult.Result = JsonHelper.ToJson(returnValue);
  3317. actionResult.Status = (int)Constant.PDAResult.Success;
  3318. }
  3319. catch (Exception ex)
  3320. {
  3321. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3322. OutputLog.TraceLog(LogPriority.Error,
  3323. this.ToString(),
  3324. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3325. ex.ToString(),
  3326. LocalPath.LogExePath);
  3327. actionResult.Status = (int)Constant.PDAResult.Exception;
  3328. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3329. }
  3330. return actionResult;
  3331. }
  3332. /// <summary>
  3333. /// 根据条码及工序判断是否漏扫
  3334. /// </summary>
  3335. /// <param name="accountCode"></param>
  3336. /// <param name="userCode"></param>
  3337. /// <param name="userPassword"></param>
  3338. /// <param name="sessionKey"></param>
  3339. /// <param name="usercode">工号编码</param>
  3340. /// <param name="barcode">产品条码</param>
  3341. /// <param name="produceid">工序ID</param>
  3342. /// <returns></returns>
  3343. public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3344. {
  3345. ActionResult actionResult = new ActionResult();
  3346. try
  3347. {
  3348. // 验证请求头信息
  3349. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3350. // 验证失败
  3351. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3352. {
  3353. return actionResult;
  3354. }
  3355. int returnValue = 1;
  3356. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3357. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3358. actionResult.Result = JsonHelper.ToJson(returnValue);
  3359. actionResult.Status = (int)Constant.PDAResult.Success;
  3360. }
  3361. catch (Exception ex)
  3362. {
  3363. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3364. OutputLog.TraceLog(LogPriority.Error,
  3365. this.ToString(),
  3366. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3367. ex.ToString(),
  3368. LocalPath.LogExePath);
  3369. actionResult.Status = (int)Constant.PDAResult.Exception;
  3370. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3371. }
  3372. return actionResult;
  3373. }
  3374. /// <summary>
  3375. /// 获取登陆帐户有无报损审批权限
  3376. /// </summary>
  3377. /// <param name="accountCode"></param>
  3378. /// <param name="userCode"></param>
  3379. /// <param name="userPassword"></param>
  3380. /// <param name="sessionKey"></param>
  3381. /// <param name="usercode">工号编码</param>
  3382. /// <returns></returns>
  3383. public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3384. {
  3385. ActionResult actionResult = new ActionResult();
  3386. try
  3387. {
  3388. // 验证请求头信息
  3389. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3390. // 验证失败
  3391. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3392. {
  3393. return actionResult;
  3394. }
  3395. int returnValue = ServiceInvoker.Invoke<int>(this,
  3396. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3397. actionResult.Result = JsonHelper.ToJson(returnValue);
  3398. actionResult.Status = (int)Constant.PDAResult.Success;
  3399. }
  3400. catch (Exception ex)
  3401. {
  3402. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3403. OutputLog.TraceLog(LogPriority.Error,
  3404. this.ToString(),
  3405. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3406. ex.ToString(),
  3407. LocalPath.LogExePath);
  3408. actionResult.Status = (int)Constant.PDAResult.Exception;
  3409. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3410. }
  3411. return actionResult;
  3412. }
  3413. /// <summary>
  3414. /// 获取登陆帐户有无报损审批权限
  3415. /// </summary>
  3416. /// <param name="accountCode"></param>
  3417. /// <param name="userCode"></param>
  3418. /// <param name="userPassword"></param>
  3419. /// <param name="sessionKey"></param>
  3420. /// <param name="usercode">工号编码</param>
  3421. /// <returns></returns>
  3422. public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3423. {
  3424. ActionResult actionResult = new ActionResult();
  3425. try
  3426. {
  3427. // 验证请求头信息
  3428. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3429. // 验证失败
  3430. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3431. {
  3432. return actionResult;
  3433. }
  3434. int returnValue = ServiceInvoker.Invoke<int>(this,
  3435. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3436. actionResult.Result = JsonHelper.ToJson(returnValue);
  3437. actionResult.Status = (int)Constant.PDAResult.Success;
  3438. }
  3439. catch (Exception ex)
  3440. {
  3441. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3442. OutputLog.TraceLog(LogPriority.Error,
  3443. this.ToString(),
  3444. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3445. ex.ToString(),
  3446. LocalPath.LogExePath);
  3447. actionResult.Status = (int)Constant.PDAResult.Exception;
  3448. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3449. }
  3450. return actionResult;
  3451. }
  3452. /// <summary>
  3453. /// 获取窑车对应产品列表
  3454. /// </summary>
  3455. /// <param name="accountCode"></param>
  3456. /// <param name="userCode"></param>
  3457. /// <param name="userPassword"></param>
  3458. /// <param name="sessionKey"></param>
  3459. /// <param name="KilnCarID">窑车ID</param>
  3460. /// <returns>Dataset</returns>
  3461. public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  3462. {
  3463. ActionResult actionResult = new ActionResult();
  3464. try
  3465. {
  3466. // 验证请求头信息
  3467. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3468. // 验证失败
  3469. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3470. {
  3471. return actionResult;
  3472. }
  3473. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3474. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3475. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3476. {
  3477. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3478. actionResult.Status = (int)Constant.PDAResult.Success;
  3479. }
  3480. else
  3481. {
  3482. actionResult.Status = (int)Constant.PDAResult.Fail;
  3483. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3484. }
  3485. }
  3486. catch (Exception ex)
  3487. {
  3488. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3489. OutputLog.TraceLog(LogPriority.Error,
  3490. this.ToString(),
  3491. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3492. ex.ToString(),
  3493. LocalPath.LogExePath);
  3494. actionResult.Status = (int)Constant.PDAResult.Exception;
  3495. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3496. }
  3497. return actionResult;
  3498. }
  3499. /// <summary>
  3500. /// 更换条码
  3501. /// </summary>
  3502. /// <param name="accountCode"></param>
  3503. /// <param name="userCode"></param>
  3504. /// <param name="userPassword"></param>
  3505. /// <param name="sessionKey"></param>
  3506. ///<param name="barcode">原条码</param>
  3507. /// <param name="newBarcode">新条码</param>
  3508. /// <param name="remarks">备注</param>
  3509. /// <returns>操作结果</returns>
  3510. public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  3511. {
  3512. ActionResult actionResult = new ActionResult();
  3513. try
  3514. {
  3515. // 验证请求头信息
  3516. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3517. // 验证失败
  3518. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3519. {
  3520. return actionResult;
  3521. }
  3522. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3523. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3524. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3525. {
  3526. actionResult.Result = 1;
  3527. actionResult.Status = (int)Constant.PDAResult.Success;
  3528. }
  3529. else
  3530. {
  3531. actionResult.Status = (int)Constant.PDAResult.Fail;
  3532. actionResult.Message = serviceResultEntity.Message;
  3533. }
  3534. }
  3535. catch (Exception ex)
  3536. {
  3537. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3538. OutputLog.TraceLog(LogPriority.Error,
  3539. this.ToString(),
  3540. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3541. ex.ToString(),
  3542. LocalPath.LogExePath);
  3543. actionResult.Status = (int)Constant.PDAResult.Exception;
  3544. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3545. }
  3546. return actionResult;
  3547. }
  3548. /// <summary>
  3549. /// 获取(注浆登记)的查询数据
  3550. /// </summary>
  3551. /// <param name="accountCode"></param>
  3552. /// <param name="userCode"></param>
  3553. /// <param name="userPassword"></param>
  3554. /// <param name="sessionKey"></param>
  3555. /// <param name="se">查询条件</param>
  3556. /// <returns>Dataset</returns>
  3557. public ActionResult GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  3558. {
  3559. ActionResult actionResult = new ActionResult();
  3560. try
  3561. {
  3562. // 验证请求头信息
  3563. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3564. // 验证失败
  3565. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3566. {
  3567. return actionResult;
  3568. }
  3569. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3570. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3571. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3572. {
  3573. // PDA不显示的列删除掉
  3574. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3575. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3576. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3577. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3578. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3579. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3580. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3581. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3582. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3583. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3584. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3585. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3586. actionResult.Status = (int)Constant.PDAResult.Success;
  3587. }
  3588. else
  3589. {
  3590. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3591. actionResult.Message = "无查询数据";
  3592. }
  3593. }
  3594. catch (Exception ex)
  3595. {
  3596. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3597. OutputLog.TraceLog(LogPriority.Error,
  3598. this.ToString(),
  3599. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3600. ex.ToString(),
  3601. LocalPath.LogExePath);
  3602. actionResult.Status = (int)Constant.PDAResult.Exception;
  3603. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3604. }
  3605. return actionResult;
  3606. }
  3607. /// <summary>
  3608. /// 获取(注浆登记)的查询数据
  3609. /// </summary>
  3610. /// <param name="accountCode"></param>
  3611. /// <param name="userCode"></param>
  3612. /// <param name="userPassword"></param>
  3613. /// <param name="sessionKey"></param>
  3614. /// <param name="se">查询条件</param>
  3615. /// <returns>Dataset</returns>
  3616. public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3617. {
  3618. ActionResult actionResult = new ActionResult();
  3619. try
  3620. {
  3621. // 验证请求头信息
  3622. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3623. // 验证失败
  3624. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3625. {
  3626. return actionResult;
  3627. }
  3628. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3629. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3630. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3631. {
  3632. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3633. actionResult.Status = (int)Constant.PDAResult.Success;
  3634. }
  3635. else
  3636. {
  3637. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3638. actionResult.Message = "无查询数据";
  3639. }
  3640. }
  3641. catch (Exception ex)
  3642. {
  3643. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3644. OutputLog.TraceLog(LogPriority.Error,
  3645. this.ToString(),
  3646. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3647. ex.ToString(),
  3648. LocalPath.LogExePath);
  3649. actionResult.Status = (int)Constant.PDAResult.Exception;
  3650. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3651. }
  3652. return actionResult;
  3653. }
  3654. /// <summary>
  3655. ///获得成型线信息
  3656. /// </summary>
  3657. /// <param name="accountCode"></param>
  3658. /// <param name="userCode"></param>
  3659. /// <param name="userPassword"></param>
  3660. /// <param name="sessionKey"></param>
  3661. /// <param name="se">查询条件</param>
  3662. /// <returns>Dataset</returns>
  3663. public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3664. {
  3665. ActionResult actionResult = new ActionResult();
  3666. try
  3667. {
  3668. // 验证请求头信息
  3669. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3670. // 验证失败
  3671. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3672. {
  3673. return actionResult;
  3674. }
  3675. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3676. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3677. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3678. {
  3679. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3680. actionResult.Status = (int)Constant.PDAResult.Success;
  3681. }
  3682. else
  3683. {
  3684. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3685. actionResult.Message = "无查询数据";
  3686. }
  3687. }
  3688. catch (Exception ex)
  3689. {
  3690. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3691. OutputLog.TraceLog(LogPriority.Error,
  3692. this.ToString(),
  3693. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3694. ex.ToString(),
  3695. LocalPath.LogExePath);
  3696. actionResult.Status = (int)Constant.PDAResult.Exception;
  3697. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3698. }
  3699. return actionResult;
  3700. }
  3701. /// <summary>
  3702. ///获取在产产品的信息标识列表
  3703. /// </summary>
  3704. /// <param name="accountCode"></param>
  3705. /// <param name="userCode"></param>
  3706. /// <param name="userPassword"></param>
  3707. /// <param name="sessionKey"></param>
  3708. /// <param name="barcode">查询条件</param>
  3709. /// <returns>Dataset</returns>
  3710. public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3711. {
  3712. ActionResult actionResult = new ActionResult();
  3713. try
  3714. {
  3715. // 验证请求头信息
  3716. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3717. // 验证失败
  3718. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3719. {
  3720. return actionResult;
  3721. }
  3722. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3723. () => PMModuleLogic.GetInProductionDataList(barcode));
  3724. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3725. {
  3726. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3727. actionResult.Status = (int)Constant.PDAResult.Success;
  3728. }
  3729. else
  3730. {
  3731. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3732. actionResult.Message = "无查询数据";
  3733. }
  3734. }
  3735. catch (Exception ex)
  3736. {
  3737. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3738. OutputLog.TraceLog(LogPriority.Error,
  3739. this.ToString(),
  3740. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3741. ex.ToString(),
  3742. LocalPath.LogExePath);
  3743. actionResult.Status = (int)Constant.PDAResult.Exception;
  3744. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3745. }
  3746. return actionResult;
  3747. }
  3748. /// <summary>
  3749. ///获取条码是否注浆登记过,0行无效
  3750. /// </summary>
  3751. /// <param name="accountCode"></param>
  3752. /// <param name="userCode"></param>
  3753. /// <param name="userPassword"></param>
  3754. /// <param name="sessionKey"></param>
  3755. /// <param name="barcode">查询条件</param>
  3756. /// <returns>Dataset</returns>
  3757. public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3758. {
  3759. ActionResult actionResult = new ActionResult();
  3760. try
  3761. {
  3762. // 验证请求头信息
  3763. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3764. // 验证失败
  3765. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3766. {
  3767. return actionResult;
  3768. }
  3769. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3770. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  3771. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3772. {
  3773. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3774. actionResult.Status = (int)Constant.PDAResult.Success;
  3775. }
  3776. else
  3777. {
  3778. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3779. actionResult.Message = "该产品条码无效,无法报损!";
  3780. }
  3781. }
  3782. catch (Exception ex)
  3783. {
  3784. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3785. OutputLog.TraceLog(LogPriority.Error,
  3786. this.ToString(),
  3787. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3788. ex.ToString(),
  3789. LocalPath.LogExePath);
  3790. actionResult.Status = (int)Constant.PDAResult.Exception;
  3791. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3792. }
  3793. return actionResult;
  3794. }
  3795. /// <summary>
  3796. /// 获取登陆帐户有变更条码权限
  3797. /// </summary>
  3798. /// <param name="accountCode"></param>
  3799. /// <param name="userCode"></param>
  3800. /// <param name="userPassword"></param>
  3801. /// <param name="sessionKey"></param>
  3802. /// <returns></returns>
  3803. public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3804. {
  3805. ActionResult actionResult = new ActionResult();
  3806. try
  3807. {
  3808. // 验证请求头信息
  3809. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3810. // 验证失败
  3811. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3812. {
  3813. return actionResult;
  3814. }
  3815. int returnValue = ServiceInvoker.Invoke<int>(this,
  3816. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  3817. actionResult.Result = JsonHelper.ToJson(returnValue);
  3818. actionResult.Status = (int)Constant.PDAResult.Success;
  3819. }
  3820. catch (Exception ex)
  3821. {
  3822. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3823. OutputLog.TraceLog(LogPriority.Error,
  3824. this.ToString(),
  3825. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3826. ex.ToString(),
  3827. LocalPath.LogExePath);
  3828. actionResult.Status = (int)Constant.PDAResult.Exception;
  3829. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3830. }
  3831. return actionResult;
  3832. }
  3833. /// <summary>
  3834. /// 成检时获取此条码是否报损
  3835. /// </summary>
  3836. /// <param name="accountCode"></param>
  3837. /// <param name="userCode"></param>
  3838. /// <param name="userPassword"></param>
  3839. /// <param name="sessionKey"></param>
  3840. /// <param name="barcode">产品条码</param>
  3841. /// <returns></returns>
  3842. public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3843. {
  3844. ActionResult actionResult = new ActionResult();
  3845. try
  3846. {
  3847. // 验证请求头信息
  3848. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3849. // 验证失败
  3850. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3851. {
  3852. return actionResult;
  3853. }
  3854. int returnValue = ServiceInvoker.Invoke<int>(this,
  3855. () => PMModuleLogic.CheckScrapProduct(barcode));
  3856. if (returnValue == -100)
  3857. {
  3858. actionResult.Result = JsonHelper.ToJson(returnValue);
  3859. actionResult.Status = (int)Constant.PDAResult.Success;
  3860. }
  3861. else
  3862. {
  3863. actionResult.Status = (int)Constant.PDAResult.Fail;
  3864. if (returnValue == 0)
  3865. {
  3866. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  3867. }
  3868. else
  3869. {
  3870. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  3871. }
  3872. }
  3873. }
  3874. catch (Exception ex)
  3875. {
  3876. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3877. OutputLog.TraceLog(LogPriority.Error,
  3878. this.ToString(),
  3879. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3880. ex.ToString(),
  3881. LocalPath.LogExePath);
  3882. actionResult.Status = (int)Constant.PDAResult.Exception;
  3883. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3884. }
  3885. return actionResult;
  3886. }
  3887. /// <summary>
  3888. /// 获取产品完成工序的ID(PDA)
  3889. /// </summary>
  3890. /// <param name="barcode">产品条码</param>
  3891. /// <returns>int</returns>
  3892. public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3893. {
  3894. ActionResult actionResult = new ActionResult();
  3895. try
  3896. {
  3897. // 验证请求头信息
  3898. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3899. // 验证失败
  3900. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3901. {
  3902. return actionResult;
  3903. }
  3904. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3905. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  3906. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3907. actionResult.Status = (int)Constant.PDAResult.Success;
  3908. }
  3909. catch (Exception ex)
  3910. {
  3911. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3912. OutputLog.TraceLog(LogPriority.Error,
  3913. this.ToString(),
  3914. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3915. ex.ToString(),
  3916. LocalPath.LogExePath);
  3917. actionResult.Status = (int)Constant.PDAResult.Exception;
  3918. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3919. }
  3920. return actionResult;
  3921. }
  3922. /// <summary>
  3923. /// 获取产品完成工序的ID(PDA)
  3924. /// </summary>
  3925. /// <param name="barcode">产品条码</param>
  3926. /// <returns>int</returns>
  3927. public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3928. {
  3929. ActionResult actionResult = new ActionResult();
  3930. try
  3931. {
  3932. // 验证请求头信息
  3933. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3934. // 验证失败
  3935. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3936. {
  3937. return actionResult;
  3938. }
  3939. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3940. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  3941. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3942. actionResult.Status = (int)Constant.PDAResult.Success;
  3943. }
  3944. catch (Exception ex)
  3945. {
  3946. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3947. OutputLog.TraceLog(LogPriority.Error,
  3948. this.ToString(),
  3949. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3950. ex.ToString(),
  3951. LocalPath.LogExePath);
  3952. actionResult.Status = (int)Constant.PDAResult.Exception;
  3953. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3954. }
  3955. return actionResult;
  3956. }
  3957. /// <summary>
  3958. /// 成检-校验生产工号
  3959. /// </summary>
  3960. /// <param name="usercode">生产工号</param>
  3961. /// <returns>int</returns>
  3962. public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode)
  3963. {
  3964. ActionResult actionResult = new ActionResult();
  3965. try
  3966. {
  3967. // 验证请求头信息
  3968. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3969. // 验证失败
  3970. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3971. {
  3972. return actionResult;
  3973. }
  3974. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3975. () => PDAModuleLogic.GetUserCode(usercode, sUserInfo));
  3976. actionResult.Result = JsonHelper.ToJson(ds);
  3977. actionResult.Status = (int)Constant.PDAResult.Success;
  3978. }
  3979. catch (Exception ex)
  3980. {
  3981. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3982. OutputLog.TraceLog(LogPriority.Error,
  3983. this.ToString(),
  3984. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3985. ex.ToString(),
  3986. LocalPath.LogExePath);
  3987. actionResult.Status = (int)Constant.PDAResult.Exception;
  3988. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3989. }
  3990. return actionResult;
  3991. }
  3992. /// <summary>
  3993. /// 更新漏扫的成型工号
  3994. /// </summary>
  3995. /// <param name="accountCode"></param>
  3996. /// <param name="userCode"></param>
  3997. /// <param name="userPassword"></param>
  3998. /// <param name="sessionKey"></param>
  3999. /// <param name="groutingUserCode">成型工号</param>
  4000. /// <param name="missingID">漏扫ID</param>
  4001. /// <returns></returns>
  4002. public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  4003. {
  4004. ActionResult actionResult = new ActionResult();
  4005. try
  4006. {
  4007. // 验证请求头信息
  4008. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4009. // 验证失败
  4010. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4011. {
  4012. return actionResult;
  4013. }
  4014. int returnValue = ServiceInvoker.Invoke<int>(this,
  4015. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  4016. if (returnValue != -1)
  4017. {
  4018. actionResult.Result = JsonHelper.ToJson(returnValue);
  4019. actionResult.Status = (int)Constant.PDAResult.Success;
  4020. }
  4021. else
  4022. {
  4023. actionResult.Status = (int)Constant.PDAResult.Fail;
  4024. actionResult.Message = "存在无效的漏扫工号";
  4025. }
  4026. }
  4027. catch (Exception ex)
  4028. {
  4029. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4030. OutputLog.TraceLog(LogPriority.Error,
  4031. this.ToString(),
  4032. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4033. ex.ToString(),
  4034. LocalPath.LogExePath);
  4035. actionResult.Status = (int)Constant.PDAResult.Exception;
  4036. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4037. }
  4038. return actionResult;
  4039. }
  4040. /// <summary>
  4041. /// 在入窑工序检验窑车号是否存在
  4042. /// </summary>
  4043. /// <param name="accountCode"></param>
  4044. /// <param name="userCode"></param>
  4045. /// <param name="userPassword"></param>
  4046. /// <param name="sessionKey"></param>
  4047. /// <param name="kilncarcode">窑车编码</param>
  4048. /// <param name="procedureid">工序ID</param>
  4049. /// <returns></returns>
  4050. public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4051. {
  4052. ActionResult actionResult = new ActionResult();
  4053. try
  4054. {
  4055. // 验证请求头信息
  4056. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4057. // 验证失败
  4058. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4059. {
  4060. return actionResult;
  4061. }
  4062. int returnValue = ServiceInvoker.Invoke<int>(this,
  4063. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  4064. if (returnValue == 1)
  4065. {
  4066. actionResult.Result = JsonHelper.ToJson(returnValue);
  4067. actionResult.Status = (int)Constant.PDAResult.Success;
  4068. }
  4069. else
  4070. {
  4071. actionResult.Status = (int)Constant.PDAResult.Fail;
  4072. if (returnValue == -99)
  4073. actionResult.Message = "窑炉车号无效";
  4074. else if (returnValue == -98)
  4075. actionResult.Message = "窑车己无产品";
  4076. else if (returnValue == -97)
  4077. actionResult.Message = "窑车没有入窑,不可以撤销";
  4078. else if (returnValue == -1)
  4079. actionResult.Message = "保存失败";
  4080. }
  4081. }
  4082. catch (Exception ex)
  4083. {
  4084. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4085. OutputLog.TraceLog(LogPriority.Error,
  4086. this.ToString(),
  4087. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4088. ex.ToString(),
  4089. LocalPath.LogExePath);
  4090. actionResult.Status = (int)Constant.PDAResult.Exception;
  4091. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4092. }
  4093. return actionResult;
  4094. }
  4095. /// <summary>
  4096. /// 获取盘点单列表
  4097. /// </summary>
  4098. /// <param name="sUserInfo"></param>
  4099. /// <returns></returns>
  4100. public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey)
  4101. {
  4102. ActionResult actionResult = new ActionResult();
  4103. try
  4104. {
  4105. // 验证请求头信息
  4106. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4107. // 验证失败
  4108. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4109. {
  4110. return actionResult;
  4111. }
  4112. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4113. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  4114. actionResult.Result = JsonHelper.ToJson(ds);
  4115. actionResult.Status = (int)Constant.PDAResult.Success;
  4116. }
  4117. catch (Exception ex)
  4118. {
  4119. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4120. OutputLog.TraceLog(LogPriority.Error,
  4121. this.ToString(),
  4122. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4123. ex.ToString(),
  4124. LocalPath.LogExePath);
  4125. actionResult.Status = (int)Constant.PDAResult.Exception;
  4126. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4127. }
  4128. return actionResult;
  4129. }
  4130. /// <summary>
  4131. /// 进行盘点操作
  4132. /// </summary>
  4133. /// <param name="accountCode"></param>
  4134. /// <param name="userCode"></param>
  4135. /// <param name="userPassword"></param>
  4136. /// <param name="sessionKey"></param>
  4137. /// <param name="InCheckedID">盘点单ID</param>
  4138. /// <param name="BarCode">产品条码</param>
  4139. /// <returns></returns>
  4140. public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4141. {
  4142. ActionResult actionResult = new ActionResult();
  4143. try
  4144. {
  4145. // 验证请求头信息
  4146. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4147. // 验证失败
  4148. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4149. {
  4150. return actionResult;
  4151. }
  4152. int returnValue = ServiceInvoker.Invoke<int>(this,
  4153. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4154. if (returnValue > 0)
  4155. {
  4156. actionResult.Result = JsonHelper.ToJson(returnValue);
  4157. actionResult.Status = (int)Constant.PDAResult.Success;
  4158. actionResult.Message = "产品" + BarCode + "盘点成功";
  4159. }
  4160. else if (returnValue == 10)
  4161. {
  4162. actionResult.Result = JsonHelper.ToJson(returnValue);
  4163. actionResult.Status = (int)Constant.PDAResult.Success;
  4164. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4165. }
  4166. else
  4167. {
  4168. actionResult.Status = (int)Constant.PDAResult.Fail;
  4169. if (returnValue == -2)
  4170. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4171. //if (returnValue == 10)
  4172. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4173. //if (returnValue > 0)
  4174. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4175. if (returnValue == -22)
  4176. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4177. if (returnValue == -23)
  4178. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4179. if (returnValue == -24)
  4180. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4181. if (returnValue == -25)
  4182. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4183. else if (returnValue == 0)
  4184. actionResult.Message = "盘点失败";
  4185. }
  4186. }
  4187. catch (Exception ex)
  4188. {
  4189. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4190. OutputLog.TraceLog(LogPriority.Error,
  4191. this.ToString(),
  4192. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4193. ex.ToString(),
  4194. LocalPath.LogExePath);
  4195. actionResult.Status = (int)Constant.PDAResult.Exception;
  4196. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4197. }
  4198. return actionResult;
  4199. }
  4200. #region 班次配置
  4201. /// <summary>
  4202. /// 班次配置-通过工号获取工种列表
  4203. /// </summary>
  4204. /// <param name="userId">工号ID</param>
  4205. /// <returns></returns>
  4206. public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4207. {
  4208. ActionResult actionResult = new ActionResult();
  4209. try
  4210. {
  4211. // 验证请求头信息
  4212. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4213. // 验证失败
  4214. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4215. {
  4216. return actionResult;
  4217. }
  4218. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4219. () => SystemModuleLogic.GetJobByUserId(userId));
  4220. actionResult.Result = JsonHelper.ToJson(ds);
  4221. actionResult.Status = (int)Constant.PDAResult.Success;
  4222. }
  4223. catch (Exception ex)
  4224. {
  4225. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4226. OutputLog.TraceLog(LogPriority.Error,
  4227. this.ToString(),
  4228. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4229. ex.ToString(),
  4230. LocalPath.LogExePath);
  4231. actionResult.Status = (int)Constant.PDAResult.Exception;
  4232. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4233. }
  4234. return actionResult;
  4235. }
  4236. ///// <summary>
  4237. ///// 班次配置-根据工号查询员工档案信息
  4238. ///// </summary>
  4239. ///// <param name="userId">工号ID</param>
  4240. ///// <returns></returns>
  4241. //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4242. //{
  4243. // ActionResult actionResult = new ActionResult();
  4244. // try
  4245. // {
  4246. // // 验证请求头信息
  4247. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4248. // // 验证失败
  4249. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4250. // {
  4251. // return actionResult;
  4252. // }
  4253. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4254. // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
  4255. // actionResult.Result = JsonHelper.ToJson(ds);
  4256. // actionResult.Status = (int)Constant.PDAResult.Success;
  4257. // }
  4258. // catch (Exception ex)
  4259. // {
  4260. // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4261. // OutputLog.TraceLog(LogPriority.Error,
  4262. // this.ToString(),
  4263. // System.Reflection.MethodBase.GetCurrentMethod().Name,
  4264. // ex.ToString(),
  4265. // LocalPath.LogExePath);
  4266. // actionResult.Status = (int)Constant.PDAResult.Exception;
  4267. // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4268. // }
  4269. // return actionResult;
  4270. //}
  4271. /// <summary>
  4272. /// 班次配置-根据员工姓名查员工信息
  4273. /// </summary>
  4274. /// <param name="searchStaffEntity"></param>
  4275. /// <returns></returns>
  4276. public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4277. {
  4278. ActionResult actionResult = new ActionResult();
  4279. try
  4280. {
  4281. // 验证请求头信息
  4282. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4283. // 验证失败
  4284. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4285. {
  4286. return actionResult;
  4287. }
  4288. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4289. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4290. actionResult.Result = JsonHelper.ToJson(ds);
  4291. actionResult.Status = (int)Constant.PDAResult.Success;
  4292. }
  4293. catch (Exception ex)
  4294. {
  4295. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4296. OutputLog.TraceLog(LogPriority.Error,
  4297. this.ToString(),
  4298. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4299. ex.ToString(),
  4300. LocalPath.LogExePath);
  4301. actionResult.Status = (int)Constant.PDAResult.Exception;
  4302. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4303. }
  4304. return actionResult;
  4305. }
  4306. /// <summary>
  4307. /// 获取班次配置信息
  4308. /// </summary>
  4309. /// <param name="searchEntity"></param>
  4310. /// <returns></returns>
  4311. public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  4312. {
  4313. ActionResult actionResult = new ActionResult();
  4314. try
  4315. {
  4316. // 验证请求头信息
  4317. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4318. // 验证失败
  4319. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4320. {
  4321. return actionResult;
  4322. }
  4323. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4324. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4325. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4326. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4327. actionResult.Result = JsonHelper.ToJson(ds);
  4328. actionResult.Status = (int)Constant.PDAResult.Success;
  4329. }
  4330. catch (Exception ex)
  4331. {
  4332. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4333. OutputLog.TraceLog(LogPriority.Error,
  4334. this.ToString(),
  4335. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4336. ex.ToString(),
  4337. LocalPath.LogExePath);
  4338. actionResult.Status = (int)Constant.PDAResult.Exception;
  4339. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4340. }
  4341. return actionResult;
  4342. }
  4343. public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4344. {
  4345. ActionResult actionResult = new ActionResult();
  4346. try
  4347. {
  4348. // 验证请求头信息
  4349. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4350. // 验证失败
  4351. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4352. {
  4353. return actionResult;
  4354. }
  4355. int returnValue = ServiceInvoker.Invoke<int>(this,
  4356. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4357. if (returnValue > 0)
  4358. {
  4359. actionResult.Result = JsonHelper.ToJson(returnValue);
  4360. actionResult.Status = (int)Constant.PDAResult.Success;
  4361. }
  4362. else
  4363. {
  4364. actionResult.Status = (int)Constant.PDAResult.Fail;
  4365. actionResult.Message = "保存失败";
  4366. }
  4367. }
  4368. catch (Exception ex)
  4369. {
  4370. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4371. OutputLog.TraceLog(LogPriority.Error,
  4372. this.ToString(),
  4373. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4374. ex.ToString(),
  4375. LocalPath.LogExePath);
  4376. actionResult.Status = (int)Constant.PDAResult.Exception;
  4377. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4378. }
  4379. return actionResult;
  4380. }
  4381. /// <summary>
  4382. /// 班次配置--获取详细信息
  4383. /// </summary>
  4384. /// <param name="searchEntity"></param>
  4385. /// <returns></returns>
  4386. public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4387. {
  4388. ActionResult actionResult = new ActionResult();
  4389. try
  4390. {
  4391. // 验证请求头信息
  4392. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4393. // 验证失败
  4394. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4395. {
  4396. return actionResult;
  4397. }
  4398. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4399. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4400. actionResult.Result = JsonHelper.ToJson(ds);
  4401. actionResult.Status = (int)Constant.PDAResult.Success;
  4402. }
  4403. catch (Exception ex)
  4404. {
  4405. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4406. OutputLog.TraceLog(LogPriority.Error,
  4407. this.ToString(),
  4408. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4409. ex.ToString(),
  4410. LocalPath.LogExePath);
  4411. actionResult.Status = (int)Constant.PDAResult.Exception;
  4412. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4413. }
  4414. return actionResult;
  4415. }
  4416. /// <summary>
  4417. /// 获取用户是否有班次配置权限
  4418. /// </summary>
  4419. /// <param name="accountCode"></param>
  4420. /// <param name="userCode"></param>
  4421. /// <param name="userPassword"></param>
  4422. /// <param name="sessionKey"></param>
  4423. /// <returns></returns>
  4424. public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4425. {
  4426. ActionResult actionResult = new ActionResult();
  4427. try
  4428. {
  4429. // 验证请求头信息
  4430. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4431. // 验证失败
  4432. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4433. {
  4434. return actionResult;
  4435. }
  4436. int returnValue = ServiceInvoker.Invoke<int>(this,
  4437. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4438. actionResult.Result = JsonHelper.ToJson(returnValue);
  4439. actionResult.Status = (int)Constant.PDAResult.Success;
  4440. }
  4441. catch (Exception ex)
  4442. {
  4443. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4444. OutputLog.TraceLog(LogPriority.Error,
  4445. this.ToString(),
  4446. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4447. ex.ToString(),
  4448. LocalPath.LogExePath);
  4449. actionResult.Status = (int)Constant.PDAResult.Exception;
  4450. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4451. }
  4452. return actionResult;
  4453. }
  4454. /// <summary>
  4455. /// 获取盘点单列表
  4456. /// </summary>
  4457. /// <param name="sUserInfo"></param>
  4458. /// <returns></returns>
  4459. public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  4460. {
  4461. ActionResult actionResult = new ActionResult();
  4462. try
  4463. {
  4464. // 验证请求头信息
  4465. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4466. // 验证失败
  4467. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4468. {
  4469. return actionResult;
  4470. }
  4471. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4472. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4473. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4474. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4475. actionResult.Result = JsonHelper.ToJson(ds);
  4476. actionResult.Status = (int)Constant.PDAResult.Success;
  4477. }
  4478. catch (Exception ex)
  4479. {
  4480. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4481. OutputLog.TraceLog(LogPriority.Error,
  4482. this.ToString(),
  4483. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4484. ex.ToString(),
  4485. LocalPath.LogExePath);
  4486. actionResult.Status = (int)Constant.PDAResult.Exception;
  4487. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4488. }
  4489. return actionResult;
  4490. }
  4491. #endregion
  4492. #region PDA报表
  4493. /// <summary>
  4494. /// 产品质量跟踪
  4495. /// </summary>
  4496. /// <param name="accountCode"></param>
  4497. /// <param name="userCode"></param>
  4498. /// <param name="userPassword"></param>
  4499. /// <param name="sessionKey"></param>
  4500. /// <param name="se"></param>
  4501. /// <returns></returns>
  4502. public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4503. {
  4504. ActionResult actionResult = new ActionResult();
  4505. try
  4506. {
  4507. // 验证请求头信息
  4508. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4509. // 验证失败
  4510. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4511. {
  4512. return actionResult;
  4513. }
  4514. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4515. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4516. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4517. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4518. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4519. {
  4520. actionResult.Status = (int)Constant.PDAResult.Fail;
  4521. actionResult.Message = Messages.MSG_CMN_I002;
  4522. }
  4523. else
  4524. {
  4525. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4526. actionResult.Status = (int)Constant.PDAResult.Success;
  4527. }
  4528. }
  4529. catch (Exception ex)
  4530. {
  4531. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4532. OutputLog.TraceLog(LogPriority.Error,
  4533. this.ToString(),
  4534. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4535. ex.ToString(),
  4536. LocalPath.LogExePath);
  4537. actionResult.Status = (int)Constant.PDAResult.Exception;
  4538. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4539. }
  4540. return actionResult;
  4541. }
  4542. /// <summary>
  4543. /// 工号产量质量分析表
  4544. /// </summary>
  4545. /// <param name="accountCode"></param>
  4546. /// <param name="userCode"></param>
  4547. /// <param name="userPassword"></param>
  4548. /// <param name="sessionKey"></param>
  4549. /// <param name="se"></param>
  4550. /// <returns></returns>
  4551. public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4552. int rptSProcedureID, string workcode, string date)
  4553. {
  4554. ActionResult actionResult = new ActionResult();
  4555. try
  4556. {
  4557. // 验证请求头信息
  4558. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4559. // 验证失败
  4560. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4561. {
  4562. return actionResult;
  4563. }
  4564. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4565. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4566. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4567. {
  4568. actionResult.Status = (int)Constant.PDAResult.Fail;
  4569. actionResult.Message = Messages.MSG_CMN_I002;
  4570. }
  4571. else
  4572. {
  4573. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4574. actionResult.Status = (int)Constant.PDAResult.Success;
  4575. }
  4576. }
  4577. catch (Exception ex)
  4578. {
  4579. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4580. OutputLog.TraceLog(LogPriority.Error,
  4581. this.ToString(),
  4582. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4583. ex.ToString(),
  4584. LocalPath.LogExePath);
  4585. actionResult.Status = (int)Constant.PDAResult.Exception;
  4586. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4587. }
  4588. return actionResult;
  4589. }
  4590. /// <summary>
  4591. /// 半检数据统计表
  4592. /// </summary>
  4593. /// <param name="accountCode"></param>
  4594. /// <param name="userCode"></param>
  4595. /// <param name="userPassword"></param>
  4596. /// <param name="sessionKey"></param>
  4597. /// <param name="se"></param>
  4598. /// <returns></returns>
  4599. public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4600. string workcode, string datebegin, string dateend)
  4601. {
  4602. ActionResult actionResult = new ActionResult();
  4603. try
  4604. {
  4605. // 验证请求头信息
  4606. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4607. // 验证失败
  4608. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4609. {
  4610. return actionResult;
  4611. }
  4612. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4613. DateTime datetimeend = Convert.ToDateTime(dateend);
  4614. datetimebegin = datetimebegin.Date;
  4615. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4616. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4617. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4618. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4619. {
  4620. actionResult.Status = (int)Constant.PDAResult.Fail;
  4621. actionResult.Message = Messages.MSG_CMN_I002;
  4622. }
  4623. else
  4624. {
  4625. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4626. actionResult.Status = (int)Constant.PDAResult.Success;
  4627. }
  4628. }
  4629. catch (Exception ex)
  4630. {
  4631. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4632. OutputLog.TraceLog(LogPriority.Error,
  4633. this.ToString(),
  4634. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4635. ex.ToString(),
  4636. LocalPath.LogExePath);
  4637. actionResult.Status = (int)Constant.PDAResult.Exception;
  4638. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4639. }
  4640. return actionResult;
  4641. }
  4642. /// <summary>
  4643. /// 工号质量统计表
  4644. /// </summary>
  4645. /// <param name="accountCode"></param>
  4646. /// <param name="userCode"></param>
  4647. /// <param name="userPassword"></param>
  4648. /// <param name="sessionKey"></param>
  4649. /// <param name="se"></param>
  4650. /// <returns></returns>
  4651. public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4652. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4653. {
  4654. ActionResult actionResult = new ActionResult();
  4655. try
  4656. {
  4657. // 验证请求头信息
  4658. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4659. // 验证失败
  4660. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4661. {
  4662. return actionResult;
  4663. }
  4664. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4665. DateTime datetimeend = Convert.ToDateTime(dateend);
  4666. datetimebegin = datetimebegin.Date;
  4667. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4668. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4669. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4670. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4671. {
  4672. actionResult.Status = (int)Constant.PDAResult.Fail;
  4673. actionResult.Message = Messages.MSG_CMN_I002;
  4674. }
  4675. else
  4676. {
  4677. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4678. actionResult.Status = (int)Constant.PDAResult.Success;
  4679. }
  4680. }
  4681. catch (Exception ex)
  4682. {
  4683. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4684. OutputLog.TraceLog(LogPriority.Error,
  4685. this.ToString(),
  4686. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4687. ex.ToString(),
  4688. LocalPath.LogExePath);
  4689. actionResult.Status = (int)Constant.PDAResult.Exception;
  4690. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4691. }
  4692. return actionResult;
  4693. }
  4694. /// <summary>
  4695. /// 损坯数据统计表
  4696. /// </summary>
  4697. /// <param name="accountCode"></param>
  4698. /// <param name="userCode"></param>
  4699. /// <param name="userPassword"></param>
  4700. /// <param name="sessionKey"></param>
  4701. /// <param name="se"></param>
  4702. /// <returns></returns>
  4703. public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4704. string workcode, string datebegin, string dateend)
  4705. {
  4706. ActionResult actionResult = new ActionResult();
  4707. try
  4708. {
  4709. // 验证请求头信息
  4710. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4711. // 验证失败
  4712. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4713. {
  4714. return actionResult;
  4715. }
  4716. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4717. DateTime datetimeend = Convert.ToDateTime(dateend);
  4718. datetimebegin = datetimebegin.Date;
  4719. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4720. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4721. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4722. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4723. {
  4724. actionResult.Status = (int)Constant.PDAResult.Fail;
  4725. actionResult.Message = Messages.MSG_CMN_I002;
  4726. }
  4727. else
  4728. {
  4729. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4730. actionResult.Status = (int)Constant.PDAResult.Success;
  4731. }
  4732. }
  4733. catch (Exception ex)
  4734. {
  4735. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4736. OutputLog.TraceLog(LogPriority.Error,
  4737. this.ToString(),
  4738. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4739. ex.ToString(),
  4740. LocalPath.LogExePath);
  4741. actionResult.Status = (int)Constant.PDAResult.Exception;
  4742. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4743. }
  4744. return actionResult;
  4745. }
  4746. #endregion
  4747. /// <summary>
  4748. /// 取得报表数据源数据
  4749. /// </summary>
  4750. /// <param name="accountCode"></param>
  4751. /// <param name="userCode"></param>
  4752. /// <param name="userPassword"></param>
  4753. /// <param name="sessionKey"></param>
  4754. /// <returns></returns>
  4755. public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
  4756. {
  4757. ActionResult actionResult = new ActionResult();
  4758. try
  4759. {
  4760. // 验证请求头信息
  4761. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4762. // 验证失败
  4763. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4764. {
  4765. return actionResult;
  4766. }
  4767. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4768. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4769. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4770. {
  4771. actionResult.Status = (int)Constant.PDAResult.Fail;
  4772. actionResult.Message = Messages.MSG_CMN_I002;
  4773. }
  4774. else
  4775. {
  4776. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4777. actionResult.Status = (int)Constant.PDAResult.Success;
  4778. }
  4779. }
  4780. catch (Exception ex)
  4781. {
  4782. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4783. OutputLog.TraceLog(LogPriority.Error,
  4784. this.ToString(),
  4785. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4786. ex.ToString(),
  4787. LocalPath.LogExePath);
  4788. actionResult.Status = (int)Constant.PDAResult.Exception;
  4789. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4790. }
  4791. return actionResult;
  4792. }
  4793. /// <summary>
  4794. /// 取得报表的查询数据源统计工序数据
  4795. /// </summary>
  4796. /// <param name="accountCode"></param>
  4797. /// <param name="userCode"></param>
  4798. /// <param name="userPassword"></param>
  4799. /// <param name="sessionKey"></param>
  4800. /// <param name="RptProcedureID"></param>
  4801. /// <returns></returns>
  4802. public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  4803. {
  4804. ActionResult actionResult = new ActionResult();
  4805. try
  4806. {
  4807. // 验证请求头信息
  4808. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4809. // 验证失败
  4810. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4811. {
  4812. return actionResult;
  4813. }
  4814. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4815. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  4816. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4817. {
  4818. actionResult.Status = (int)Constant.PDAResult.Fail;
  4819. actionResult.Message = Messages.MSG_CMN_I002;
  4820. }
  4821. else
  4822. {
  4823. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4824. actionResult.Status = (int)Constant.PDAResult.Success;
  4825. }
  4826. }
  4827. catch (Exception ex)
  4828. {
  4829. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4830. OutputLog.TraceLog(LogPriority.Error,
  4831. this.ToString(),
  4832. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4833. ex.ToString(),
  4834. LocalPath.LogExePath);
  4835. actionResult.Status = (int)Constant.PDAResult.Exception;
  4836. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4837. }
  4838. return actionResult;
  4839. }
  4840. /// <summary>
  4841. /// 获取用户是否有统计产成品权限
  4842. /// </summary>
  4843. /// <param name="accountCode"></param>
  4844. /// <param name="userCode"></param>
  4845. /// <param name="userPassword"></param>
  4846. /// <param name="sessionKey"></param>
  4847. /// <returns></returns>
  4848. public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4849. {
  4850. ActionResult actionResult = new ActionResult();
  4851. try
  4852. {
  4853. // 验证请求头信息
  4854. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4855. // 验证失败
  4856. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4857. {
  4858. return actionResult;
  4859. }
  4860. int returnValue = ServiceInvoker.Invoke<int>(this,
  4861. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  4862. actionResult.Result = JsonHelper.ToJson(returnValue);
  4863. actionResult.Status = (int)Constant.PDAResult.Success;
  4864. }
  4865. catch (Exception ex)
  4866. {
  4867. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4868. OutputLog.TraceLog(LogPriority.Error,
  4869. this.ToString(),
  4870. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4871. ex.ToString(),
  4872. LocalPath.LogExePath);
  4873. actionResult.Status = (int)Constant.PDAResult.Exception;
  4874. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4875. }
  4876. return actionResult;
  4877. }
  4878. /// <summary>
  4879. /// 获取用户是否有盘点权限
  4880. /// </summary>
  4881. /// <param name="accountCode"></param>
  4882. /// <param name="userCode"></param>
  4883. /// <param name="userPassword"></param>
  4884. /// <param name="sessionKey"></param>
  4885. /// <returns></returns>
  4886. public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4887. {
  4888. ActionResult actionResult = new ActionResult();
  4889. try
  4890. {
  4891. // 验证请求头信息
  4892. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4893. // 验证失败
  4894. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4895. {
  4896. return actionResult;
  4897. }
  4898. int returnValue = ServiceInvoker.Invoke<int>(this,
  4899. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  4900. actionResult.Result = JsonHelper.ToJson(returnValue);
  4901. actionResult.Status = (int)Constant.PDAResult.Success;
  4902. }
  4903. catch (Exception ex)
  4904. {
  4905. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4906. OutputLog.TraceLog(LogPriority.Error,
  4907. this.ToString(),
  4908. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4909. ex.ToString(),
  4910. LocalPath.LogExePath);
  4911. actionResult.Status = (int)Constant.PDAResult.Exception;
  4912. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4913. }
  4914. return actionResult;
  4915. }
  4916. /// <summary>
  4917. /// 根据条件查询是否存在班次配置
  4918. /// </summary>
  4919. /// <param name="accountCode"></param>
  4920. /// <param name="userCode"></param>
  4921. /// <param name="userPassword"></param>
  4922. /// <param name="sessionKey"></param>
  4923. /// <param name="userCode">工号编码</param>
  4924. /// <returns></returns>
  4925. public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  4926. {
  4927. ActionResult actionResult = new ActionResult();
  4928. try
  4929. {
  4930. // 验证请求头信息
  4931. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4932. // 验证失败
  4933. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4934. {
  4935. return actionResult;
  4936. }
  4937. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4938. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  4939. actionResult.Result = JsonHelper.ToJson(ds);
  4940. actionResult.Status = (int)Constant.PDAResult.Success;
  4941. }
  4942. catch (Exception ex)
  4943. {
  4944. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4945. OutputLog.TraceLog(LogPriority.Error,
  4946. this.ToString(),
  4947. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4948. ex.ToString(),
  4949. LocalPath.LogExePath);
  4950. actionResult.Status = (int)Constant.PDAResult.Exception;
  4951. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4952. }
  4953. return actionResult;
  4954. }
  4955. /// <summary>
  4956. /// 报损工序查出工号根据生产数据ID
  4957. /// </summary>
  4958. /// <param name="accountCode"></param>
  4959. /// <param name="userCode"></param>
  4960. /// <param name="userPassword"></param>
  4961. /// <param name="sessionKey"></param>
  4962. /// <param name="ProductionDataID">生产数据ID</param>
  4963. /// <returns></returns>
  4964. public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  4965. {
  4966. ActionResult actionResult = new ActionResult();
  4967. try
  4968. {
  4969. // 验证请求头信息
  4970. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4971. // 验证失败
  4972. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4973. {
  4974. return actionResult;
  4975. }
  4976. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  4977. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  4978. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  4979. {
  4980. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  4981. actionResult.Status = (int)Constant.PDAResult.Success;
  4982. }
  4983. else
  4984. {
  4985. actionResult.Status = (int)Constant.PDAResult.Fail;
  4986. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  4987. }
  4988. }
  4989. catch (Exception ex)
  4990. {
  4991. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4992. OutputLog.TraceLog(LogPriority.Error,
  4993. this.ToString(),
  4994. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4995. ex.ToString(),
  4996. LocalPath.LogExePath);
  4997. actionResult.Status = (int)Constant.PDAResult.Exception;
  4998. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4999. }
  5000. return actionResult;
  5001. }
  5002. /// <summary>
  5003. /// 在入窑工序检验窑车号是否存在
  5004. /// </summary>
  5005. /// <param name="accountCode"></param>
  5006. /// <param name="userCode"></param>
  5007. /// <param name="userPassword"></param>
  5008. /// <param name="sessionKey"></param>
  5009. /// <param name="kilncarcode">窑车编码</param>
  5010. /// <param name="procedureid">工序ID</param>
  5011. /// <returns></returns>
  5012. public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  5013. {
  5014. ActionResult actionResult = new ActionResult();
  5015. try
  5016. {
  5017. // 验证请求头信息
  5018. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5019. // 验证失败
  5020. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5021. {
  5022. return actionResult;
  5023. }
  5024. int returnValue = ServiceInvoker.Invoke<int>(this,
  5025. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  5026. if (returnValue == 1)
  5027. {
  5028. actionResult.Result = JsonHelper.ToJson(returnValue);
  5029. actionResult.Status = (int)Constant.PDAResult.Success;
  5030. }
  5031. else
  5032. {
  5033. actionResult.Status = (int)Constant.PDAResult.Fail;
  5034. if (returnValue == -99)
  5035. actionResult.Message = "窑炉车号无效";
  5036. else if (returnValue == -98)
  5037. actionResult.Message = "窑车己无产品";
  5038. else if (returnValue == -97)
  5039. actionResult.Message = "窑车没有入窑,不可以撤销";
  5040. else if (returnValue == -1)
  5041. actionResult.Message = "保存失败";
  5042. }
  5043. }
  5044. catch (Exception ex)
  5045. {
  5046. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5047. OutputLog.TraceLog(LogPriority.Error,
  5048. this.ToString(),
  5049. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5050. ex.ToString(),
  5051. LocalPath.LogExePath);
  5052. actionResult.Status = (int)Constant.PDAResult.Exception;
  5053. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5054. }
  5055. return actionResult;
  5056. }
  5057. /// <summary>
  5058. /// 撤销包装
  5059. /// </summary>
  5060. /// <param name="accountCode"></param>
  5061. /// <param name="userCode"></param>
  5062. /// <param name="userPassword"></param>
  5063. /// <param name="sessionKey"></param>
  5064. /// <param name="barcode"></param>
  5065. /// <returns></returns>
  5066. public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5067. {
  5068. ActionResult actionResult = new ActionResult();
  5069. try
  5070. {
  5071. // 验证请求头信息
  5072. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5073. // 验证失败
  5074. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5075. {
  5076. return actionResult;
  5077. }
  5078. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5079. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  5080. if (Convert.ToInt32(returnValue.Result) > 0)
  5081. {
  5082. actionResult.Result = JsonHelper.ToJson(returnValue);
  5083. actionResult.Status = (int)Constant.PDAResult.Success;
  5084. }
  5085. else
  5086. {
  5087. actionResult.Status = (int)Constant.PDAResult.Fail;
  5088. if (Convert.ToInt32(returnValue.Result) == -1)
  5089. actionResult.Message = "产品条码不存在包装记录";
  5090. else if (Convert.ToInt32(returnValue.Result) == -200)
  5091. actionResult.Message = returnValue.Message;
  5092. else
  5093. actionResult.Message = "成品撤销失败";
  5094. }
  5095. }
  5096. catch (Exception ex)
  5097. {
  5098. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5099. OutputLog.TraceLog(LogPriority.Error,
  5100. this.ToString(),
  5101. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5102. ex.ToString(),
  5103. LocalPath.LogExePath);
  5104. actionResult.Status = (int)Constant.PDAResult.Exception;
  5105. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5106. }
  5107. return actionResult;
  5108. }
  5109. /*
  5110. /// <summary>
  5111. /// 获取用户是否有撤销包装权限
  5112. /// </summary>
  5113. /// <param name="accountCode"></param>
  5114. /// <param name="userCode"></param>
  5115. /// <param name="userPassword"></param>
  5116. /// <param name="sessionKey"></param>
  5117. /// <returns></returns>
  5118. public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5119. {
  5120. ActionResult actionResult = new ActionResult();
  5121. try
  5122. {
  5123. // 验证请求头信息
  5124. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5125. // 验证失败
  5126. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5127. {
  5128. return actionResult;
  5129. }
  5130. int returnValue = ServiceInvoker.Invoke<int>(this,
  5131. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5132. actionResult.Result = JsonHelper.ToJson(returnValue);
  5133. actionResult.Status = (int)Constant.PDAResult.Success;
  5134. }
  5135. catch (Exception ex)
  5136. {
  5137. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5138. OutputLog.TraceLog(LogPriority.Error,
  5139. this.ToString(),
  5140. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5141. ex.ToString(),
  5142. LocalPath.LogExePath);
  5143. actionResult.Status = (int)Constant.PDAResult.Exception;
  5144. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5145. }
  5146. return actionResult;
  5147. }
  5148. */
  5149. /// <summary>
  5150. /// 窑车状态明细表查询
  5151. /// </summary>
  5152. /// <param name="accountCode"></param>
  5153. /// <param name="userCode"></param>
  5154. /// <param name="userPassword"></param>
  5155. /// <param name="sessionKey"></param>
  5156. /// <param name="kilnCarCode"></param>
  5157. /// <returns></returns>
  5158. public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5159. {
  5160. ActionResult actionResult = new ActionResult();
  5161. try
  5162. {
  5163. // 验证请求头信息
  5164. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5165. // 验证失败
  5166. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5167. {
  5168. return actionResult;
  5169. }
  5170. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5171. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5172. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5173. {
  5174. actionResult.Status = (int)Constant.PDAResult.Fail;
  5175. actionResult.Message = Messages.MSG_CMN_I002;
  5176. }
  5177. else
  5178. {
  5179. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5180. actionResult.Status = (int)Constant.PDAResult.Success;
  5181. }
  5182. }
  5183. catch (Exception ex)
  5184. {
  5185. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5186. OutputLog.TraceLog(LogPriority.Error,
  5187. this.ToString(),
  5188. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5189. ex.ToString(),
  5190. LocalPath.LogExePath);
  5191. actionResult.Status = (int)Constant.PDAResult.Exception;
  5192. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5193. }
  5194. return actionResult;
  5195. }
  5196. /// <summary>
  5197. /// 损坯撤销
  5198. /// </summary>
  5199. /// <param name="accountCode"></param>
  5200. /// <param name="userCode"></param>
  5201. /// <param name="userPassword"></param>
  5202. /// <param name="sessionKey"></param>
  5203. /// <param name="barcode"></param>
  5204. /// <returns></returns>
  5205. public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5206. {
  5207. ActionResult actionResult = new ActionResult();
  5208. try
  5209. {
  5210. // 验证请求头信息
  5211. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5212. // 验证失败
  5213. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5214. {
  5215. return actionResult;
  5216. }
  5217. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5218. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5219. if (Convert.ToInt32(returnValue.Result) > 0)
  5220. {
  5221. actionResult.Result = JsonHelper.ToJson(returnValue);
  5222. actionResult.Status = (int)Constant.PDAResult.Success;
  5223. }
  5224. else
  5225. {
  5226. actionResult.Status = (int)Constant.PDAResult.Fail;
  5227. if (Convert.ToInt32(returnValue.Result) == -1)
  5228. actionResult.Message = "此产品没有损坯,不能撤销";
  5229. else if (Convert.ToInt32(returnValue.Result) == -200)
  5230. actionResult.Message = returnValue.Message;
  5231. else
  5232. actionResult.Message = "损坯撤销失败";
  5233. }
  5234. }
  5235. catch (Exception ex)
  5236. {
  5237. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5238. OutputLog.TraceLog(LogPriority.Error,
  5239. this.ToString(),
  5240. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5241. ex.ToString(),
  5242. LocalPath.LogExePath);
  5243. actionResult.Status = (int)Constant.PDAResult.Exception;
  5244. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5245. }
  5246. return actionResult;
  5247. }
  5248. /*
  5249. /// <summary>
  5250. /// 获取用户是否有损坯撤销权限
  5251. /// </summary>
  5252. /// <param name="accountCode"></param>
  5253. /// <param name="userCode"></param>
  5254. /// <param name="userPassword"></param>
  5255. /// <param name="sessionKey"></param>
  5256. /// <returns></returns>
  5257. public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5258. {
  5259. ActionResult actionResult = new ActionResult();
  5260. try
  5261. {
  5262. // 验证请求头信息
  5263. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5264. // 验证失败
  5265. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5266. {
  5267. return actionResult;
  5268. }
  5269. int returnValue = ServiceInvoker.Invoke<int>(this,
  5270. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5271. actionResult.Result = JsonHelper.ToJson(returnValue);
  5272. actionResult.Status = (int)Constant.PDAResult.Success;
  5273. }
  5274. catch (Exception ex)
  5275. {
  5276. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5277. OutputLog.TraceLog(LogPriority.Error,
  5278. this.ToString(),
  5279. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5280. ex.ToString(),
  5281. LocalPath.LogExePath);
  5282. actionResult.Status = (int)Constant.PDAResult.Exception;
  5283. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5284. }
  5285. return actionResult;
  5286. }
  5287. */
  5288. /// <summary>
  5289. /// 获取条码注浆信息
  5290. /// </summary>
  5291. /// <param name="accountCode"></param>
  5292. /// <param name="userCode"></param>
  5293. /// <param name="userPassword"></param>
  5294. /// <param name="sessionKey"></param>
  5295. /// <returns></returns>
  5296. public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5297. {
  5298. ActionResult actionResult = new ActionResult();
  5299. try
  5300. {
  5301. // 验证请求头信息
  5302. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5303. // 验证失败
  5304. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5305. {
  5306. return actionResult;
  5307. }
  5308. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5309. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5310. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5311. {
  5312. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5313. actionResult.Status = (int)Constant.PDAResult.Success;
  5314. }
  5315. else
  5316. {
  5317. actionResult.Status = (int)Constant.PDAResult.Fail;
  5318. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5319. }
  5320. }
  5321. catch (Exception ex)
  5322. {
  5323. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5324. OutputLog.TraceLog(LogPriority.Error,
  5325. this.ToString(),
  5326. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5327. ex.ToString(),
  5328. LocalPath.LogExePath);
  5329. actionResult.Status = (int)Constant.PDAResult.Exception;
  5330. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5331. }
  5332. return actionResult;
  5333. }
  5334. /// <summary>
  5335. /// 获取条码注浆信息
  5336. /// </summary>
  5337. /// <param name="accountCode"></param>
  5338. /// <param name="userCode"></param>
  5339. /// <param name="userPassword"></param>
  5340. /// <param name="sessionKey"></param>
  5341. /// <returns></returns>
  5342. public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5343. {
  5344. ActionResult actionResult = new ActionResult();
  5345. try
  5346. {
  5347. // 验证请求头信息
  5348. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5349. // 验证失败
  5350. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5351. {
  5352. return actionResult;
  5353. }
  5354. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5355. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5356. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5357. {
  5358. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5359. actionResult.Status = (int)Constant.PDAResult.Success;
  5360. }
  5361. else
  5362. {
  5363. actionResult.Status = (int)Constant.PDAResult.Fail;
  5364. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5365. }
  5366. }
  5367. catch (Exception ex)
  5368. {
  5369. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5370. OutputLog.TraceLog(LogPriority.Error,
  5371. this.ToString(),
  5372. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5373. ex.ToString(),
  5374. LocalPath.LogExePath);
  5375. actionResult.Status = (int)Constant.PDAResult.Exception;
  5376. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5377. }
  5378. return actionResult;
  5379. }
  5380. /// <summary>
  5381. /// 公坯设定
  5382. /// </summary>
  5383. /// <param name="accountCode"></param>
  5384. /// <param name="userCode"></param>
  5385. /// <param name="userPassword"></param>
  5386. /// <param name="sessionKey"></param>
  5387. /// <param name="barcode"></param>
  5388. /// <returns></returns>
  5389. public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5390. {
  5391. ActionResult actionResult = new ActionResult();
  5392. try
  5393. {
  5394. // 验证请求头信息
  5395. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5396. // 验证失败
  5397. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5398. {
  5399. return actionResult;
  5400. }
  5401. int returnValue = ServiceInvoker.Invoke<int>(this,
  5402. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5403. if (returnValue > 0)
  5404. {
  5405. actionResult.Result = JsonHelper.ToJson(returnValue);
  5406. actionResult.Status = (int)Constant.PDAResult.Success;
  5407. }
  5408. else
  5409. {
  5410. actionResult.Status = (int)Constant.PDAResult.Fail;
  5411. if (returnValue == -1)
  5412. actionResult.Message = "此产品不在生产线上";
  5413. else if (returnValue == -2)
  5414. actionResult.Message = "该产品已经标识为公坯";
  5415. else
  5416. actionResult.Message = "公坯设定失败";
  5417. }
  5418. }
  5419. catch (Exception ex)
  5420. {
  5421. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5422. OutputLog.TraceLog(LogPriority.Error,
  5423. this.ToString(),
  5424. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5425. ex.ToString(),
  5426. LocalPath.LogExePath);
  5427. actionResult.Status = (int)Constant.PDAResult.Exception;
  5428. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5429. }
  5430. return actionResult;
  5431. }
  5432. /*
  5433. /// <summary>
  5434. /// 获取用户是否有公坯设定
  5435. /// </summary>
  5436. /// <param name="accountCode"></param>
  5437. /// <param name="userCode"></param>
  5438. /// <param name="userPassword"></param>
  5439. /// <param name="sessionKey"></param>
  5440. /// <returns></returns>
  5441. public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5442. {
  5443. ActionResult actionResult = new ActionResult();
  5444. try
  5445. {
  5446. // 验证请求头信息
  5447. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5448. // 验证失败
  5449. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5450. {
  5451. return actionResult;
  5452. }
  5453. int returnValue = ServiceInvoker.Invoke<int>(this,
  5454. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5455. actionResult.Result = JsonHelper.ToJson(returnValue);
  5456. actionResult.Status = (int)Constant.PDAResult.Success;
  5457. }
  5458. catch (Exception ex)
  5459. {
  5460. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5461. OutputLog.TraceLog(LogPriority.Error,
  5462. this.ToString(),
  5463. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5464. ex.ToString(),
  5465. LocalPath.LogExePath);
  5466. actionResult.Status = (int)Constant.PDAResult.Exception;
  5467. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5468. }
  5469. return actionResult;
  5470. }
  5471. */
  5472. /// <summary>
  5473. /// 校验产品条码是否可以走到该工序
  5474. /// </summary>
  5475. /// <param name="accountCode">帐套code</param>
  5476. /// <param name="userCode">用户code</param>
  5477. /// <param name="userPassword">用户密码</param>
  5478. /// <param name="sessionKey">本次登陆密钥</param>
  5479. /// <param name="procedureID">工序ID</param>
  5480. /// <param name="barcode">条码</param>
  5481. /// <returns></returns>
  5482. /// <remarks>
  5483. /// 陈冰 2014.09.18 新建
  5484. /// </remarks>
  5485. public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5486. {
  5487. ActionResult actionResult = new ActionResult();
  5488. try
  5489. {
  5490. // 验证请求头信息
  5491. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5492. // 验证失败
  5493. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5494. {
  5495. return actionResult;
  5496. }
  5497. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5498. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5499. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5500. {
  5501. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5502. actionResult.Status = (int)Constant.PDAResult.Success;
  5503. }
  5504. else
  5505. {
  5506. actionResult.Status = (int)Constant.PDAResult.Fail;
  5507. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5508. }
  5509. }
  5510. catch (Exception ex)
  5511. {
  5512. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5513. OutputLog.TraceLog(LogPriority.Error,
  5514. this.ToString(),
  5515. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5516. ex.ToString(),
  5517. LocalPath.LogExePath);
  5518. actionResult.Status = (int)Constant.PDAResult.Exception;
  5519. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5520. }
  5521. return actionResult;
  5522. }
  5523. /// <summary>
  5524. /// 获取用户所有菜单权限
  5525. /// </summary>
  5526. /// <param name="accountCode"></param>
  5527. /// <param name="userCode"></param>
  5528. /// <param name="userPassword"></param>
  5529. /// <param name="sessionKey"></param>
  5530. /// <returns></returns>
  5531. public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
  5532. {
  5533. ActionResult actionResult = new ActionResult();
  5534. try
  5535. {
  5536. // 验证请求头信息
  5537. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5538. // 验证失败
  5539. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5540. {
  5541. return actionResult;
  5542. }
  5543. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5544. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5545. actionResult.Result = JsonHelper.ToJson(returnValue);
  5546. actionResult.Status = (int)Constant.PDAResult.Success;
  5547. }
  5548. catch (Exception ex)
  5549. {
  5550. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5551. OutputLog.TraceLog(LogPriority.Error,
  5552. this.ToString(),
  5553. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5554. ex.ToString(),
  5555. LocalPath.LogExePath);
  5556. actionResult.Status = (int)Constant.PDAResult.Exception;
  5557. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5558. }
  5559. return actionResult;
  5560. }
  5561. public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5562. {
  5563. ActionResult actionResult = new ActionResult();
  5564. try
  5565. {
  5566. // 验证请求头信息
  5567. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5568. // 验证失败
  5569. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5570. {
  5571. return actionResult;
  5572. }
  5573. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5574. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5575. if (Convert.ToInt32(returnValue.Result) > 0)
  5576. {
  5577. actionResult.Result = JsonHelper.ToJson(returnValue);
  5578. actionResult.Status = (int)Constant.PDAResult.Success;
  5579. }
  5580. else
  5581. {
  5582. actionResult.Status = (int)Constant.PDAResult.Fail;
  5583. if (Convert.ToInt32(returnValue.Result) == -1)
  5584. actionResult.Message = "无效条码";
  5585. else if (Convert.ToInt32(returnValue.Result) == -2)
  5586. actionResult.Message = "已经生产完成";
  5587. else if (Convert.ToInt32(returnValue.Result) == -3)
  5588. actionResult.Message = "条码已经申请报废";
  5589. else if (Convert.ToInt32(returnValue.Result) == -4)
  5590. actionResult.Message = "此条码当前工序不允许进行撤销";
  5591. else if (Convert.ToInt32(returnValue.Result) == -5)
  5592. actionResult.Message = "此条码没有生产数据";
  5593. else if (Convert.ToInt32(returnValue.Result) == -6)
  5594. actionResult.Message = "没有当前工序权限";
  5595. else if (Convert.ToInt32(returnValue.Result) == -7)
  5596. actionResult.Message = "条码不在生产线上";
  5597. else if (Convert.ToInt32(returnValue.Result) == -8)
  5598. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5599. else if (Convert.ToInt32(returnValue.Result) == -9)
  5600. actionResult.Message = "条码已经是返工状态";
  5601. else if (Convert.ToInt32(returnValue.Result) == -200)
  5602. actionResult.Message = returnValue.Message;
  5603. }
  5604. }
  5605. catch (Exception ex)
  5606. {
  5607. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5608. OutputLog.TraceLog(LogPriority.Error,
  5609. this.ToString(),
  5610. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5611. ex.ToString(),
  5612. LocalPath.LogExePath);
  5613. actionResult.Status = (int)Constant.PDAResult.Exception;
  5614. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5615. }
  5616. return actionResult;
  5617. }
  5618. public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5619. {
  5620. ActionResult actionResult = new ActionResult();
  5621. try
  5622. {
  5623. // 验证请求头信息
  5624. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5625. // 验证失败
  5626. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5627. {
  5628. return actionResult;
  5629. }
  5630. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5631. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5632. if (Convert.ToInt32(returnValue.Result) > 0)
  5633. {
  5634. actionResult.Result = JsonHelper.ToJson(returnValue);
  5635. actionResult.Status = (int)Constant.PDAResult.Success;
  5636. }
  5637. else
  5638. {
  5639. actionResult.Status = (int)Constant.PDAResult.Fail;
  5640. if (Convert.ToInt32(returnValue.Result) == -1)
  5641. actionResult.Message = "无效条码";
  5642. else if (Convert.ToInt32(returnValue.Result) == -2)
  5643. actionResult.Message = "已经生产完成";
  5644. else if (Convert.ToInt32(returnValue.Result) == -3)
  5645. actionResult.Message = "条码已经申请报废";
  5646. else if (Convert.ToInt32(returnValue.Result) == -4)
  5647. actionResult.Message = "此条码当前工序不允许进行撤销";
  5648. else if (Convert.ToInt32(returnValue.Result) == -5)
  5649. actionResult.Message = "此条码没有生产数据";
  5650. else if (Convert.ToInt32(returnValue.Result) == -55)
  5651. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5652. else if (Convert.ToInt32(returnValue.Result) == -6)
  5653. actionResult.Message = "没有任何影响行";
  5654. else if (Convert.ToInt32(returnValue.Result) == -7)
  5655. actionResult.Message = "条码不在生产线上";
  5656. else if (Convert.ToInt32(returnValue.Result) == -8)
  5657. actionResult.Message = "条码已经是返工状态";
  5658. else if (Convert.ToInt32(returnValue.Result) == -200)
  5659. actionResult.Message = returnValue.Message;
  5660. }
  5661. }
  5662. catch (Exception ex)
  5663. {
  5664. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5665. OutputLog.TraceLog(LogPriority.Error,
  5666. this.ToString(),
  5667. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5668. ex.ToString(),
  5669. LocalPath.LogExePath);
  5670. actionResult.Status = (int)Constant.PDAResult.Exception;
  5671. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5672. }
  5673. return actionResult;
  5674. }
  5675. public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  5676. {
  5677. ActionResult actionResult = new ActionResult();
  5678. try
  5679. {
  5680. // 验证请求头信息
  5681. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5682. // 验证失败
  5683. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5684. {
  5685. return actionResult;
  5686. }
  5687. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5688. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5689. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5690. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5691. {
  5692. //DataView dv = returnValue.Tables[0].DefaultView;
  5693. //dv.RowFilter = "ValueFlag=1";
  5694. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5695. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5696. actionResult.Status = (int)Constant.PDAResult.Success;
  5697. }
  5698. }
  5699. catch (Exception ex)
  5700. {
  5701. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5702. OutputLog.TraceLog(LogPriority.Error,
  5703. this.ToString(),
  5704. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5705. ex.ToString(),
  5706. LocalPath.LogExePath);
  5707. actionResult.Status = (int)Constant.PDAResult.Exception;
  5708. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5709. }
  5710. return actionResult;
  5711. }
  5712. public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5713. {
  5714. ActionResult actionResult = new ActionResult();
  5715. try
  5716. {
  5717. // 验证请求头信息
  5718. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5719. // 验证失败
  5720. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5721. {
  5722. return actionResult;
  5723. }
  5724. int returnValue = ServiceInvoker.Invoke<int>(this,
  5725. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5726. actionResult.Result = JsonHelper.ToJson(returnValue);
  5727. actionResult.Status = (int)Constant.PDAResult.Success;
  5728. }
  5729. catch (Exception ex)
  5730. {
  5731. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5732. OutputLog.TraceLog(LogPriority.Error,
  5733. this.ToString(),
  5734. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5735. ex.ToString(),
  5736. LocalPath.LogExePath);
  5737. actionResult.Status = (int)Constant.PDAResult.Exception;
  5738. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5739. }
  5740. return actionResult;
  5741. }
  5742. public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  5743. {
  5744. ActionResult actionResult = new ActionResult();
  5745. try
  5746. {
  5747. // 验证请求头信息
  5748. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5749. // 验证失败
  5750. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5751. {
  5752. return actionResult;
  5753. }
  5754. int returnValue = ServiceInvoker.Invoke<int>(this,
  5755. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo));
  5756. actionResult.Result = JsonHelper.ToJson(returnValue);
  5757. actionResult.Status = (int)Constant.PDAResult.Success;
  5758. }
  5759. catch (Exception ex)
  5760. {
  5761. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5762. OutputLog.TraceLog(LogPriority.Error,
  5763. this.ToString(),
  5764. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5765. ex.ToString(),
  5766. LocalPath.LogExePath);
  5767. actionResult.Status = (int)Constant.PDAResult.Exception;
  5768. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5769. }
  5770. return actionResult;
  5771. }
  5772. public ActionResult SaveBarCodeLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  5773. string barcode, int logoid, int glazetypeid)
  5774. {
  5775. ActionResult actionResult = new ActionResult();
  5776. try
  5777. {
  5778. // 验证请求头信息
  5779. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5780. // 验证失败
  5781. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5782. {
  5783. return actionResult;
  5784. }
  5785. int returnValue = ServiceInvoker.Invoke<int>(this,
  5786. () => PMModuleLogicDAL.SaveBarCodeLogoAndGlazetype(barcode, logoid, glazetypeid, sUserInfo));
  5787. actionResult.Result = JsonHelper.ToJson(returnValue);
  5788. if (returnValue > 0)
  5789. {
  5790. actionResult.Status = (int)Constant.PDAResult.Success;
  5791. }
  5792. else
  5793. {
  5794. actionResult.Status = (int)Constant.PDAResult.Fail;
  5795. actionResult.Message = "条码不存在";
  5796. }
  5797. }
  5798. catch (Exception ex)
  5799. {
  5800. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5801. OutputLog.TraceLog(LogPriority.Error,
  5802. this.ToString(),
  5803. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5804. ex.ToString(),
  5805. LocalPath.LogExePath);
  5806. actionResult.Status = (int)Constant.PDAResult.Exception;
  5807. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5808. }
  5809. return actionResult;
  5810. }
  5811. public ActionResult SaveBarCodesLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  5812. string barcodes, int logoid, int glazetypeid, int procedureID)
  5813. {
  5814. ActionResult actionResult = new ActionResult();
  5815. try
  5816. {
  5817. // 验证请求头信息
  5818. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5819. // 验证失败
  5820. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5821. {
  5822. return actionResult;
  5823. }
  5824. int returnValue = ServiceInvoker.Invoke<int>(this,
  5825. () => PMModuleLogicDAL.SaveBarCodesLogoAndGlazetype(barcodes, logoid, glazetypeid, procedureID, sUserInfo));
  5826. actionResult.Result = JsonHelper.ToJson(returnValue);
  5827. if (returnValue > 0)
  5828. {
  5829. actionResult.Status = (int)Constant.PDAResult.Success;
  5830. }
  5831. else
  5832. {
  5833. actionResult.Status = (int)Constant.PDAResult.Fail;
  5834. actionResult.Message = "条码不存在";
  5835. }
  5836. }
  5837. catch (Exception ex)
  5838. {
  5839. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5840. OutputLog.TraceLog(LogPriority.Error,
  5841. this.ToString(),
  5842. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5843. ex.ToString(),
  5844. LocalPath.LogExePath);
  5845. actionResult.Status = (int)Constant.PDAResult.Exception;
  5846. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5847. }
  5848. return actionResult;
  5849. }
  5850. public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5851. {
  5852. ActionResult actionResult = new ActionResult();
  5853. try
  5854. {
  5855. // 验证请求头信息
  5856. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5857. // 验证失败
  5858. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5859. {
  5860. return actionResult;
  5861. }
  5862. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5863. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  5864. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5865. {
  5866. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5867. actionResult.Status = (int)Constant.PDAResult.Success;
  5868. }
  5869. }
  5870. catch (Exception ex)
  5871. {
  5872. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5873. OutputLog.TraceLog(LogPriority.Error,
  5874. this.ToString(),
  5875. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5876. ex.ToString(),
  5877. LocalPath.LogExePath);
  5878. actionResult.Status = (int)Constant.PDAResult.Exception;
  5879. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5880. }
  5881. return actionResult;
  5882. }
  5883. /// <summary>
  5884. /// 半检时,入窑前检验获取此条码是否报损为废品
  5885. /// </summary>
  5886. /// <param name="accountCode"></param>
  5887. /// <param name="userCode"></param>
  5888. /// <param name="userPassword"></param>
  5889. /// <param name="sessionKey"></param>
  5890. /// <param name="barcode">产品条码</param>
  5891. /// <returns></returns>
  5892. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5893. {
  5894. ActionResult actionResult = new ActionResult();
  5895. try
  5896. {
  5897. // 验证请求头信息
  5898. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5899. // 验证失败
  5900. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5901. {
  5902. return actionResult;
  5903. }
  5904. int returnValue = ServiceInvoker.Invoke<int>(this,
  5905. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  5906. if (returnValue != -100)
  5907. {
  5908. actionResult.Result = JsonHelper.ToJson(returnValue);
  5909. actionResult.Status = (int)Constant.PDAResult.Success;
  5910. }
  5911. else
  5912. {
  5913. actionResult.Status = (int)Constant.PDAResult.Fail;
  5914. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  5915. }
  5916. }
  5917. catch (Exception ex)
  5918. {
  5919. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5920. OutputLog.TraceLog(LogPriority.Error,
  5921. this.ToString(),
  5922. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5923. ex.ToString(),
  5924. LocalPath.LogExePath);
  5925. actionResult.Status = (int)Constant.PDAResult.Exception;
  5926. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5927. }
  5928. return actionResult;
  5929. }
  5930. /// <summary>
  5931. /// 获取登陆帐户有无入窑前检验数据编辑权限
  5932. /// </summary>
  5933. /// <param name="accountCode"></param>
  5934. /// <param name="userCode"></param>
  5935. /// <param name="userPassword"></param>
  5936. /// <param name="sessionKey"></param>
  5937. /// <param name="usercode">工号编码</param>
  5938. /// <returns></returns>
  5939. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5940. {
  5941. ActionResult actionResult = new ActionResult();
  5942. try
  5943. {
  5944. // 验证请求头信息
  5945. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5946. // 验证失败
  5947. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5948. {
  5949. return actionResult;
  5950. }
  5951. int returnValue = ServiceInvoker.Invoke<int>(this,
  5952. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  5953. actionResult.Result = JsonHelper.ToJson(returnValue);
  5954. actionResult.Status = (int)Constant.PDAResult.Success;
  5955. }
  5956. catch (Exception ex)
  5957. {
  5958. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5959. OutputLog.TraceLog(LogPriority.Error,
  5960. this.ToString(),
  5961. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5962. ex.ToString(),
  5963. LocalPath.LogExePath);
  5964. actionResult.Status = (int)Constant.PDAResult.Exception;
  5965. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5966. }
  5967. return actionResult;
  5968. }
  5969. /// <summary>
  5970. /// 获取登陆帐户有无半检验数据编辑权限
  5971. /// </summary>
  5972. /// <param name="accountCode"></param>
  5973. /// <param name="userCode"></param>
  5974. /// <param name="userPassword"></param>
  5975. /// <param name="sessionKey"></param>
  5976. /// <param name="usercode">工号编码</param>
  5977. /// <returns></returns>
  5978. public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5979. {
  5980. ActionResult actionResult = new ActionResult();
  5981. try
  5982. {
  5983. // 验证请求头信息
  5984. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5985. // 验证失败
  5986. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5987. {
  5988. return actionResult;
  5989. }
  5990. int returnValue = ServiceInvoker.Invoke<int>(this,
  5991. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  5992. actionResult.Result = JsonHelper.ToJson(returnValue);
  5993. actionResult.Status = (int)Constant.PDAResult.Success;
  5994. }
  5995. catch (Exception ex)
  5996. {
  5997. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5998. OutputLog.TraceLog(LogPriority.Error,
  5999. this.ToString(),
  6000. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6001. ex.ToString(),
  6002. LocalPath.LogExePath);
  6003. actionResult.Status = (int)Constant.PDAResult.Exception;
  6004. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6005. }
  6006. return actionResult;
  6007. }
  6008. /// <summary>
  6009. /// 获取缺陷扣罚管理的全部数据
  6010. /// </summary>
  6011. /// <param name="accountCode"></param>
  6012. /// <param name="userCode"></param>
  6013. /// <param name="userPassword"></param>
  6014. /// <param name="sessionKey"></param>
  6015. /// <returns></returns>
  6016. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  6017. {
  6018. ActionResult actionResult = new ActionResult();
  6019. try
  6020. {
  6021. // 验证请求头信息
  6022. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6023. // 验证失败
  6024. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6025. {
  6026. return actionResult;
  6027. }
  6028. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6029. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  6030. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6031. {
  6032. DataView dv = ds.Tables[0].DefaultView;
  6033. dv.RowFilter = "valueflag=1";
  6034. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6035. actionResult.Status = (int)Constant.PDAResult.Success;
  6036. }
  6037. else
  6038. {
  6039. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6040. actionResult.Status = (int)Constant.PDAResult.Success;
  6041. }
  6042. }
  6043. catch (Exception ex)
  6044. {
  6045. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6046. OutputLog.TraceLog(LogPriority.Error,
  6047. this.ToString(),
  6048. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6049. ex.ToString(),
  6050. LocalPath.LogExePath);
  6051. actionResult.Status = (int)Constant.PDAResult.Exception;
  6052. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6053. }
  6054. return actionResult;
  6055. }
  6056. /// <summary>
  6057. /// 获取缺陷扣除数管理的全部数据
  6058. /// </summary>
  6059. /// <param name="accountCode"></param>
  6060. /// <param name="userCode"></param>
  6061. /// <param name="userPassword"></param>
  6062. /// <param name="sessionKey"></param>
  6063. /// <returns></returns>
  6064. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  6065. {
  6066. ActionResult actionResult = new ActionResult();
  6067. try
  6068. {
  6069. // 验证请求头信息
  6070. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6071. // 验证失败
  6072. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6073. {
  6074. return actionResult;
  6075. }
  6076. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6077. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  6078. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6079. {
  6080. DataView dv = ds.Tables[0].DefaultView;
  6081. dv.RowFilter = "valueflag=1";
  6082. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6083. actionResult.Status = (int)Constant.PDAResult.Success;
  6084. }
  6085. else
  6086. {
  6087. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6088. actionResult.Status = (int)Constant.PDAResult.Success;
  6089. }
  6090. }
  6091. catch (Exception ex)
  6092. {
  6093. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6094. OutputLog.TraceLog(LogPriority.Error,
  6095. this.ToString(),
  6096. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6097. ex.ToString(),
  6098. LocalPath.LogExePath);
  6099. actionResult.Status = (int)Constant.PDAResult.Exception;
  6100. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6101. }
  6102. return actionResult;
  6103. }
  6104. /// <summary>
  6105. /// 获取缺陷扣罚关系管理的全部数据
  6106. /// </summary>
  6107. /// <param name="accountCode"></param>
  6108. /// <param name="userCode"></param>
  6109. /// <param name="userPassword"></param>
  6110. /// <param name="sessionKey"></param>
  6111. /// <returns></returns>
  6112. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6113. {
  6114. ActionResult actionResult = new ActionResult();
  6115. try
  6116. {
  6117. // 验证请求头信息
  6118. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6119. // 验证失败
  6120. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6121. {
  6122. return actionResult;
  6123. }
  6124. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6125. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  6126. DataTable dt = new DataTable();
  6127. dt.Columns.Add("DefectID");
  6128. dt.Columns.Add("DefectFineID");
  6129. DataView dv = ds.Tables[0].DefaultView;
  6130. DataTable dtFor = dv.ToTable("defectid", true);
  6131. for (int i = 0; i < dtFor.Rows.Count; i++)
  6132. {
  6133. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6134. string substring = "";
  6135. foreach (DataRow r1 in r)
  6136. {
  6137. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  6138. }
  6139. if (substring != "")
  6140. {
  6141. DataRow drnew = dt.NewRow();
  6142. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6143. drnew["DefectFineID"] = substring.TrimEnd(',');
  6144. dt.Rows.Add(drnew);
  6145. }
  6146. }
  6147. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6148. actionResult.Status = (int)Constant.PDAResult.Success;
  6149. }
  6150. catch (Exception ex)
  6151. {
  6152. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6153. OutputLog.TraceLog(LogPriority.Error,
  6154. this.ToString(),
  6155. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6156. ex.ToString(),
  6157. LocalPath.LogExePath);
  6158. actionResult.Status = (int)Constant.PDAResult.Exception;
  6159. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6160. }
  6161. return actionResult;
  6162. }
  6163. /// <summary>
  6164. /// 获取缺陷扣除数关系管理的全部数据
  6165. /// </summary>
  6166. /// <param name="accountCode"></param>
  6167. /// <param name="userCode"></param>
  6168. /// <param name="userPassword"></param>
  6169. /// <param name="sessionKey"></param>
  6170. /// <returns></returns>
  6171. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6172. {
  6173. ActionResult actionResult = new ActionResult();
  6174. try
  6175. {
  6176. // 验证请求头信息
  6177. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6178. // 验证失败
  6179. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6180. {
  6181. return actionResult;
  6182. }
  6183. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6184. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6185. DataTable dt = new DataTable();
  6186. dt.Columns.Add("DefectID");
  6187. dt.Columns.Add("DefectDeductionNum");
  6188. DataView dv = ds.Tables[0].DefaultView;
  6189. DataTable dtFor = dv.ToTable("defectid", true);
  6190. for (int i = 0; i < dtFor.Rows.Count; i++)
  6191. {
  6192. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6193. string substring = "";
  6194. foreach (DataRow r1 in r)
  6195. {
  6196. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6197. }
  6198. if (substring != "")
  6199. {
  6200. DataRow drnew = dt.NewRow();
  6201. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6202. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6203. dt.Rows.Add(drnew);
  6204. }
  6205. }
  6206. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6207. actionResult.Status = (int)Constant.PDAResult.Success;
  6208. }
  6209. catch (Exception ex)
  6210. {
  6211. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6212. OutputLog.TraceLog(LogPriority.Error,
  6213. this.ToString(),
  6214. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6215. ex.ToString(),
  6216. LocalPath.LogExePath);
  6217. actionResult.Status = (int)Constant.PDAResult.Exception;
  6218. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6219. }
  6220. return actionResult;
  6221. }
  6222. /// <summary>
  6223. /// 获取盘点单明细
  6224. /// </summary>
  6225. /// <param name="sUserInfo"></param>
  6226. /// <returns></returns>
  6227. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6228. {
  6229. ActionResult actionResult = new ActionResult();
  6230. try
  6231. {
  6232. // 验证请求头信息
  6233. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6234. // 验证失败
  6235. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6236. {
  6237. return actionResult;
  6238. }
  6239. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6240. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6241. actionResult.Result = JsonHelper.ToJson(ds);
  6242. actionResult.Status = (int)Constant.PDAResult.Success;
  6243. }
  6244. catch (Exception ex)
  6245. {
  6246. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6247. OutputLog.TraceLog(LogPriority.Error,
  6248. this.ToString(),
  6249. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6250. ex.ToString(),
  6251. LocalPath.LogExePath);
  6252. actionResult.Status = (int)Constant.PDAResult.Exception;
  6253. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6254. }
  6255. return actionResult;
  6256. }
  6257. /// <summary>
  6258. /// 半检检验条码
  6259. /// </summary>
  6260. /// <param name="sUserInfo"></param>
  6261. /// <returns></returns>
  6262. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6263. {
  6264. ActionResult actionResult = new ActionResult();
  6265. try
  6266. {
  6267. // 验证请求头信息
  6268. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6269. // 验证失败
  6270. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6271. {
  6272. return actionResult;
  6273. }
  6274. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6275. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6276. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6277. if (Convert.ToInt32(resultEntity.Result) < 0)
  6278. {
  6279. actionResult.Status = (int)Constant.PDAResult.Fail;
  6280. }
  6281. else
  6282. {
  6283. actionResult.Status = (int)Constant.PDAResult.Success;
  6284. }
  6285. actionResult.Message = resultEntity.Message;
  6286. }
  6287. catch (Exception ex)
  6288. {
  6289. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6290. OutputLog.TraceLog(LogPriority.Error,
  6291. this.ToString(),
  6292. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6293. ex.ToString(),
  6294. LocalPath.LogExePath);
  6295. actionResult.Status = (int)Constant.PDAResult.Exception;
  6296. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6297. }
  6298. return actionResult;
  6299. }
  6300. /// <summary>
  6301. /// 根据条码获取经过的工序,用于绑定返工工序
  6302. /// </summary>
  6303. /// <param name="sUserInfo"></param>
  6304. /// <returns></returns>
  6305. public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6306. {
  6307. ActionResult actionResult = new ActionResult();
  6308. try
  6309. {
  6310. // 验证请求头信息
  6311. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6312. // 验证失败
  6313. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6314. {
  6315. return actionResult;
  6316. }
  6317. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6318. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6319. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6320. actionResult.Status = (int)Constant.PDAResult.Success;
  6321. }
  6322. catch (Exception ex)
  6323. {
  6324. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6325. OutputLog.TraceLog(LogPriority.Error,
  6326. this.ToString(),
  6327. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6328. ex.ToString(),
  6329. LocalPath.LogExePath);
  6330. actionResult.Status = (int)Constant.PDAResult.Exception;
  6331. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6332. }
  6333. return actionResult;
  6334. }
  6335. /// <summary>
  6336. /// 获取登陆帐户有无半检状态权限
  6337. /// </summary>
  6338. /// <param name="sUserInfo"></param>
  6339. /// <returns></returns>
  6340. public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6341. {
  6342. ActionResult actionResult = new ActionResult();
  6343. try
  6344. {
  6345. // 验证请求头信息
  6346. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6347. // 验证失败
  6348. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6349. {
  6350. return actionResult;
  6351. }
  6352. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6353. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6354. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6355. actionResult.Status = (int)Constant.PDAResult.Success;
  6356. }
  6357. catch (Exception ex)
  6358. {
  6359. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6360. OutputLog.TraceLog(LogPriority.Error,
  6361. this.ToString(),
  6362. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6363. ex.ToString(),
  6364. LocalPath.LogExePath);
  6365. actionResult.Status = (int)Constant.PDAResult.Exception;
  6366. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6367. }
  6368. return actionResult;
  6369. }
  6370. /// <summary>
  6371. /// 复检状态数据源
  6372. /// </summary>
  6373. /// <param name="sUserInfo"></param>
  6374. /// <returns></returns>
  6375. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6376. {
  6377. ActionResult actionResult = new ActionResult();
  6378. try
  6379. {
  6380. // 验证请求头信息
  6381. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6382. // 验证失败
  6383. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6384. {
  6385. return actionResult;
  6386. }
  6387. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6388. () => SystemModuleLogic.GetSemiCheckType());
  6389. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6390. actionResult.Status = (int)Constant.PDAResult.Success;
  6391. }
  6392. catch (Exception ex)
  6393. {
  6394. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6395. OutputLog.TraceLog(LogPriority.Error,
  6396. this.ToString(),
  6397. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6398. ex.ToString(),
  6399. LocalPath.LogExePath);
  6400. actionResult.Status = (int)Constant.PDAResult.Exception;
  6401. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6402. }
  6403. return actionResult;
  6404. }
  6405. /// <summary>
  6406. /// 根据半成品检验数据ID,显示半成品数据信息
  6407. /// </summary>
  6408. /// <param name="sUserInfo"></param>
  6409. /// <returns></returns>
  6410. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6411. {
  6412. ActionResult actionResult = new ActionResult();
  6413. try
  6414. {
  6415. // 验证请求头信息
  6416. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6417. // 验证失败
  6418. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6419. {
  6420. return actionResult;
  6421. }
  6422. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6423. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6424. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6425. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6426. {
  6427. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6428. {
  6429. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6430. {
  6431. SemiCheckEntity productionData = new SemiCheckEntity();
  6432. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6433. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6434. {
  6435. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6436. }
  6437. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6438. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6439. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6440. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6441. productionData.ReFine = 0;
  6442. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6443. {
  6444. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6445. }
  6446. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6447. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6448. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6449. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6450. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6451. {
  6452. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6453. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6454. }
  6455. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6456. {
  6457. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6458. }
  6459. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6460. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6461. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6462. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6463. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6464. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6465. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6466. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6467. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6468. {
  6469. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6470. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6471. }
  6472. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6473. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6474. {
  6475. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6476. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6477. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6478. }
  6479. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6480. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6481. {
  6482. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6483. }
  6484. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6485. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6486. DataTable dtDefect = dvDefect.ToTable();
  6487. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6488. {
  6489. // 产品缺陷
  6490. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6491. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6492. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6493. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6494. //{
  6495. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6496. //}
  6497. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6498. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6499. {
  6500. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6501. }
  6502. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6503. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6504. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6505. {
  6506. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6507. }
  6508. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6509. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6510. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6511. {
  6512. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6513. }
  6514. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6515. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6516. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6517. {
  6518. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6519. }
  6520. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6521. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6522. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6523. //{
  6524. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6525. //}
  6526. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6527. //{
  6528. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6529. //}
  6530. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6531. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6532. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6533. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6534. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6535. {
  6536. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6537. }
  6538. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6539. {
  6540. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6541. }
  6542. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6543. //{
  6544. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6545. //}
  6546. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6547. //--------责任员工-------------------
  6548. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6549. if (drRow.Length > Constant.INT_IS_ZERO)
  6550. {
  6551. if (defect.DefectResponsibles == null)
  6552. {
  6553. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6554. }
  6555. foreach (DataRow r in drRow)
  6556. {
  6557. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6558. if (r["SemiCheckDefectID"].ToString() != "")
  6559. {
  6560. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6561. }
  6562. if (r["StaffID"].ToString() != "")
  6563. {
  6564. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6565. }
  6566. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6567. defectResponsible.StaffName = r["StaffName"].ToString();
  6568. if (r["StaffStatus"].ToString() != "")
  6569. {
  6570. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6571. }
  6572. if (r["UJobsID"].ToString() != "")
  6573. {
  6574. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6575. }
  6576. if (r["SJobsID"].ToString() != "")
  6577. {
  6578. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6579. }
  6580. defect.DefectResponsibles.Add(defectResponsible);
  6581. }
  6582. }
  6583. //------------------------------
  6584. if (productionData.SemiCheckDefects == null)
  6585. {
  6586. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6587. }
  6588. productionData.SemiCheckDefects.Add(defect);
  6589. }
  6590. //if (productionDatas.PDAProductionData == null)
  6591. //{
  6592. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6593. //}
  6594. productionDatas[0] = productionData;
  6595. //---------------------------------------------------------------------------------
  6596. }
  6597. }
  6598. }
  6599. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6600. actionResult.Status = (int)Constant.PDAResult.Success;
  6601. }
  6602. catch (Exception ex)
  6603. {
  6604. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6605. OutputLog.TraceLog(LogPriority.Error,
  6606. this.ToString(),
  6607. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6608. ex.ToString(),
  6609. LocalPath.LogExePath);
  6610. actionResult.Status = (int)Constant.PDAResult.Exception;
  6611. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6612. }
  6613. return actionResult;
  6614. }
  6615. /// <summary>
  6616. /// 保存半检登记
  6617. /// </summary>
  6618. /// <param name="accountCode">帐套code</param>
  6619. /// <param name="userCode">用户code</param>
  6620. /// <param name="userPassword">用户密码</param>
  6621. /// <param name="sessionKey">本次登陆密钥</param>
  6622. /// <param name="entity">半检实体类</param>
  6623. /// <param name="sUserInfo">用户基本信息</param>
  6624. /// <returns></returns>
  6625. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6626. {
  6627. ActionResult actionResult = new ActionResult();
  6628. try
  6629. {
  6630. // 验证请求头信息
  6631. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6632. // 验证失败
  6633. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6634. {
  6635. return actionResult;
  6636. }
  6637. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6638. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6639. string err = string.Empty;
  6640. err = resultEntity.Message;
  6641. if (err == null)
  6642. {
  6643. err = "";
  6644. }
  6645. SemiCheckEntity entity = entityobj[0];
  6646. if (entity.SemiCheckCategory == 1) // 半检登记
  6647. {
  6648. }
  6649. else if (entity.SemiCheckCategory == 2)// 复检登记
  6650. {
  6651. err = JsonHelper.ToJson(err);
  6652. }
  6653. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6654. {
  6655. err = JsonHelper.ToJson(err);
  6656. }
  6657. //actionResult.Result = JsonHelper.ToJson(err);
  6658. actionResult.Result = err;//JsonHelper.ToJson(err);
  6659. actionResult.Status = (int)Constant.PDAResult.Success;
  6660. }
  6661. catch (Exception ex)
  6662. {
  6663. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6664. OutputLog.TraceLog(LogPriority.Error,
  6665. this.ToString(),
  6666. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6667. ex.ToString(),
  6668. LocalPath.LogExePath);
  6669. actionResult.Status = (int)Constant.PDAResult.Exception;
  6670. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6671. }
  6672. return actionResult;
  6673. }
  6674. /// <summary>
  6675. /// 根据所选工号,查出缺陷责任员工
  6676. /// </summary>
  6677. /// <param name="sUserInfo"></param>
  6678. /// <returns></returns>
  6679. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6680. {
  6681. ActionResult actionResult = new ActionResult();
  6682. try
  6683. {
  6684. // 验证请求头信息
  6685. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6686. // 验证失败
  6687. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6688. {
  6689. return actionResult;
  6690. }
  6691. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6692. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  6693. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6694. actionResult.Status = (int)Constant.PDAResult.Success;
  6695. }
  6696. catch (Exception ex)
  6697. {
  6698. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6699. OutputLog.TraceLog(LogPriority.Error,
  6700. this.ToString(),
  6701. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6702. ex.ToString(),
  6703. LocalPath.LogExePath);
  6704. actionResult.Status = (int)Constant.PDAResult.Exception;
  6705. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6706. }
  6707. return actionResult;
  6708. }
  6709. /// <summary>
  6710. /// 获取半成品缺陷管理的全部数据
  6711. /// </summary>
  6712. /// <param name="sUserInfo"></param>
  6713. /// <returns></returns>
  6714. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  6715. {
  6716. ActionResult actionResult = new ActionResult();
  6717. try
  6718. {
  6719. // 验证请求头信息
  6720. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6721. // 验证失败
  6722. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6723. {
  6724. return actionResult;
  6725. }
  6726. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6727. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  6728. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6729. actionResult.Status = (int)Constant.PDAResult.Success;
  6730. }
  6731. catch (Exception ex)
  6732. {
  6733. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6734. OutputLog.TraceLog(LogPriority.Error,
  6735. this.ToString(),
  6736. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6737. ex.ToString(),
  6738. LocalPath.LogExePath);
  6739. actionResult.Status = (int)Constant.PDAResult.Exception;
  6740. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6741. }
  6742. return actionResult;
  6743. }
  6744. /// <summary>
  6745. /// 获取半成品缺陷位置管理的全部数据
  6746. /// </summary>
  6747. /// <param name="sUserInfo"></param>
  6748. /// <returns></returns>
  6749. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  6750. {
  6751. ActionResult actionResult = new ActionResult();
  6752. try
  6753. {
  6754. // 验证请求头信息
  6755. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6756. // 验证失败
  6757. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6758. {
  6759. return actionResult;
  6760. }
  6761. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6762. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  6763. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6764. actionResult.Status = (int)Constant.PDAResult.Success;
  6765. }
  6766. catch (Exception ex)
  6767. {
  6768. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6769. OutputLog.TraceLog(LogPriority.Error,
  6770. this.ToString(),
  6771. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6772. ex.ToString(),
  6773. LocalPath.LogExePath);
  6774. actionResult.Status = (int)Constant.PDAResult.Exception;
  6775. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6776. }
  6777. return actionResult;
  6778. }
  6779. /// <summary>
  6780. /// 复检验条码
  6781. /// </summary>
  6782. /// <param name="sUserInfo"></param>
  6783. /// <returns></returns>
  6784. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6785. {
  6786. ActionResult actionResult = new ActionResult();
  6787. try
  6788. {
  6789. // 验证请求头信息
  6790. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6791. // 验证失败
  6792. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6793. {
  6794. return actionResult;
  6795. }
  6796. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6797. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  6798. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6799. if (Convert.ToInt32(resultEntity.Result) < 0)
  6800. {
  6801. actionResult.Status = (int)Constant.PDAResult.Fail;
  6802. }
  6803. else
  6804. {
  6805. actionResult.Status = (int)Constant.PDAResult.Success;
  6806. }
  6807. actionResult.Message = resultEntity.Message;
  6808. }
  6809. catch (Exception ex)
  6810. {
  6811. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6812. OutputLog.TraceLog(LogPriority.Error,
  6813. this.ToString(),
  6814. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6815. ex.ToString(),
  6816. LocalPath.LogExePath);
  6817. actionResult.Status = (int)Constant.PDAResult.Exception;
  6818. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6819. }
  6820. return actionResult;
  6821. }
  6822. /// <summary>
  6823. /// 撤销复检验条码
  6824. /// </summary>
  6825. /// <param name="sUserInfo"></param>
  6826. /// <returns></returns>
  6827. public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6828. {
  6829. ActionResult actionResult = new ActionResult();
  6830. try
  6831. {
  6832. // 验证请求头信息
  6833. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6834. // 验证失败
  6835. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6836. {
  6837. return actionResult;
  6838. }
  6839. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6840. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  6841. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6842. if (Convert.ToInt32(resultEntity.Result) < 0)
  6843. {
  6844. actionResult.Status = (int)Constant.PDAResult.Fail;
  6845. }
  6846. else
  6847. {
  6848. actionResult.Status = (int)Constant.PDAResult.Success;
  6849. }
  6850. actionResult.Message = resultEntity.Message;
  6851. }
  6852. catch (Exception ex)
  6853. {
  6854. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6855. OutputLog.TraceLog(LogPriority.Error,
  6856. this.ToString(),
  6857. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6858. ex.ToString(),
  6859. LocalPath.LogExePath);
  6860. actionResult.Status = (int)Constant.PDAResult.Exception;
  6861. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6862. }
  6863. return actionResult;
  6864. }
  6865. /// <summary>
  6866. /// 恢复数据
  6867. /// </summary>
  6868. /// <param name="sUserInfo"></param>
  6869. /// <returns></returns>
  6870. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6871. {
  6872. ActionResult actionResult = new ActionResult();
  6873. try
  6874. {
  6875. // 验证请求头信息
  6876. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6877. // 验证失败
  6878. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6879. {
  6880. return actionResult;
  6881. }
  6882. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6883. () => PMModuleLogicDAL.ResetBarCode(barcode));
  6884. if (resultEntity > 0)
  6885. {
  6886. actionResult.Status = (int)Constant.PDAResult.Success;
  6887. actionResult.Message = "恢复数据成功";
  6888. }
  6889. else
  6890. {
  6891. actionResult.Status = (int)Constant.PDAResult.Fail;
  6892. if (resultEntity == -1)
  6893. {
  6894. actionResult.Message = "此条码没有清除,不能恢复";
  6895. }
  6896. else if (resultEntity == 0)
  6897. {
  6898. actionResult.Message = "没有可恢复的数据";
  6899. }
  6900. }
  6901. }
  6902. catch (Exception ex)
  6903. {
  6904. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6905. OutputLog.TraceLog(LogPriority.Error,
  6906. this.ToString(),
  6907. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6908. ex.ToString(),
  6909. LocalPath.LogExePath);
  6910. actionResult.Status = (int)Constant.PDAResult.Exception;
  6911. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6912. }
  6913. return actionResult;
  6914. }
  6915. /// <summary>
  6916. /// 通过SettingCode获取系统参数管理的数据
  6917. /// </summary>
  6918. /// <param name="accountCode"></param>
  6919. /// <param name="userCode"></param>
  6920. /// <param name="userPassword"></param>
  6921. /// <param name="sessionKey"></param>
  6922. /// <param name="settingcode">设置编码</param>
  6923. /// <returns></returns>
  6924. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  6925. {
  6926. ActionResult actionResult = new ActionResult();
  6927. try
  6928. {
  6929. // 验证请求头信息
  6930. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6931. // 验证失败
  6932. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6933. {
  6934. return actionResult;
  6935. }
  6936. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6937. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  6938. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6939. actionResult.Status = (int)Constant.PDAResult.Success;
  6940. }
  6941. catch (Exception ex)
  6942. {
  6943. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6944. OutputLog.TraceLog(LogPriority.Error,
  6945. this.ToString(),
  6946. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6947. ex.ToString(),
  6948. LocalPath.LogExePath);
  6949. actionResult.Status = (int)Constant.PDAResult.Exception;
  6950. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6951. }
  6952. return actionResult;
  6953. }
  6954. /// <summary>
  6955. /// 校验条码是否允许撤销,如果不允许提示错误消息
  6956. /// </summary>
  6957. /// <param name="accountCode"></param>
  6958. /// <param name="userCode"></param>
  6959. /// <param name="userPassword"></param>
  6960. /// <param name="sessionKey"></param>
  6961. /// <param name="orgTime">原时间</param>
  6962. /// <param name="days">允许撤销天数</param>
  6963. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  6964. /// <returns></returns>
  6965. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  6966. {
  6967. ActionResult actionResult = new ActionResult();
  6968. try
  6969. {
  6970. // 验证请求头信息
  6971. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6972. // 验证失败
  6973. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6974. {
  6975. return actionResult;
  6976. }
  6977. string[] subOrgTime = orgTime.Split('-');
  6978. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  6979. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6980. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  6981. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6982. if (Convert.ToInt32(resultEntity.Result) < 0)
  6983. {
  6984. actionResult.Status = (int)Constant.PDAResult.Fail;
  6985. }
  6986. else
  6987. {
  6988. actionResult.Status = (int)Constant.PDAResult.Success;
  6989. }
  6990. actionResult.Message = resultEntity.Message;
  6991. }
  6992. catch (Exception ex)
  6993. {
  6994. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6995. OutputLog.TraceLog(LogPriority.Error,
  6996. this.ToString(),
  6997. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6998. ex.ToString(),
  6999. LocalPath.LogExePath);
  7000. actionResult.Status = (int)Constant.PDAResult.Exception;
  7001. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7002. }
  7003. return actionResult;
  7004. }
  7005. /// <summary>
  7006. /// 获取生产订单管理的全部数据
  7007. /// </summary>
  7008. /// <param name="sUserInfo"></param>
  7009. /// <returns></returns>
  7010. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  7011. {
  7012. ActionResult actionResult = new ActionResult();
  7013. try
  7014. {
  7015. // 验证请求头信息
  7016. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7017. // 验证失败
  7018. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7019. {
  7020. return actionResult;
  7021. }
  7022. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7023. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  7024. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7025. actionResult.Status = (int)Constant.PDAResult.Success;
  7026. }
  7027. catch (Exception ex)
  7028. {
  7029. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7030. OutputLog.TraceLog(LogPriority.Error,
  7031. this.ToString(),
  7032. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7033. ex.ToString(),
  7034. LocalPath.LogExePath);
  7035. actionResult.Status = (int)Constant.PDAResult.Exception;
  7036. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7037. }
  7038. return actionResult;
  7039. }
  7040. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7041. {
  7042. ActionResult actionResult = new ActionResult();
  7043. try
  7044. {
  7045. // 验证请求头信息
  7046. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7047. // 验证失败
  7048. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7049. {
  7050. return actionResult;
  7051. }
  7052. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7053. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  7054. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7055. if (Convert.ToInt32(resultEntity.Result) < 0)
  7056. {
  7057. actionResult.Status = (int)Constant.PDAResult.Fail;
  7058. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  7059. }
  7060. else
  7061. {
  7062. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  7063. actionResult.Status = (int)Constant.PDAResult.Success;
  7064. }
  7065. actionResult.Message = resultEntity.Message;
  7066. }
  7067. catch (Exception ex)
  7068. {
  7069. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7070. OutputLog.TraceLog(LogPriority.Error,
  7071. this.ToString(),
  7072. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7073. ex.ToString(),
  7074. LocalPath.LogExePath);
  7075. actionResult.Status = (int)Constant.PDAResult.Exception;
  7076. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7077. }
  7078. return actionResult;
  7079. }
  7080. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  7081. {
  7082. ActionResult actionResult = new ActionResult();
  7083. try
  7084. {
  7085. // 验证请求头信息
  7086. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7087. // 验证失败
  7088. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7089. {
  7090. return actionResult;
  7091. }
  7092. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7093. () => SystemModuleLogic.GetSystemData(sUserInfo));
  7094. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7095. actionResult.Status = (int)Constant.PDAResult.Success;
  7096. }
  7097. catch (Exception ex)
  7098. {
  7099. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7100. OutputLog.TraceLog(LogPriority.Error,
  7101. this.ToString(),
  7102. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7103. ex.ToString(),
  7104. LocalPath.LogExePath);
  7105. actionResult.Status = (int)Constant.PDAResult.Exception;
  7106. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7107. }
  7108. return actionResult;
  7109. }
  7110. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  7111. {
  7112. ActionResult actionResult = new ActionResult();
  7113. try
  7114. {
  7115. // 验证请求头信息
  7116. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7117. // 验证失败
  7118. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7119. {
  7120. return actionResult;
  7121. }
  7122. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  7123. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7124. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  7125. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7126. if (Convert.ToInt32(resultEntity.Result) < 0)
  7127. {
  7128. actionResult.Status = (int)Constant.PDAResult.Fail;
  7129. }
  7130. else
  7131. {
  7132. actionResult.Status = (int)Constant.PDAResult.Success;
  7133. }
  7134. actionResult.Message = resultEntity.Message;
  7135. }
  7136. catch (Exception ex)
  7137. {
  7138. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7139. OutputLog.TraceLog(LogPriority.Error,
  7140. this.ToString(),
  7141. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7142. ex.ToString(),
  7143. LocalPath.LogExePath);
  7144. actionResult.Status = (int)Constant.PDAResult.Exception;
  7145. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7146. }
  7147. return actionResult;
  7148. }
  7149. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7150. {
  7151. ActionResult actionResult = new ActionResult();
  7152. try
  7153. {
  7154. // 验证请求头信息
  7155. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7156. // 验证失败
  7157. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7158. {
  7159. return actionResult;
  7160. }
  7161. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7162. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7163. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7164. if (Convert.ToInt32(resultEntity.Result) < 0)
  7165. {
  7166. actionResult.Status = (int)Constant.PDAResult.Fail;
  7167. }
  7168. else
  7169. {
  7170. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7171. actionResult.Status = (int)Constant.PDAResult.Success;
  7172. }
  7173. actionResult.Message = resultEntity.Message;
  7174. }
  7175. catch (Exception ex)
  7176. {
  7177. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7178. OutputLog.TraceLog(LogPriority.Error,
  7179. this.ToString(),
  7180. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7181. ex.ToString(),
  7182. LocalPath.LogExePath);
  7183. actionResult.Status = (int)Constant.PDAResult.Exception;
  7184. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7185. }
  7186. return actionResult;
  7187. }
  7188. public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7189. {
  7190. ActionResult actionResult = new ActionResult();
  7191. try
  7192. {
  7193. // 验证请求头信息
  7194. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7195. // 验证失败
  7196. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7197. {
  7198. return actionResult;
  7199. }
  7200. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7201. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7202. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7203. if (Convert.ToInt32(resultEntity.Result) < 0)
  7204. {
  7205. actionResult.Status = (int)Constant.PDAResult.Fail;
  7206. }
  7207. else
  7208. {
  7209. actionResult.Status = (int)Constant.PDAResult.Success;
  7210. }
  7211. actionResult.Message = resultEntity.Message;
  7212. }
  7213. catch (Exception ex)
  7214. {
  7215. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7216. OutputLog.TraceLog(LogPriority.Error,
  7217. this.ToString(),
  7218. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7219. ex.ToString(),
  7220. LocalPath.LogExePath);
  7221. actionResult.Status = (int)Constant.PDAResult.Exception;
  7222. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7223. }
  7224. return actionResult;
  7225. }
  7226. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7227. {
  7228. ActionResult actionResult = new ActionResult();
  7229. try
  7230. {
  7231. // 验证请求头信息
  7232. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7233. // 验证失败
  7234. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7235. {
  7236. return actionResult;
  7237. }
  7238. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7239. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7240. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7241. if (Convert.ToInt32(resultEntity.Result) < 0)
  7242. {
  7243. actionResult.Status = (int)Constant.PDAResult.Fail;
  7244. }
  7245. else
  7246. {
  7247. actionResult.Status = (int)Constant.PDAResult.Success;
  7248. }
  7249. actionResult.Message = resultEntity.Message;
  7250. }
  7251. catch (Exception ex)
  7252. {
  7253. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7254. OutputLog.TraceLog(LogPriority.Error,
  7255. this.ToString(),
  7256. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7257. ex.ToString(),
  7258. LocalPath.LogExePath);
  7259. actionResult.Status = (int)Constant.PDAResult.Exception;
  7260. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7261. }
  7262. return actionResult;
  7263. }
  7264. #region PDA条码打印
  7265. /// <summary>
  7266. /// 获取条码打印机
  7267. /// </summary>
  7268. /// <param name="accountCode"></param>
  7269. /// <param name="userCode"></param>
  7270. /// <param name="userPassword"></param>
  7271. /// <param name="sessionKey"></param>
  7272. /// <returns></returns>
  7273. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printType=0)
  7274. {
  7275. ActionResult actionResult = new ActionResult();
  7276. try
  7277. {
  7278. // 验证请求头信息
  7279. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7280. // 验证失败
  7281. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7282. {
  7283. return actionResult;
  7284. }
  7285. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType);
  7286. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7287. actionResult.Status = (int)Constant.PDAResult.Success;
  7288. }
  7289. catch (Exception ex)
  7290. {
  7291. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7292. OutputLog.TraceLog(LogPriority.Error,
  7293. this.ToString(),
  7294. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7295. ex.ToString(),
  7296. LocalPath.LogExePath);
  7297. actionResult.Status = (int)Constant.PDAResult.Exception;
  7298. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7299. }
  7300. return actionResult;
  7301. }
  7302. /// <summary>
  7303. /// 打印条码样式(补打)
  7304. /// </summary>
  7305. /// <param name="accountCode"></param>
  7306. /// <param name="userCode"></param>
  7307. /// <param name="userPassword"></param>
  7308. /// <param name="sessionKey"></param>
  7309. /// <returns></returns>
  7310. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey,
  7311. string barcode, int copies, int printerID, int printWay=2)
  7312. {
  7313. ActionResult actionResult = new ActionResult();
  7314. try
  7315. {
  7316. // 验证请求头信息
  7317. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7318. // 验证失败
  7319. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7320. {
  7321. return actionResult;
  7322. }
  7323. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7324. // copies, printerID, sUserInfo);
  7325. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(barcode,
  7326. copies, printerID, sUserInfo, printWay);
  7327. if (sre.Status != Constant.ServiceResultStatus.Success)
  7328. {
  7329. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7330. actionResult.Message = sre.Message;
  7331. return actionResult;
  7332. }
  7333. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7334. actionResult.Status = (int)Constant.PDAResult.Success;
  7335. }
  7336. catch (Exception ex)
  7337. {
  7338. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7339. OutputLog.TraceLog(LogPriority.Error,
  7340. this.ToString(),
  7341. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7342. ex.ToString(),
  7343. LocalPath.LogExePath);
  7344. actionResult.Status = (int)Constant.PDAResult.Exception;
  7345. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7346. }
  7347. return actionResult;
  7348. }
  7349. #endregion PDA条码打印
  7350. #region 统计报表
  7351. /// <summary>
  7352. /// 成型结算报表
  7353. /// </summary>
  7354. /// <param name="accountCode"></param>
  7355. /// <param name="userCode"></param>
  7356. /// <param name="userPassword"></param>
  7357. /// <param name="sessionKey"></param>
  7358. /// <returns></returns>
  7359. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7360. int currentMonth)
  7361. {
  7362. ActionResult actionResult = new ActionResult();
  7363. try
  7364. {
  7365. // 验证请求头信息
  7366. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7367. // 验证失败
  7368. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7369. {
  7370. return actionResult;
  7371. }
  7372. DateTime date = DateTime.Now;
  7373. if (currentMonth != 1)
  7374. {
  7375. date = date.AddMonths(-1);
  7376. }
  7377. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7378. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7379. if (resultEntity == null || resultEntity.Data == null)
  7380. {
  7381. actionResult.Status = (int)Constant.PDAResult.Fail;
  7382. actionResult.Message = "查询失败";
  7383. return actionResult;
  7384. }
  7385. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7386. {
  7387. actionResult.Status = (int)Constant.PDAResult.Fail;
  7388. actionResult.Message = resultEntity.Message;
  7389. return actionResult;
  7390. }
  7391. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7392. actionResult.Status = (int)Constant.PDAResult.Success;
  7393. }
  7394. catch (Exception ex)
  7395. {
  7396. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7397. OutputLog.TraceLog(LogPriority.Error,
  7398. this.ToString(),
  7399. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7400. ex.ToString(),
  7401. LocalPath.LogExePath);
  7402. actionResult.Status = (int)Constant.PDAResult.Exception;
  7403. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7404. }
  7405. return actionResult;
  7406. }
  7407. #endregion
  7408. #region 设置当期用户默认打印机配置
  7409. /// <summary>
  7410. /// 设置当期用户默认打印机配置
  7411. /// </summary>
  7412. /// <param name="accountCode"></param>
  7413. /// <param name="userCode"></param>
  7414. /// <param name="userPassword"></param>
  7415. /// <param name="sessionKey"></param>
  7416. /// <param name="printerID"></param>
  7417. /// <returns></returns>
  7418. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7419. int printerID)
  7420. {
  7421. ActionResult actionResult = new ActionResult();
  7422. try
  7423. {
  7424. // 验证请求头信息
  7425. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7426. // 验证失败
  7427. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7428. {
  7429. return actionResult;
  7430. }
  7431. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7432. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7433. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7434. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7435. {
  7436. actionResult.Status = (int)Constant.PDAResult.Fail;
  7437. }
  7438. else
  7439. {
  7440. actionResult.Status = (int)Constant.PDAResult.Success;
  7441. }
  7442. actionResult.Message = resultEntity.Message;
  7443. }
  7444. catch (Exception ex)
  7445. {
  7446. OutputLog.TraceLog(LogPriority.Error,
  7447. this.ToString(),
  7448. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7449. ex.ToString(),
  7450. LocalPath.LogExePath);
  7451. actionResult.Status = (int)Constant.PDAResult.Exception;
  7452. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7453. }
  7454. return actionResult;
  7455. }
  7456. /// <summary>
  7457. /// 校验产品条码是否可以进行回收
  7458. /// </summary>
  7459. /// <param name="accountCode">帐套code</param>
  7460. /// <param name="userCode">用户code</param>
  7461. /// <param name="userPassword">用户密码</param>
  7462. /// <param name="sessionKey">本次登陆密钥</param>
  7463. /// <param name="procedureID">工序ID</param>
  7464. /// <param name="barcode">条码</param>
  7465. /// <returns></returns>
  7466. /// <remarks>
  7467. /// 王鑫 2017.7.21 新建
  7468. /// </remarks>
  7469. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7470. {
  7471. ActionResult actionResult = new ActionResult();
  7472. try
  7473. {
  7474. // 验证请求头信息
  7475. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7476. // 验证失败
  7477. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7478. {
  7479. return actionResult;
  7480. }
  7481. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7482. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7483. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7484. {
  7485. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7486. actionResult.Status = (int)Constant.PDAResult.Success;
  7487. }
  7488. else
  7489. {
  7490. actionResult.Status = (int)Constant.PDAResult.Fail;
  7491. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7492. }
  7493. }
  7494. catch (Exception ex)
  7495. {
  7496. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7497. OutputLog.TraceLog(LogPriority.Error,
  7498. this.ToString(),
  7499. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7500. ex.ToString(),
  7501. LocalPath.LogExePath);
  7502. actionResult.Status = (int)Constant.PDAResult.Exception;
  7503. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7504. }
  7505. return actionResult;
  7506. }
  7507. /// <summary>
  7508. /// 获取回收标识
  7509. /// </summary>
  7510. /// <param name="accountCode"></param>
  7511. /// <param name="userCode"></param>
  7512. /// <param name="userPassword"></param>
  7513. /// <param name="sessionKey"></param>
  7514. /// <param name="usercode">工号编码</param>
  7515. /// <returns></returns>
  7516. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7517. {
  7518. ActionResult actionResult = new ActionResult();
  7519. try
  7520. {
  7521. // 验证请求头信息
  7522. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7523. // 验证失败
  7524. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7525. {
  7526. return actionResult;
  7527. }
  7528. int returnValue = ServiceInvoker.Invoke<int>(this,
  7529. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7530. actionResult.Result = JsonHelper.ToJson(returnValue);
  7531. actionResult.Status = (int)Constant.PDAResult.Success;
  7532. }
  7533. catch (Exception ex)
  7534. {
  7535. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7536. OutputLog.TraceLog(LogPriority.Error,
  7537. this.ToString(),
  7538. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7539. ex.ToString(),
  7540. LocalPath.LogExePath);
  7541. actionResult.Status = (int)Constant.PDAResult.Exception;
  7542. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7543. }
  7544. return actionResult;
  7545. }
  7546. #endregion
  7547. #region 注浆盘点
  7548. /// <summary>
  7549. /// 获取注浆盘点单列表
  7550. /// </summary>
  7551. /// <param name="sUserInfo"></param>
  7552. /// <returns></returns>
  7553. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7554. {
  7555. ActionResult actionResult = new ActionResult();
  7556. try
  7557. {
  7558. // 验证请求头信息
  7559. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7560. // 验证失败
  7561. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7562. {
  7563. return actionResult;
  7564. }
  7565. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7566. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7567. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7568. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7569. actionResult.Result = JsonHelper.ToJson(ds);
  7570. actionResult.Status = (int)Constant.PDAResult.Success;
  7571. }
  7572. catch (Exception ex)
  7573. {
  7574. string json = JsonHelper.ToJson(entity);
  7575. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7576. OutputLog.TraceLog(LogPriority.Error,
  7577. this.ToString(),
  7578. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7579. ex.ToString(),
  7580. LocalPath.LogExePath);
  7581. actionResult.Status = (int)Constant.PDAResult.Exception;
  7582. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7583. }
  7584. return actionResult;
  7585. }
  7586. /// <summary>
  7587. /// 进行盘点操作
  7588. /// </summary>
  7589. /// <param name="accountCode"></param>
  7590. /// <param name="userCode"></param>
  7591. /// <param name="userPassword"></param>
  7592. /// <param name="sessionKey"></param>
  7593. /// <param name="InCheckedID">盘点单ID</param>
  7594. /// <param name="BarCode">产品条码</param>
  7595. /// <returns></returns>
  7596. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7597. {
  7598. ActionResult actionResult = new ActionResult();
  7599. try
  7600. {
  7601. // 验证请求头信息
  7602. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7603. // 验证失败
  7604. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7605. {
  7606. return actionResult;
  7607. }
  7608. ClientRequestEntity cre = new ClientRequestEntity();
  7609. cre.Properties["CheckedID"] = CheckedID;
  7610. cre.Properties["Barcode"] = BarCode;
  7611. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7612. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7613. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7614. {
  7615. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7616. actionResult.Status = (int)Constant.PDAResult.Success;
  7617. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7618. }
  7619. else
  7620. {
  7621. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7622. actionResult.Status = (int)Constant.PDAResult.Fail;
  7623. actionResult.Message = returnValue.Message;
  7624. }
  7625. }
  7626. catch (Exception ex)
  7627. {
  7628. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7629. OutputLog.TraceLog(LogPriority.Error,
  7630. this.ToString(),
  7631. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7632. ex.ToString(),
  7633. LocalPath.LogExePath);
  7634. actionResult.Status = (int)Constant.PDAResult.Exception;
  7635. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7636. }
  7637. return actionResult;
  7638. }
  7639. /// <summary>
  7640. /// 获取盘点单明细
  7641. /// </summary>
  7642. /// <param name="sUserInfo"></param>
  7643. /// <returns></returns>
  7644. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7645. {
  7646. ActionResult actionResult = new ActionResult();
  7647. try
  7648. {
  7649. // 验证请求头信息
  7650. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7651. // 验证失败
  7652. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7653. {
  7654. return actionResult;
  7655. }
  7656. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7657. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  7658. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  7659. actionResult.Result = JsonHelper.ToJson(ds);
  7660. actionResult.Status = (int)Constant.PDAResult.Success;
  7661. }
  7662. catch (Exception ex)
  7663. {
  7664. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7665. OutputLog.TraceLog(LogPriority.Error,
  7666. this.ToString(),
  7667. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7668. ex.ToString(),
  7669. LocalPath.LogExePath);
  7670. actionResult.Status = (int)Constant.PDAResult.Exception;
  7671. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7672. }
  7673. return actionResult;
  7674. }
  7675. #endregion
  7676. #region 模具盘点
  7677. /// <summary>
  7678. /// 获取模具盘点单列表
  7679. /// </summary>
  7680. /// <param name="sUserInfo"></param>
  7681. /// <returns></returns>
  7682. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7683. {
  7684. ActionResult actionResult = new ActionResult();
  7685. try
  7686. {
  7687. // 验证请求头信息
  7688. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7689. // 验证失败
  7690. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7691. {
  7692. return actionResult;
  7693. }
  7694. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7695. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7696. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7697. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  7698. actionResult.Result = JsonHelper.ToJson(ds);
  7699. actionResult.Status = (int)Constant.PDAResult.Success;
  7700. }
  7701. catch (Exception ex)
  7702. {
  7703. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7704. OutputLog.TraceLog(LogPriority.Error,
  7705. this.ToString(),
  7706. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7707. ex.ToString(),
  7708. LocalPath.LogExePath);
  7709. actionResult.Status = (int)Constant.PDAResult.Exception;
  7710. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7711. }
  7712. return actionResult;
  7713. }
  7714. /// <summary>
  7715. /// 进行盘点操作
  7716. /// </summary>
  7717. /// <param name="accountCode"></param>
  7718. /// <param name="userCode"></param>
  7719. /// <param name="userPassword"></param>
  7720. /// <param name="sessionKey"></param>
  7721. /// <param name="InCheckedID">盘点单ID</param>
  7722. /// <param name="BarCode">产品条码</param>
  7723. /// <returns></returns>
  7724. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7725. {
  7726. ActionResult actionResult = new ActionResult();
  7727. try
  7728. {
  7729. // 验证请求头信息
  7730. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7731. // 验证失败
  7732. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7733. {
  7734. return actionResult;
  7735. }
  7736. ClientRequestEntity cre = new ClientRequestEntity();
  7737. cre.Properties["CheckedID"] = CheckedID;
  7738. cre.Properties["Barcode"] = BarCode;
  7739. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7740. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  7741. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7742. {
  7743. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7744. actionResult.Status = (int)Constant.PDAResult.Success;
  7745. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7746. }
  7747. else
  7748. {
  7749. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7750. actionResult.Status = (int)Constant.PDAResult.Fail;
  7751. actionResult.Message = returnValue.Message;
  7752. }
  7753. }
  7754. catch (Exception ex)
  7755. {
  7756. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7757. OutputLog.TraceLog(LogPriority.Error,
  7758. this.ToString(),
  7759. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7760. ex.ToString(),
  7761. LocalPath.LogExePath);
  7762. actionResult.Status = (int)Constant.PDAResult.Exception;
  7763. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7764. }
  7765. return actionResult;
  7766. }
  7767. /// <summary>
  7768. /// 获取盘点单明细
  7769. /// </summary>
  7770. /// <param name="sUserInfo"></param>
  7771. /// <returns></returns>
  7772. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7773. {
  7774. ActionResult actionResult = new ActionResult();
  7775. try
  7776. {
  7777. // 验证请求头信息
  7778. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7779. // 验证失败
  7780. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7781. {
  7782. return actionResult;
  7783. }
  7784. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7785. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  7786. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  7787. actionResult.Result = JsonHelper.ToJson(ds);
  7788. actionResult.Status = (int)Constant.PDAResult.Success;
  7789. }
  7790. catch (Exception ex)
  7791. {
  7792. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7793. OutputLog.TraceLog(LogPriority.Error,
  7794. this.ToString(),
  7795. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7796. ex.ToString(),
  7797. LocalPath.LogExePath);
  7798. actionResult.Status = (int)Constant.PDAResult.Exception;
  7799. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7800. }
  7801. return actionResult;
  7802. }
  7803. #endregion
  7804. #region 通用接口
  7805. /// <summary>
  7806. /// PDA调用通用接口
  7807. /// </summary>
  7808. /// <param name="accountCode"></param>
  7809. /// <param name="userCode"></param>
  7810. /// <param name="userPassword"></param>
  7811. /// <param name="sessionKey"></param>
  7812. /// <param name="module"></param>
  7813. /// <param name="action"></param>
  7814. /// <param name="data"></param>
  7815. /// <returns></returns>
  7816. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  7817. string module, string action, string jsonData)
  7818. {
  7819. ActionResult actionResult = null;
  7820. try
  7821. {
  7822. // 验证请求头信息
  7823. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7824. // 验证失败
  7825. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7826. {
  7827. return actionResult;
  7828. }
  7829. actionResult.Status = (int)Constant.PDAResult.Fail;
  7830. Dictionary<string, object> data = null;
  7831. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  7832. {
  7833. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  7834. }
  7835. #region PDA报表
  7836. if (module == "Report")
  7837. {
  7838. // 成型月度结算
  7839. if (action == "GetGroutingSettlementInfo")
  7840. {
  7841. DateTime month = DateTime.Now;
  7842. month = new DateTime(month.Year, month.Month, 1);
  7843. //month = new DateTime(2017, 6, 1);
  7844. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7845. if (currentMonth != 1)
  7846. {
  7847. month = month.AddMonths(-1);
  7848. }
  7849. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  7850. if (sre.Status == Constant.ServiceResultStatus.Success)
  7851. {
  7852. actionResult.Status = (int)Constant.PDAResult.Success;
  7853. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7854. }
  7855. else
  7856. {
  7857. actionResult.Status = (int)Constant.PDAResult.Fail;
  7858. actionResult.Message = sre.Message;
  7859. }
  7860. return actionResult;
  7861. }
  7862. // 成型月度结算-明细
  7863. if (action == "GetGroutingSettlementDetail")
  7864. {
  7865. DateTime month = DateTime.Now;
  7866. month = new DateTime(month.Year, month.Month, 1);
  7867. //month = new DateTime(2017, 6, 1);
  7868. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7869. if (currentMonth != 1)
  7870. {
  7871. month = month.AddMonths(-1);
  7872. }
  7873. string goodsCode = data["GoodsCode"].ToString();
  7874. string detailDate = data["DetailDate"].ToString();
  7875. DateTime? date = null;
  7876. if (detailDate != "合计")
  7877. {
  7878. date = DateTime.Parse(detailDate);
  7879. }
  7880. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  7881. if (sre.Status == Constant.ServiceResultStatus.Success)
  7882. {
  7883. actionResult.Status = (int)Constant.PDAResult.Success;
  7884. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7885. }
  7886. else
  7887. {
  7888. actionResult.Status = (int)Constant.PDAResult.Fail;
  7889. actionResult.Message = sre.Message;
  7890. }
  7891. return actionResult;
  7892. }
  7893. // 产成品交接汇总
  7894. if (action == "GetFinishedProductHandoverSum")
  7895. {
  7896. DateTime date = DateTime.Parse(data["date"].ToString());
  7897. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  7898. data["goodscode"] as string, sUserInfo);
  7899. if (sre.Status == Constant.ServiceResultStatus.Success)
  7900. {
  7901. actionResult.Status = (int)Constant.PDAResult.Success;
  7902. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7903. }
  7904. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  7905. {
  7906. actionResult.Status = (int)Constant.PDAResult.Success;
  7907. }
  7908. else
  7909. {
  7910. actionResult.Status = (int)Constant.PDAResult.Fail;
  7911. actionResult.Message = sre.Message;
  7912. }
  7913. return actionResult;
  7914. }
  7915. //xuwei add 2019-10-21
  7916. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  7917. if (action == "GetSemiReworkDayCount")
  7918. {
  7919. //不指定参数查询当天
  7920. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  7921. //dateStr = "2019-10-17";
  7922. //指定参数查询特定日期
  7923. if(data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  7924. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  7925. if (sre.Status == Constant.ServiceResultStatus.Success)
  7926. {
  7927. actionResult.Status = (int)Constant.PDAResult.Success;
  7928. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7929. }
  7930. else
  7931. {
  7932. actionResult.Status = (int)Constant.PDAResult.Fail;
  7933. actionResult.Message = sre.Message;
  7934. }
  7935. return actionResult;
  7936. }
  7937. //xuwe end
  7938. return actionResult;
  7939. }
  7940. #endregion
  7941. #region 模具管理
  7942. if (module == "PC_Mould")
  7943. {
  7944. #region 模具新建画面数据初始化
  7945. if (action == "GetMouldAddInit")
  7946. {
  7947. ClientRequestEntity cre = new ClientRequestEntity();
  7948. cre.Properties["MouldID"] = 0;
  7949. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  7950. if (sre.Status == Constant.ServiceResultStatus.Success)
  7951. {
  7952. actionResult.Status = (int)Constant.PDAResult.Success;
  7953. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7954. }
  7955. else
  7956. {
  7957. actionResult.Status = (int)Constant.PDAResult.Fail;
  7958. actionResult.Message = sre.Message;
  7959. }
  7960. return actionResult;
  7961. }
  7962. #endregion
  7963. #region 验证模具产品型号
  7964. if (action == "CheckGoodsCodeOnMould")
  7965. {
  7966. ClientRequestEntity cre = new ClientRequestEntity();
  7967. cre.Properties["GoodsCode"] = data["GoodsCode"];
  7968. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  7969. if (sre.Status == Constant.ServiceResultStatus.Success &&
  7970. sre.Data.Tables[0].Rows.Count > 0)
  7971. {
  7972. actionResult.Status = (int)Constant.PDAResult.Success;
  7973. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7974. }
  7975. else
  7976. {
  7977. actionResult.Status = (int)Constant.PDAResult.Fail;
  7978. actionResult.Message = "无效产品型号";
  7979. }
  7980. return actionResult;
  7981. }
  7982. #endregion
  7983. #region 验证模具生产工号
  7984. if (action == "CheckUserCodeOnMould")
  7985. {
  7986. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  7987. if (sre != null && sre.Rows.Count > 0)
  7988. {
  7989. actionResult.Status = (int)Constant.PDAResult.Success;
  7990. actionResult.Result = JsonHelper.ToJson(sre);
  7991. }
  7992. else
  7993. {
  7994. actionResult.Status = (int)Constant.PDAResult.Fail;
  7995. actionResult.Message = "无效生产工号";
  7996. }
  7997. return actionResult;
  7998. }
  7999. #endregion
  8000. #region 新建保存
  8001. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  8002. {
  8003. ClientRequestEntity cre = new ClientRequestEntity();
  8004. foreach (string item in data.Keys)
  8005. {
  8006. if (item == "ProductionDate")
  8007. {
  8008. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  8009. }
  8010. else
  8011. {
  8012. cre.Properties.Add(item, data[item]);
  8013. }
  8014. }
  8015. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  8016. if (sre.Status == Constant.ServiceResultStatus.Success)
  8017. {
  8018. actionResult.Status = (int)Constant.PDAResult.Success;
  8019. }
  8020. else
  8021. {
  8022. actionResult.Status = (int)Constant.PDAResult.Fail;
  8023. actionResult.Result = sre.OtherStatus;
  8024. actionResult.Message = sre.Message;
  8025. }
  8026. return actionResult;
  8027. }
  8028. #endregion
  8029. #region 模具编辑画面数据初始化
  8030. if (action == "GetMouldEditInfo")
  8031. {
  8032. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  8033. if (sre != null && sre.Rows.Count > 0)
  8034. {
  8035. actionResult.Status = (int)Constant.PDAResult.Success;
  8036. actionResult.Result = JsonHelper.ToJson(sre);
  8037. }
  8038. else
  8039. {
  8040. actionResult.Status = (int)Constant.PDAResult.Fail;
  8041. actionResult.Message = "无效模具条码";
  8042. }
  8043. return actionResult;
  8044. }
  8045. #endregion
  8046. #region 模具操作-画面初始化
  8047. if (action == "GetMouldOperationInit")
  8048. {
  8049. ClientRequestEntity cre = new ClientRequestEntity();
  8050. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8051. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8052. if (sre.Status == Constant.ServiceResultStatus.Success)
  8053. {
  8054. actionResult.Status = (int)Constant.PDAResult.Success;
  8055. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8056. }
  8057. else
  8058. {
  8059. actionResult.Status = (int)Constant.PDAResult.Fail;
  8060. actionResult.Result = sre.OtherStatus;
  8061. actionResult.Message = sre.Message;
  8062. }
  8063. return actionResult;
  8064. }
  8065. #endregion
  8066. #region 模具操作-验证模具条码
  8067. if (action == "CheckMouldBarcode")
  8068. {
  8069. ClientRequestEntity cre = new ClientRequestEntity();
  8070. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8071. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8072. if (sre.Status == Constant.ServiceResultStatus.Success)
  8073. {
  8074. if (sre.Data.Tables[0].Rows.Count == 0)
  8075. {
  8076. actionResult.Status = (int)Constant.PDAResult.Fail;
  8077. actionResult.Result = -1;
  8078. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8079. return actionResult;
  8080. }
  8081. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8082. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8083. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8084. #region 报损
  8085. if (mouldOperationType == 2)
  8086. {
  8087. if (mouldStatusID == 1 || mouldStatusID == 3)
  8088. {
  8089. actionResult.Status = (int)Constant.PDAResult.Success;
  8090. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8091. }
  8092. else
  8093. {
  8094. actionResult.Status = (int)Constant.PDAResult.Fail;
  8095. actionResult.Result = -2;
  8096. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8097. }
  8098. return actionResult;
  8099. }
  8100. #endregion
  8101. #region 撤销
  8102. if (mouldOperationType == 3)
  8103. {
  8104. if (mouldStatusID == 4)
  8105. {
  8106. actionResult.Status = (int)Constant.PDAResult.Success;
  8107. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8108. }
  8109. else
  8110. {
  8111. actionResult.Status = (int)Constant.PDAResult.Fail;
  8112. actionResult.Result = -2;
  8113. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  8114. }
  8115. return actionResult;
  8116. }
  8117. #endregion
  8118. #region 领用
  8119. if (mouldOperationType == 4)
  8120. {
  8121. if (mouldStatusID == 1)
  8122. {
  8123. actionResult.Status = (int)Constant.PDAResult.Success;
  8124. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8125. }
  8126. else
  8127. {
  8128. actionResult.Status = (int)Constant.PDAResult.Fail;
  8129. actionResult.Result = -2;
  8130. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  8131. }
  8132. return actionResult;
  8133. }
  8134. #endregion
  8135. #region 回收
  8136. if (mouldOperationType == 5)
  8137. {
  8138. if (mouldStatusID == 3)
  8139. {
  8140. actionResult.Status = (int)Constant.PDAResult.Success;
  8141. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8142. }
  8143. else
  8144. {
  8145. actionResult.Status = (int)Constant.PDAResult.Fail;
  8146. actionResult.Result = -2;
  8147. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  8148. }
  8149. return actionResult;
  8150. }
  8151. #endregion
  8152. #region 变更型号
  8153. if (mouldOperationType == -1)
  8154. {
  8155. if (mouldStatusID != 4)
  8156. {
  8157. actionResult.Status = (int)Constant.PDAResult.Success;
  8158. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8159. }
  8160. else
  8161. {
  8162. actionResult.Status = (int)Constant.PDAResult.Fail;
  8163. actionResult.Result = -2;
  8164. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  8165. }
  8166. return actionResult;
  8167. }
  8168. #endregion
  8169. #region 替换条码
  8170. if (mouldOperationType == -2)
  8171. {
  8172. actionResult.Status = (int)Constant.PDAResult.Success;
  8173. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8174. return actionResult;
  8175. }
  8176. #endregion
  8177. return actionResult;
  8178. }
  8179. }
  8180. #endregion
  8181. #region 模具操作-保存
  8182. if (action == "SetMouldOperation")
  8183. {
  8184. ClientRequestEntity cre = new ClientRequestEntity();
  8185. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8186. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8187. cre.Properties["Remarks"] = data["Remarks"];
  8188. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8189. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8190. {
  8191. cre.Properties["GoodsID"] = data["GoodsID"];
  8192. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8193. }
  8194. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8195. {
  8196. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8197. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8198. }
  8199. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8200. if (sre.Status == Constant.ServiceResultStatus.Success)
  8201. {
  8202. actionResult.Status = (int)Constant.PDAResult.Success;
  8203. }
  8204. else
  8205. {
  8206. actionResult.Status = (int)Constant.PDAResult.Fail;
  8207. }
  8208. return actionResult;
  8209. }
  8210. #endregion
  8211. #region 模具操作-替换条码
  8212. if (action == "ChangedMouldBarcode")
  8213. {
  8214. ClientRequestEntity cre = new ClientRequestEntity();
  8215. cre.Properties["MouldID"] = data["MouldID"];
  8216. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8217. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8218. cre.Properties["Remarks"] = data["Remarks"];
  8219. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8220. if (sre.Status == Constant.ServiceResultStatus.Success)
  8221. {
  8222. actionResult.Status = (int)Constant.PDAResult.Success;
  8223. }
  8224. else
  8225. {
  8226. actionResult.Status = (int)Constant.PDAResult.Fail;
  8227. actionResult.Result = sre.OtherStatus;
  8228. actionResult.Message = sre.Message;
  8229. }
  8230. return actionResult;
  8231. }
  8232. #endregion
  8233. #region 模具跟踪表
  8234. if (action == "GetMoldTracking")
  8235. {
  8236. ClientRequestEntity cre = new ClientRequestEntity();
  8237. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8238. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8239. if (sre.Status == Constant.ServiceResultStatus.Success)
  8240. {
  8241. actionResult.Status = (int)Constant.PDAResult.Success;
  8242. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8243. }
  8244. else
  8245. {
  8246. actionResult.Status = (int)Constant.PDAResult.Fail;
  8247. actionResult.Message = "此模具条码不存在";
  8248. }
  8249. return actionResult;
  8250. }
  8251. #endregion
  8252. return actionResult;
  8253. }
  8254. #endregion
  8255. #region 成型线模具管理
  8256. if (module == "PC_GroutingLineMould")
  8257. {
  8258. #region 获取当前用户成型线模具管理权限
  8259. if (action == "GetGMouldStatusRight")
  8260. {
  8261. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8262. actionResult.Status = (int)Constant.PDAResult.Success;
  8263. if (right != null && right.Rows.Count > 0)
  8264. {
  8265. actionResult.Result = JsonHelper.ToJson(right);
  8266. }
  8267. return actionResult;
  8268. }
  8269. #endregion
  8270. #region 获取成型线状态等信息,和成型模具信息
  8271. if (action == "GetGroutingLineMould")
  8272. {
  8273. int? groutingLineID = null;
  8274. string groutingLineCode = null;
  8275. if (data.ContainsKey("GroutingLineID"))
  8276. {
  8277. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8278. }
  8279. else
  8280. {
  8281. groutingLineCode = data["GroutingLineCode"] + "";
  8282. }
  8283. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8284. if (lineInfo == null)
  8285. {
  8286. actionResult.Status = (int)Constant.PDAResult.Fail;
  8287. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8288. }
  8289. else
  8290. {
  8291. actionResult.Status = (int)Constant.PDAResult.Success;
  8292. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8293. }
  8294. return actionResult;
  8295. }
  8296. #endregion
  8297. #region 模具操作-画面初始化
  8298. if (action == "GetMouldOperationInit")
  8299. {
  8300. ClientRequestEntity cre = new ClientRequestEntity();
  8301. cre.Properties["MouldOperationType"] = 2;
  8302. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8303. if (sre.Status == Constant.ServiceResultStatus.Success)
  8304. {
  8305. actionResult.Status = (int)Constant.PDAResult.Success;
  8306. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8307. }
  8308. else
  8309. {
  8310. actionResult.Status = (int)Constant.PDAResult.Fail;
  8311. actionResult.Result = sre.OtherStatus;
  8312. actionResult.Message = sre.Message;
  8313. }
  8314. return actionResult;
  8315. }
  8316. #endregion
  8317. #region 成型模具操作-画面初始化
  8318. if (action == "GetGroutingMouldOperationInit")
  8319. {
  8320. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8321. if (initData != null && initData.Rows.Count > 0)
  8322. {
  8323. actionResult.Status = (int)Constant.PDAResult.Success;
  8324. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8325. foreach (DataRow item in initData.Rows)
  8326. {
  8327. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8328. }
  8329. actionResult.Result = JsonHelper.ToJson(syssetting);
  8330. }
  8331. else
  8332. {
  8333. actionResult.Status = (int)Constant.PDAResult.Fail;
  8334. }
  8335. return actionResult;
  8336. }
  8337. #endregion
  8338. #region 模具操作-验证模具条码
  8339. if (action == "CheckMouldBarcode")
  8340. {
  8341. ClientRequestEntity cre = new ClientRequestEntity();
  8342. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8343. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8344. if (sre.Status == Constant.ServiceResultStatus.Success)
  8345. {
  8346. if (sre.Data.Tables[0].Rows.Count == 0)
  8347. {
  8348. actionResult.Status = (int)Constant.PDAResult.Fail;
  8349. actionResult.Result = -1;
  8350. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8351. return actionResult;
  8352. }
  8353. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8354. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8355. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8356. #region 上线
  8357. if (mouldOperationType == 6)
  8358. {
  8359. if (mouldStatusID == 1 || mouldStatusID == 3)
  8360. {
  8361. if (data.ContainsKey("GoodsID"))
  8362. {
  8363. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8364. {
  8365. actionResult.Status = (int)Constant.PDAResult.Fail;
  8366. actionResult.Result = -3;
  8367. actionResult.Message =
  8368. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8369. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8370. "】与当前不一致";
  8371. return actionResult;
  8372. }
  8373. }
  8374. actionResult.Status = (int)Constant.PDAResult.Success;
  8375. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8376. }
  8377. else
  8378. {
  8379. actionResult.Status = (int)Constant.PDAResult.Fail;
  8380. actionResult.Result = -2;
  8381. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8382. }
  8383. return actionResult;
  8384. }
  8385. #endregion
  8386. return actionResult;
  8387. }
  8388. }
  8389. #endregion
  8390. #region 停用
  8391. if (action == "StopGroutingLineDetail")
  8392. {
  8393. if (data == null || !data.ContainsKey("Details"))
  8394. {
  8395. actionResult.Status = (int)Constant.PDAResult.Fail;
  8396. actionResult.Message = "参数错误";
  8397. return actionResult;
  8398. }
  8399. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8400. DataTable gTable = new DataTable();
  8401. gTable.Columns.Add("GroutingLineID", typeof(int));
  8402. gTable.Columns.Add("GroutingLineCode");
  8403. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8404. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8405. gTable.Columns.Add("GroutingMouldCode");
  8406. gTable.Columns.Add("RecordRemarks");
  8407. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8408. gTable.Columns.Add("MouldID", typeof(int));
  8409. gTable.Columns.Add("MouldCode");
  8410. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8411. string groutingLineCode = data["GroutingLineCode"] + "";
  8412. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8413. foreach (Dictionary<string, object> item in details)
  8414. {
  8415. int? mouldID = null;
  8416. if (item.ContainsKey("MouldID"))
  8417. {
  8418. mouldID = Convert.ToInt32(item["MouldID"]);
  8419. if (mouldID == 0)
  8420. {
  8421. mouldID = null;
  8422. }
  8423. }
  8424. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8425. item["GLineDetailID"], item["GLineDetailCode"],
  8426. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8427. mouldID, item["MouldCode"]);
  8428. }
  8429. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8430. if (result > 0)
  8431. {
  8432. actionResult.Status = (int)Constant.PDAResult.Success;
  8433. }
  8434. else
  8435. {
  8436. actionResult.Status = (int)Constant.PDAResult.Fail;
  8437. actionResult.Result = result;
  8438. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8439. return actionResult;
  8440. }
  8441. return actionResult;
  8442. }
  8443. #endregion
  8444. #region 启用
  8445. if (action == "StartGroutingLineDetail")
  8446. {
  8447. if (data == null || !data.ContainsKey("Details"))
  8448. {
  8449. actionResult.Status = (int)Constant.PDAResult.Fail;
  8450. actionResult.Message = "参数错误";
  8451. return actionResult;
  8452. }
  8453. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8454. DataTable gTable = new DataTable();
  8455. gTable.Columns.Add("GroutingLineID", typeof(int));
  8456. gTable.Columns.Add("GroutingLineCode");
  8457. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8458. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8459. gTable.Columns.Add("GroutingMouldCode");
  8460. gTable.Columns.Add("RecordRemarks");
  8461. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8462. gTable.Columns.Add("MouldID", typeof(int));
  8463. gTable.Columns.Add("MouldCode");
  8464. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8465. string groutingLineCode = data["GroutingLineCode"] + "";
  8466. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8467. foreach (Dictionary<string, object> item in details)
  8468. {
  8469. int? mouldID = null;
  8470. if (item.ContainsKey("MouldID"))
  8471. {
  8472. mouldID = Convert.ToInt32(item["MouldID"]);
  8473. if (mouldID == 0)
  8474. {
  8475. mouldID = null;
  8476. }
  8477. }
  8478. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8479. item["GLineDetailID"], item["GLineDetailCode"],
  8480. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8481. mouldID, item["MouldCode"]);
  8482. }
  8483. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8484. if (result > 0)
  8485. {
  8486. actionResult.Status = (int)Constant.PDAResult.Success;
  8487. }
  8488. else
  8489. {
  8490. actionResult.Status = (int)Constant.PDAResult.Fail;
  8491. actionResult.Result = result;
  8492. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8493. return actionResult;
  8494. }
  8495. return actionResult;
  8496. }
  8497. #endregion
  8498. #region 维修
  8499. if (action == "RepairStartGroutingLineDetail")
  8500. {
  8501. if (data == null || !data.ContainsKey("Details"))
  8502. {
  8503. actionResult.Status = (int)Constant.PDAResult.Fail;
  8504. actionResult.Message = "参数错误";
  8505. return actionResult;
  8506. }
  8507. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8508. DataTable gTable = new DataTable();
  8509. gTable.Columns.Add("GroutingLineID", typeof(int));
  8510. gTable.Columns.Add("GroutingLineCode");
  8511. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8512. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8513. gTable.Columns.Add("GroutingMouldCode");
  8514. gTable.Columns.Add("RecordRemarks");
  8515. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8516. gTable.Columns.Add("MouldID", typeof(int));
  8517. gTable.Columns.Add("MouldCode");
  8518. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8519. string groutingLineCode = data["GroutingLineCode"] + "";
  8520. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8521. foreach (Dictionary<string, object> item in details)
  8522. {
  8523. int? mouldID = null;
  8524. if (item.ContainsKey("MouldID"))
  8525. {
  8526. mouldID = Convert.ToInt32(item["MouldID"]);
  8527. if (mouldID == 0)
  8528. {
  8529. mouldID = null;
  8530. }
  8531. }
  8532. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8533. item["GLineDetailID"], item["GLineDetailCode"],
  8534. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8535. mouldID, item["MouldCode"]);
  8536. }
  8537. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8538. if (result > 0)
  8539. {
  8540. actionResult.Status = (int)Constant.PDAResult.Success;
  8541. }
  8542. else
  8543. {
  8544. actionResult.Status = (int)Constant.PDAResult.Fail;
  8545. actionResult.Result = result;
  8546. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8547. return actionResult;
  8548. }
  8549. return actionResult;
  8550. }
  8551. #endregion
  8552. #region 结束维修
  8553. if (action == "RepairEndGroutingLineDetail")
  8554. {
  8555. if (data == null || !data.ContainsKey("Details"))
  8556. {
  8557. actionResult.Status = (int)Constant.PDAResult.Fail;
  8558. actionResult.Message = "参数错误";
  8559. return actionResult;
  8560. }
  8561. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8562. DataTable gTable = new DataTable();
  8563. gTable.Columns.Add("GroutingLineID", typeof(int));
  8564. gTable.Columns.Add("GroutingLineCode");
  8565. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8566. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8567. gTable.Columns.Add("GroutingMouldCode");
  8568. gTable.Columns.Add("RecordRemarks");
  8569. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8570. gTable.Columns.Add("MouldID", typeof(int));
  8571. gTable.Columns.Add("MouldCode");
  8572. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8573. string groutingLineCode = data["GroutingLineCode"] + "";
  8574. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8575. foreach (Dictionary<string, object> item in details)
  8576. {
  8577. int? mouldID = null;
  8578. if (item.ContainsKey("MouldID"))
  8579. {
  8580. mouldID = Convert.ToInt32(item["MouldID"]);
  8581. if (mouldID == 0)
  8582. {
  8583. mouldID = null;
  8584. }
  8585. }
  8586. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8587. item["GLineDetailID"], item["GLineDetailCode"],
  8588. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8589. mouldID, item["MouldCode"]);
  8590. }
  8591. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8592. if (result > 0)
  8593. {
  8594. actionResult.Status = (int)Constant.PDAResult.Success;
  8595. }
  8596. else
  8597. {
  8598. actionResult.Status = (int)Constant.PDAResult.Fail;
  8599. actionResult.Result = result;
  8600. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8601. return actionResult;
  8602. }
  8603. return actionResult;
  8604. }
  8605. #endregion
  8606. #region 换模
  8607. if (action == "ChangeGMouldStartGroutingLineDetail")
  8608. {
  8609. if (data == null || !data.ContainsKey("Details"))
  8610. {
  8611. actionResult.Status = (int)Constant.PDAResult.Fail;
  8612. actionResult.Message = "参数错误";
  8613. return actionResult;
  8614. }
  8615. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8616. DataTable gTable = new DataTable();
  8617. gTable.Columns.Add("GroutingLineID", typeof(int));
  8618. gTable.Columns.Add("GroutingLineCode");
  8619. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8620. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8621. gTable.Columns.Add("GroutingMouldCode");
  8622. gTable.Columns.Add("RecordRemarks");
  8623. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8624. gTable.Columns.Add("MouldID", typeof(int));
  8625. gTable.Columns.Add("MouldCode");
  8626. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8627. gTable.Columns.Add("MouldStatus", typeof(int));
  8628. gTable.Columns.Add("ScrapReason", typeof(int));
  8629. gTable.Columns.Add("ScrapResponsibility");
  8630. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8631. string groutingLineCode = data["GroutingLineCode"] + "";
  8632. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8633. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8634. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8635. string scrapResponsibility = data["ScrapRemarks"] + "";
  8636. foreach (Dictionary<string, object> item in details)
  8637. {
  8638. int? mouldID = null;
  8639. if (item.ContainsKey("MouldID"))
  8640. {
  8641. mouldID = Convert.ToInt32(item["MouldID"]);
  8642. if (mouldID == 0)
  8643. {
  8644. mouldID = null;
  8645. }
  8646. }
  8647. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8648. item["GLineDetailID"], item["GLineDetailCode"],
  8649. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8650. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8651. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8652. }
  8653. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  8654. if (result > 0)
  8655. {
  8656. actionResult.Status = (int)Constant.PDAResult.Success;
  8657. }
  8658. else
  8659. {
  8660. actionResult.Status = (int)Constant.PDAResult.Fail;
  8661. actionResult.Result = result;
  8662. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8663. return actionResult;
  8664. }
  8665. return actionResult;
  8666. }
  8667. #endregion
  8668. #region 变产
  8669. if (action == "UpdateLineStartGroutingLineDetail")
  8670. {
  8671. if (data == null || !data.ContainsKey("Details"))
  8672. {
  8673. actionResult.Status = (int)Constant.PDAResult.Fail;
  8674. actionResult.Message = "参数错误";
  8675. return actionResult;
  8676. }
  8677. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8678. DataTable gTable = new DataTable();
  8679. gTable.Columns.Add("GroutingLineID", typeof(int));
  8680. gTable.Columns.Add("GroutingLineCode");
  8681. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8682. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8683. gTable.Columns.Add("GroutingMouldCode");
  8684. gTable.Columns.Add("RecordRemarks");
  8685. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8686. gTable.Columns.Add("MouldID", typeof(int));
  8687. gTable.Columns.Add("MouldCode");
  8688. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8689. gTable.Columns.Add("MouldStatus", typeof(int));
  8690. gTable.Columns.Add("ScrapReason", typeof(int));
  8691. gTable.Columns.Add("ScrapResponsibility");
  8692. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8693. string groutingLineCode = data["GroutingLineCode"] + "";
  8694. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8695. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8696. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8697. string scrapResponsibility = data["ScrapRemarks"] + "";
  8698. foreach (Dictionary<string, object> item in details)
  8699. {
  8700. int? mouldID = null;
  8701. if (item.ContainsKey("MouldID"))
  8702. {
  8703. mouldID = Convert.ToInt32(item["MouldID"]);
  8704. if (mouldID == 0)
  8705. {
  8706. mouldID = null;
  8707. }
  8708. }
  8709. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8710. item["GLineDetailID"], item["GLineDetailCode"],
  8711. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8712. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8713. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8714. }
  8715. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  8716. if (result > 0)
  8717. {
  8718. actionResult.Status = (int)Constant.PDAResult.Success;
  8719. }
  8720. else
  8721. {
  8722. actionResult.Status = (int)Constant.PDAResult.Fail;
  8723. actionResult.Result = result;
  8724. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8725. return actionResult;
  8726. }
  8727. return actionResult;
  8728. }
  8729. #endregion
  8730. #region 整线变产
  8731. if (action == "UpdateAllLineStartGroutingLineDetail")
  8732. {
  8733. if (data == null || !data.ContainsKey("Details"))
  8734. {
  8735. actionResult.Status = (int)Constant.PDAResult.Fail;
  8736. actionResult.Message = "参数错误";
  8737. return actionResult;
  8738. }
  8739. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8740. DataTable gTable = new DataTable();
  8741. gTable.Columns.Add("GroutingLineID", typeof(int));
  8742. gTable.Columns.Add("GroutingLineCode");
  8743. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8744. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8745. gTable.Columns.Add("GroutingMouldCode");
  8746. gTable.Columns.Add("RecordRemarks");
  8747. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8748. gTable.Columns.Add("MouldID", typeof(int));
  8749. gTable.Columns.Add("MouldCode");
  8750. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8751. gTable.Columns.Add("MouldStatus", typeof(int));
  8752. gTable.Columns.Add("ScrapReason", typeof(int));
  8753. gTable.Columns.Add("ScrapResponsibility");
  8754. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8755. string groutingLineCode = data["GroutingLineCode"] + "";
  8756. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8757. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8758. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8759. string scrapResponsibility = data["ScrapRemarks"] + "";
  8760. foreach (Dictionary<string, object> item in details)
  8761. {
  8762. int? mouldID = null;
  8763. if (item.ContainsKey("MouldID"))
  8764. {
  8765. mouldID = Convert.ToInt32(item["MouldID"]);
  8766. if (mouldID == 0)
  8767. {
  8768. mouldID = null;
  8769. }
  8770. }
  8771. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8772. item["GLineDetailID"], item["GLineDetailCode"],
  8773. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8774. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8775. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8776. }
  8777. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  8778. if (result > 0)
  8779. {
  8780. actionResult.Status = (int)Constant.PDAResult.Success;
  8781. }
  8782. else
  8783. {
  8784. actionResult.Status = (int)Constant.PDAResult.Fail;
  8785. actionResult.Result = result;
  8786. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8787. return actionResult;
  8788. }
  8789. return actionResult;
  8790. }
  8791. #endregion
  8792. #region 卸模
  8793. if (action == "UnloadGroutingLineDetail")
  8794. {
  8795. if (data == null || !data.ContainsKey("Details"))
  8796. {
  8797. actionResult.Status = (int)Constant.PDAResult.Fail;
  8798. actionResult.Message = "参数错误";
  8799. return actionResult;
  8800. }
  8801. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8802. DataTable gTable = new DataTable();
  8803. gTable.Columns.Add("GroutingLineID", typeof(int));
  8804. gTable.Columns.Add("GroutingLineCode");
  8805. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8806. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8807. gTable.Columns.Add("GroutingMouldCode");
  8808. gTable.Columns.Add("RecordRemarks");
  8809. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8810. gTable.Columns.Add("MouldID", typeof(int));
  8811. gTable.Columns.Add("MouldCode");
  8812. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8813. gTable.Columns.Add("MouldStatus", typeof(int));
  8814. gTable.Columns.Add("ScrapReason", typeof(int));
  8815. gTable.Columns.Add("ScrapResponsibility");
  8816. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8817. string groutingLineCode = data["GroutingLineCode"] + "";
  8818. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8819. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8820. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8821. string scrapResponsibility = data["ScrapRemarks"] + "";
  8822. foreach (Dictionary<string, object> item in details)
  8823. {
  8824. int? mouldID = null;
  8825. if (item.ContainsKey("MouldID"))
  8826. {
  8827. mouldID = Convert.ToInt32(item["MouldID"]);
  8828. if (mouldID == 0)
  8829. {
  8830. mouldID = null;
  8831. }
  8832. }
  8833. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8834. item["GLineDetailID"], item["GLineDetailCode"],
  8835. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8836. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8837. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8838. }
  8839. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  8840. if (result > 0)
  8841. {
  8842. actionResult.Status = (int)Constant.PDAResult.Success;
  8843. }
  8844. else
  8845. {
  8846. actionResult.Status = (int)Constant.PDAResult.Fail;
  8847. actionResult.Result = result;
  8848. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8849. return actionResult;
  8850. }
  8851. return actionResult;
  8852. }
  8853. #endregion
  8854. #region 结束换模
  8855. if (action == "ChangeGMouldEndGroutingLineDetail")
  8856. {
  8857. if (data == null || !data.ContainsKey("Details"))
  8858. {
  8859. actionResult.Status = (int)Constant.PDAResult.Fail;
  8860. actionResult.Message = "参数错误";
  8861. return actionResult;
  8862. }
  8863. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8864. DataTable gTable = new DataTable();
  8865. gTable.Columns.Add("GroutingLineID", typeof(int));
  8866. gTable.Columns.Add("GroutingLineCode");
  8867. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8868. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8869. gTable.Columns.Add("GroutingMouldCode");
  8870. gTable.Columns.Add("RreasonRemarks");
  8871. gTable.Columns.Add("RecordRemarks");
  8872. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8873. gTable.Columns.Add("MouldID", typeof(int));
  8874. gTable.Columns.Add("MouldCode");
  8875. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8876. gTable.Columns.Add("GoodsID", typeof(int));
  8877. gTable.Columns.Add("GoodsCode");
  8878. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8879. gTable.Columns.Add("GroutingCount", typeof(int));
  8880. gTable.Columns.Add("MouldSource");
  8881. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8882. string groutingLineCode = data["GroutingLineCode"] + "";
  8883. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8884. foreach (Dictionary<string, object> item in details)
  8885. {
  8886. int? mouldID = null;
  8887. if (item.ContainsKey("MouldID"))
  8888. {
  8889. mouldID = Convert.ToInt32(item["MouldID"]);
  8890. if (mouldID == 0)
  8891. {
  8892. mouldID = null;
  8893. }
  8894. }
  8895. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8896. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8897. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8898. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8899. item["GoodsID"], item["GoodsCode"],
  8900. item["StandardGroutingCount"], item["GroutingCount"],
  8901. (mouldID == null ? "0" : "1"));
  8902. }
  8903. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  8904. if (result.Status == Constant.ServiceResultStatus.Success)
  8905. {
  8906. actionResult.Status = (int)Constant.PDAResult.Success;
  8907. }
  8908. else if (result.OtherStatus == -100)
  8909. {
  8910. actionResult.Status = (int)Constant.PDAResult.Fail;
  8911. actionResult.Result = -100;
  8912. actionResult.Message = result.Message;
  8913. return actionResult;
  8914. }
  8915. else
  8916. {
  8917. actionResult.Status = (int)Constant.PDAResult.Fail;
  8918. actionResult.Result = -500;
  8919. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8920. return actionResult;
  8921. }
  8922. return actionResult;
  8923. }
  8924. #endregion
  8925. #region 结束变产
  8926. if (action == "UpdateLineEndGroutingLineDetail")
  8927. {
  8928. if (data == null || !data.ContainsKey("Details"))
  8929. {
  8930. actionResult.Status = (int)Constant.PDAResult.Fail;
  8931. actionResult.Message = "参数错误";
  8932. return actionResult;
  8933. }
  8934. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8935. DataTable gTable = new DataTable();
  8936. gTable.Columns.Add("GroutingLineID", typeof(int));
  8937. gTable.Columns.Add("GroutingLineCode");
  8938. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8939. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8940. gTable.Columns.Add("GroutingMouldCode");
  8941. gTable.Columns.Add("RreasonRemarks");
  8942. gTable.Columns.Add("RecordRemarks");
  8943. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8944. gTable.Columns.Add("MouldID", typeof(int));
  8945. gTable.Columns.Add("MouldCode");
  8946. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8947. gTable.Columns.Add("GoodsID", typeof(int));
  8948. gTable.Columns.Add("GoodsCode");
  8949. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8950. gTable.Columns.Add("GroutingCount", typeof(int));
  8951. gTable.Columns.Add("MouldSource");
  8952. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8953. string groutingLineCode = data["GroutingLineCode"] + "";
  8954. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8955. foreach (Dictionary<string, object> item in details)
  8956. {
  8957. int? mouldID = null;
  8958. if (item.ContainsKey("MouldID"))
  8959. {
  8960. mouldID = Convert.ToInt32(item["MouldID"]);
  8961. if (mouldID == 0)
  8962. {
  8963. mouldID = null;
  8964. }
  8965. }
  8966. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8967. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8968. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8969. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8970. item["GoodsID"], item["GoodsCode"],
  8971. item["StandardGroutingCount"], item["GroutingCount"],
  8972. (mouldID == null ? "0" : "1"));
  8973. }
  8974. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  8975. if (result.Status == Constant.ServiceResultStatus.Success)
  8976. {
  8977. actionResult.Status = (int)Constant.PDAResult.Success;
  8978. }
  8979. else if (result.OtherStatus == -100)
  8980. {
  8981. actionResult.Status = (int)Constant.PDAResult.Fail;
  8982. actionResult.Result = -100;
  8983. actionResult.Message = result.Message;
  8984. return actionResult;
  8985. }
  8986. else
  8987. {
  8988. actionResult.Status = (int)Constant.PDAResult.Fail;
  8989. actionResult.Result = -500;
  8990. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8991. return actionResult;
  8992. }
  8993. return actionResult;
  8994. }
  8995. #endregion
  8996. #region 结束整线变产
  8997. if (action == "UpdateAllLineEndGroutingLineDetail")
  8998. {
  8999. if (data == null || !data.ContainsKey("Details"))
  9000. {
  9001. actionResult.Status = (int)Constant.PDAResult.Fail;
  9002. actionResult.Message = "参数错误";
  9003. return actionResult;
  9004. }
  9005. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9006. DataTable gTable = new DataTable();
  9007. gTable.Columns.Add("GroutingLineID", typeof(int));
  9008. gTable.Columns.Add("GroutingLineCode");
  9009. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9010. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9011. gTable.Columns.Add("GroutingMouldCode");
  9012. gTable.Columns.Add("Remarks");
  9013. gTable.Columns.Add("RecordRemarks");
  9014. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9015. gTable.Columns.Add("MouldID", typeof(int));
  9016. gTable.Columns.Add("MouldCode");
  9017. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9018. gTable.Columns.Add("GoodsID", typeof(int));
  9019. gTable.Columns.Add("GoodsCode");
  9020. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9021. gTable.Columns.Add("GroutingCount", typeof(int));
  9022. gTable.Columns.Add("MouldSource");
  9023. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9024. string groutingLineCode = data["GroutingLineCode"] + "";
  9025. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9026. foreach (Dictionary<string, object> item in details)
  9027. {
  9028. int? mouldID = null;
  9029. if (item.ContainsKey("MouldID"))
  9030. {
  9031. mouldID = Convert.ToInt32(item["MouldID"]);
  9032. if (mouldID == 0)
  9033. {
  9034. mouldID = null;
  9035. }
  9036. }
  9037. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9038. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9039. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  9040. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9041. item["GoodsID"], item["GoodsCode"],
  9042. item["StandardGroutingCount"], item["GroutingCount"],
  9043. (mouldID == null ? "0" : "1"));
  9044. }
  9045. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  9046. if (result.Status == Constant.ServiceResultStatus.Success)
  9047. {
  9048. actionResult.Status = (int)Constant.PDAResult.Success;
  9049. }
  9050. else if (result.OtherStatus == -100)
  9051. {
  9052. actionResult.Status = (int)Constant.PDAResult.Fail;
  9053. actionResult.Result = -100;
  9054. actionResult.Message = result.Message;
  9055. return actionResult;
  9056. }
  9057. else
  9058. {
  9059. actionResult.Status = (int)Constant.PDAResult.Fail;
  9060. actionResult.Result = -500;
  9061. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9062. return actionResult;
  9063. }
  9064. return actionResult;
  9065. }
  9066. #endregion
  9067. #region 上模
  9068. if (action == "UpdateGroutingLine_AddMould")
  9069. {
  9070. if (data == null || !data.ContainsKey("Details"))
  9071. {
  9072. actionResult.Status = (int)Constant.PDAResult.Fail;
  9073. actionResult.Message = "参数错误";
  9074. return actionResult;
  9075. }
  9076. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9077. DataTable gTable = new DataTable();
  9078. gTable.Columns.Add("GroutingLineID", typeof(int));
  9079. gTable.Columns.Add("GroutingLineCode");
  9080. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9081. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9082. gTable.Columns.Add("GroutingMouldCode");
  9083. gTable.Columns.Add("Remarks");
  9084. gTable.Columns.Add("RecordRemarks");
  9085. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9086. gTable.Columns.Add("MouldID", typeof(int));
  9087. gTable.Columns.Add("MouldCode");
  9088. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9089. gTable.Columns.Add("GoodsID", typeof(int));
  9090. gTable.Columns.Add("GoodsCode");
  9091. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9092. gTable.Columns.Add("GroutingCount", typeof(int));
  9093. gTable.Columns.Add("MouldSource");
  9094. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9095. string groutingLineCode = data["GroutingLineCode"] + "";
  9096. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9097. foreach (Dictionary<string, object> item in details)
  9098. {
  9099. int? mouldID = null;
  9100. if (item.ContainsKey("MouldID"))
  9101. {
  9102. mouldID = Convert.ToInt32(item["MouldID"]);
  9103. if (mouldID == 0)
  9104. {
  9105. mouldID = null;
  9106. }
  9107. }
  9108. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  9109. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9110. gldID, item["GLineDetailCode"],
  9111. item["DetailRemarks"], item["RecordRemarks"],
  9112. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  9113. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9114. item["GoodsID"], item["GoodsCode"],
  9115. item["StandardGroutingCount"], item["GroutingCount"],
  9116. (mouldID == null ? "0" : "1"));
  9117. }
  9118. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  9119. if (result.Status == Constant.ServiceResultStatus.Success)
  9120. {
  9121. actionResult.Status = (int)Constant.PDAResult.Success;
  9122. }
  9123. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  9124. {
  9125. actionResult.Status = (int)Constant.PDAResult.Fail;
  9126. actionResult.Result = result.OtherStatus;
  9127. actionResult.Message = result.Message;
  9128. return actionResult;
  9129. }
  9130. else
  9131. {
  9132. actionResult.Status = (int)Constant.PDAResult.Fail;
  9133. actionResult.Result = -500;
  9134. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9135. return actionResult;
  9136. }
  9137. return actionResult;
  9138. }
  9139. #endregion
  9140. return actionResult;
  9141. }
  9142. #endregion
  9143. #region 包装装板限制
  9144. if (module == "FinishedLoadingCar")
  9145. {
  9146. if (action == "GetSetting")
  9147. {
  9148. ClientRequestEntity cre = new ClientRequestEntity();
  9149. cre.Properties["GoodsID"] = data["GoodsID"];
  9150. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9151. if (sre.Status == Constant.ServiceResultStatus.Success)
  9152. {
  9153. actionResult.Status = (int)Constant.PDAResult.Success;
  9154. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9155. {
  9156. if (item["settingcode"].ToString() == "S_PM_011")
  9157. {
  9158. cre.Properties["S_PM_011"] = item["settingvalue"];
  9159. }
  9160. else if (item["settingcode"].ToString() == "S_PM_012")
  9161. {
  9162. cre.Properties["S_PM_012"] = item["settingvalue"];
  9163. }
  9164. else if (item["settingcode"].ToString() == "S_PM_013")
  9165. {
  9166. cre.Properties["S_PM_013"] = item["settingvalue"];
  9167. }
  9168. }
  9169. cre.Properties["PlatelitNum"] = sre.Result;
  9170. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9171. }
  9172. else
  9173. {
  9174. actionResult.Status = (int)Constant.PDAResult.Fail;
  9175. actionResult.Message = "";
  9176. }
  9177. return actionResult;
  9178. }
  9179. }
  9180. #endregion
  9181. #region 成型报损
  9182. if (module == "GroutingScrapProduct")
  9183. {
  9184. // 查询注浆日报明细表
  9185. if ("GetGroutingDailyDetail" == action)
  9186. {
  9187. ClientRequestEntity cre = new ClientRequestEntity();
  9188. cre.NameSpace = module;
  9189. cre.Name = action;
  9190. if (!string.IsNullOrEmpty(jsonData))
  9191. {
  9192. cre.Properties["BarCode"] = data["BarCode"];
  9193. }
  9194. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9195. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9196. actionResult.Status = (int)Constant.PDAResult.Success;
  9197. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9198. || sre.Data.Tables[0].Rows.Count == 0)
  9199. {
  9200. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9201. actionResult.Status = (int)Constant.PDAResult.Fail;
  9202. }
  9203. else
  9204. {
  9205. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9206. // 判断是否进行了注浆
  9207. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9208. {
  9209. actionResult.Message = "该产品还未进行注浆!";
  9210. actionResult.Status = (int)Constant.PDAResult.Fail;
  9211. }
  9212. // 判断是否进行了交坯
  9213. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9214. {
  9215. actionResult.Message = "该产品已经交坯!";
  9216. actionResult.Status = (int)Constant.PDAResult.Fail;
  9217. }
  9218. // 判断是否已经报损
  9219. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9220. {
  9221. actionResult.Message = "该产品已经报损!";
  9222. actionResult.Status = (int)Constant.PDAResult.Fail;
  9223. }
  9224. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9225. }
  9226. }
  9227. // 获取成型报损原因
  9228. else if ("GetScrapReasonData" == action)
  9229. {
  9230. ClientRequestEntity cre = new ClientRequestEntity();
  9231. cre.NameSpace = module;
  9232. cre.Name = action;
  9233. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo);
  9234. actionResult.Status = (int)Constant.PDAResult.Success;
  9235. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9236. }
  9237. // 保存成型报损
  9238. else if ("SaveGroutingScrapProduct" == action)
  9239. {
  9240. ClientRequestEntity cre = new ClientRequestEntity();
  9241. cre.NameSpace = module;
  9242. cre.Name = action;
  9243. if (!string.IsNullOrEmpty(jsonData))
  9244. {
  9245. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9246. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9247. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9248. if (dt != null && dt.Rows.Count > 0)
  9249. {
  9250. // 总单信息
  9251. DataRow properties = dt.Rows[0];
  9252. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9253. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9254. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9255. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9256. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9257. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9258. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9259. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9260. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9261. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9262. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9263. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9264. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9265. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9266. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9267. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9268. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9269. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9270. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9271. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9272. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9273. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9274. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9275. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9276. // 责任员工
  9277. cre.Data = new DataSet();
  9278. //DataTable returnTable = returnData.Tables[1].Copy();
  9279. cre.Data.Tables.Add(dtResponsible);
  9280. }
  9281. }
  9282. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9283. if (sre.Status == Constant.ServiceResultStatus.Success)
  9284. {
  9285. actionResult.Status = (int)Constant.PDAResult.Success;
  9286. actionResult.Result = sre.Result;
  9287. }
  9288. else
  9289. {
  9290. actionResult.Status = (int)Constant.PDAResult.Fail;
  9291. actionResult.Result = sre.OtherStatus;
  9292. actionResult.Message = sre.Message;
  9293. }
  9294. }
  9295. // 获取成型报损信息 用于撤销使用
  9296. else if ("GetGroutingScrapProduct" == action)
  9297. {
  9298. ClientRequestEntity cre = new ClientRequestEntity();
  9299. cre.NameSpace = module;
  9300. cre.Name = action;
  9301. if (!string.IsNullOrEmpty(jsonData))
  9302. {
  9303. cre.Properties["BarCode"] = data["BarCode"];
  9304. }
  9305. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9306. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9307. actionResult.Status = (int)Constant.PDAResult.Success;
  9308. }
  9309. //xuwei add 2020-03-23
  9310. //获取成型报损信息 用于撤销使用 支持 浆日报直接报损
  9311. else if ("GetGroutingScrap" == action)
  9312. {
  9313. ClientRequestEntity cre = new ClientRequestEntity();
  9314. cre.NameSpace = module;
  9315. cre.Name = action;
  9316. if (!string.IsNullOrEmpty(jsonData))
  9317. {
  9318. cre.Properties["BarCode"] = data["BarCode"];
  9319. }
  9320. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrap(cre, sUserInfo);
  9321. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9322. actionResult.Status = (int)Constant.PDAResult.Success;
  9323. }
  9324. // 撤销成型报损
  9325. else if ("ReverseGroutingScrapProduct" == action)
  9326. {
  9327. ClientRequestEntity cre = new ClientRequestEntity();
  9328. cre.NameSpace = module;
  9329. cre.Name = action;
  9330. if (!string.IsNullOrEmpty(jsonData))
  9331. {
  9332. cre.Properties["BarCode"] = data["BarCode"];
  9333. }
  9334. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9335. if (sre.Status == Constant.ServiceResultStatus.Success)
  9336. {
  9337. actionResult.Status = (int)Constant.PDAResult.Success;
  9338. actionResult.Result = sre.Result;
  9339. }
  9340. else
  9341. {
  9342. actionResult.Status = (int)Constant.PDAResult.Fail;
  9343. actionResult.Result = sre.OtherStatus;
  9344. actionResult.Message = sre.Message;
  9345. }
  9346. }
  9347. }
  9348. #endregion
  9349. #region 产品挂起
  9350. if (module == "ProductSuspend")
  9351. {
  9352. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9353. if (action == "GetSuspendProcedure")
  9354. {
  9355. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9356. if (sre.Status == Constant.ServiceResultStatus.Success)
  9357. {
  9358. actionResult.Status = (int)Constant.PDAResult.Success;
  9359. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9360. }
  9361. else
  9362. {
  9363. actionResult.Status = (int)Constant.PDAResult.Fail;
  9364. actionResult.Message = sre.Message;
  9365. }
  9366. return actionResult;
  9367. }
  9368. // 验证挂起条码
  9369. if (action == "CheckSuspendBarcode")
  9370. {
  9371. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9372. if (sre.Status == Constant.ServiceResultStatus.Success)
  9373. {
  9374. actionResult.Status = (int)Constant.PDAResult.Success;
  9375. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9376. }
  9377. else
  9378. {
  9379. actionResult.Status = (int)Constant.PDAResult.Fail;
  9380. actionResult.Message = sre.Message;
  9381. }
  9382. return actionResult;
  9383. }
  9384. // 挂起条码
  9385. if (action == "SaveSuspendProduct")
  9386. {
  9387. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9388. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9389. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9390. if (sre.Status == Constant.ServiceResultStatus.Success)
  9391. {
  9392. actionResult.Status = (int)Constant.PDAResult.Success;
  9393. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9394. }
  9395. else
  9396. {
  9397. actionResult.Status = (int)Constant.PDAResult.Fail;
  9398. actionResult.Message = sre.Message;
  9399. }
  9400. return actionResult;
  9401. }
  9402. // 撤销挂起条码
  9403. if (action == "DeleteSuspendProduct")
  9404. {
  9405. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9406. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9407. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9408. if (sre.Status == Constant.ServiceResultStatus.Success)
  9409. {
  9410. actionResult.Status = (int)Constant.PDAResult.Success;
  9411. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9412. }
  9413. else
  9414. {
  9415. actionResult.Status = (int)Constant.PDAResult.Fail;
  9416. actionResult.Message = sre.Message;
  9417. }
  9418. return actionResult;
  9419. }
  9420. // 查询挂起条码
  9421. if (action == "GetSuspendProduct")
  9422. {
  9423. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9424. if (sre.Status == Constant.ServiceResultStatus.Success)
  9425. {
  9426. if (sre.Data.Tables[0].Rows.Count == 0)
  9427. {
  9428. actionResult.Status = (int)Constant.PDAResult.Fail;
  9429. actionResult.Message = "此条码没有可撤销的挂起信息";
  9430. }
  9431. else
  9432. {
  9433. actionResult.Status = (int)Constant.PDAResult.Success;
  9434. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9435. }
  9436. }
  9437. else
  9438. {
  9439. actionResult.Status = (int)Constant.PDAResult.Fail;
  9440. actionResult.Message = sre.Message;
  9441. }
  9442. return actionResult;
  9443. }
  9444. }
  9445. #endregion
  9446. #region 品保抽查
  9447. if (module == "QASpotCheck")
  9448. {
  9449. if (action == "GetAllQASpotCheck")
  9450. {
  9451. ClientRequestEntity cre = new ClientRequestEntity();
  9452. cre.NameSpace = module;
  9453. cre.Name = action;
  9454. if (data != null && data.Count > 0)
  9455. {
  9456. foreach (string item in data.Keys)
  9457. {
  9458. if (item.StartsWith("checktime"))
  9459. {
  9460. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9461. }
  9462. else
  9463. {
  9464. cre.Properties.Add(item, data[item]);
  9465. }
  9466. }
  9467. }
  9468. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9469. if (sre.Status == Constant.ServiceResultStatus.Success)
  9470. {
  9471. actionResult.Status = (int)Constant.PDAResult.Success;
  9472. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9473. }
  9474. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9475. {
  9476. actionResult.Status = (int)Constant.PDAResult.Success;
  9477. }
  9478. else
  9479. {
  9480. actionResult.Status = (int)Constant.PDAResult.Fail;
  9481. actionResult.Message = sre.Message;
  9482. }
  9483. return actionResult;
  9484. }
  9485. if (action == "AutoSaveQASpotCheck")
  9486. {
  9487. string barcode = data["barcode"] + "";
  9488. string remarks = data["remarks"] + "";
  9489. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9490. if (sre.Status == Constant.ServiceResultStatus.Success)
  9491. {
  9492. actionResult.Status = (int)Constant.PDAResult.Success;
  9493. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9494. }
  9495. else
  9496. {
  9497. actionResult.Status = (int)Constant.PDAResult.Fail;
  9498. actionResult.Message = sre.Message;
  9499. }
  9500. return actionResult;
  9501. }
  9502. if (action == "CheckQASpotCheck")
  9503. {
  9504. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9505. if (sre.Status == Constant.ServiceResultStatus.Success)
  9506. {
  9507. actionResult.Status = (int)Constant.PDAResult.Success;
  9508. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9509. }
  9510. else
  9511. {
  9512. actionResult.Status = (int)Constant.PDAResult.Fail;
  9513. actionResult.Message = sre.Message;
  9514. }
  9515. return actionResult;
  9516. }
  9517. if (action == "SaveQASpotCheck")
  9518. {
  9519. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9520. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9521. if (sre.Status == Constant.ServiceResultStatus.Success)
  9522. {
  9523. actionResult.Status = (int)Constant.PDAResult.Success;
  9524. }
  9525. else
  9526. {
  9527. actionResult.Status = (int)Constant.PDAResult.Fail;
  9528. actionResult.Message = sre.Message;
  9529. }
  9530. return actionResult;
  9531. }
  9532. return null;
  9533. }
  9534. #endregion
  9535. #region 产成品交接
  9536. if (module == "FinishedProduct")
  9537. {
  9538. // 设定商标
  9539. if (action == "GetFinishedBarcode")
  9540. {
  9541. string barcode = data["barcode"].ToString();
  9542. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  9543. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9544. if (Convert.ToInt32(resultEntity.Result) < 0)
  9545. {
  9546. actionResult.Status = (int)Constant.PDAResult.Fail;
  9547. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9548. actionResult.Message = resultEntity.Message;
  9549. }
  9550. else
  9551. {
  9552. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9553. actionResult.Status = (int)Constant.PDAResult.Success;
  9554. actionResult.Message = resultEntity.Message;
  9555. }
  9556. return actionResult;
  9557. }
  9558. if (action == "GetHandoveredBarcode")
  9559. {
  9560. string barcode = data["barcode"].ToString();
  9561. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  9562. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9563. if (Convert.ToInt32(resultEntity.Result) < 0)
  9564. {
  9565. actionResult.Status = (int)Constant.PDAResult.Fail;
  9566. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9567. actionResult.Message = resultEntity.Message;
  9568. }
  9569. else
  9570. {
  9571. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9572. actionResult.Status = (int)Constant.PDAResult.Success;
  9573. actionResult.Message = resultEntity.Message;
  9574. }
  9575. return actionResult;
  9576. }
  9577. if (action == "SetFinishedLogo")
  9578. {
  9579. int logoid = Convert.ToInt32(data["logoid"]);
  9580. string[] barcodes = data["barcodes"].ToString().Split(',');
  9581. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo);
  9582. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9583. if (result < 0)
  9584. {
  9585. actionResult.Status = (int)Constant.PDAResult.Fail;
  9586. }
  9587. else
  9588. {
  9589. actionResult.Status = (int)Constant.PDAResult.Success;
  9590. }
  9591. return actionResult;
  9592. }
  9593. if (action == "SetHandoveredOrder")
  9594. {
  9595. int orderID = Convert.ToInt32(data["orderID"]);
  9596. string[] barcodes = data["barcodes"].ToString().Split(',');
  9597. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  9598. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9599. if (result < 0)
  9600. {
  9601. actionResult.Status = (int)Constant.PDAResult.Fail;
  9602. }
  9603. else
  9604. {
  9605. actionResult.Status = (int)Constant.PDAResult.Success;
  9606. }
  9607. return actionResult;
  9608. }
  9609. }
  9610. #endregion
  9611. #region 产成品装车
  9612. /*
  9613. if (module == "FinishedLoading")
  9614. {
  9615. // 设定商标
  9616. if (action == "GetMaxLoadingNo")
  9617. {
  9618. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  9619. actionResult.Status = (int)Constant.PDAResult.Success;
  9620. actionResult.Result = no;
  9621. return actionResult;
  9622. }
  9623. if (action == "CheckFinishedLaodingBarcode")
  9624. {
  9625. string barcode = data["barcode"].ToString();
  9626. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  9627. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  9628. {
  9629. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9630. actionResult.Status = (int)Constant.PDAResult.Success;
  9631. actionResult.Message = resultEntity.Message;
  9632. }
  9633. else
  9634. {
  9635. actionResult.Status = (int)Constant.PDAResult.Fail;
  9636. actionResult.Result = resultEntity.OtherStatus;
  9637. actionResult.Message = resultEntity.Message;
  9638. }
  9639. return actionResult;
  9640. }
  9641. if (action == "SaveFinishedLoading")
  9642. {
  9643. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  9644. string carLicense = data["carLicense"] + "";
  9645. int palletNum = Convert.ToInt32(data["palletNum"]);
  9646. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  9647. string remarks = data["remarks"] + "";
  9648. Dictionary<string, object>[] details =
  9649. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  9650. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  9651. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  9652. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  9653. if (result.Status == Constant.ServiceResultStatus.Success)
  9654. {
  9655. actionResult.Status = (int)Constant.PDAResult.Success;
  9656. actionResult.Message = result.Message;
  9657. }
  9658. else
  9659. {
  9660. actionResult.Status = (int)Constant.PDAResult.Fail;
  9661. actionResult.Result = result.OtherStatus;
  9662. actionResult.Message = result.Message;
  9663. }
  9664. return actionResult;
  9665. }
  9666. }
  9667. */
  9668. #endregion
  9669. #region 产成品质量改判
  9670. if (module == "FinishedProductTamper")
  9671. {
  9672. // 获取产成品信息及缺陷数据
  9673. if (action == "GetDefectData")
  9674. {
  9675. string barcode = data["barcode"].ToString();
  9676. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  9677. if (sre.Status == Constant.ServiceResultStatus.Success)
  9678. {
  9679. actionResult.Status = (int)Constant.PDAResult.Success;
  9680. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9681. actionResult.Message = sre.Message;
  9682. }
  9683. else
  9684. {
  9685. actionResult.Status = (int)Constant.PDAResult.Fail;
  9686. actionResult.Result = sre.OtherStatus;
  9687. actionResult.Message = sre.Message;
  9688. }
  9689. return actionResult;
  9690. }
  9691. // 获取产成品信息及缺陷数据
  9692. if (action == "SaveDefectData")
  9693. {
  9694. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  9695. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  9696. if (sre.Status == Constant.ServiceResultStatus.Success)
  9697. {
  9698. actionResult.Status = (int)Constant.PDAResult.Success;
  9699. actionResult.Message = sre.Message;
  9700. }
  9701. else
  9702. {
  9703. actionResult.Status = (int)Constant.PDAResult.Fail;
  9704. actionResult.Message = sre.Message;
  9705. }
  9706. return actionResult;
  9707. }
  9708. // 通过条码查出责任工序(成品改判用)
  9709. if (action == "GetDutyProcedureByBarCodeForTamper")
  9710. {
  9711. string barcode = data["barcode"] + "";
  9712. int defectid = int.Parse(data["defectid"] + "");
  9713. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  9714. if (sre.Status == Constant.ServiceResultStatus.Success)
  9715. {
  9716. actionResult.Status = (int)Constant.PDAResult.Success;
  9717. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9718. actionResult.Message = sre.Message;
  9719. }
  9720. else
  9721. {
  9722. actionResult.Status = (int)Constant.PDAResult.Fail;
  9723. actionResult.Result = sre.OtherStatus;
  9724. actionResult.Message = sre.Message;
  9725. }
  9726. return actionResult;
  9727. }
  9728. }
  9729. #endregion
  9730. #region PDA独立功能
  9731. #region 水效标识
  9732. if (module == "WaterEffect")
  9733. {
  9734. // 获取产成品信息及水效标识
  9735. if (action == "GetGoodsByBarCode")
  9736. {
  9737. string barcode = data["barcode"].ToString();
  9738. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  9739. if (sre.Status == Constant.ServiceResultStatus.Success)
  9740. {
  9741. actionResult.Status = (int)Constant.PDAResult.Success;
  9742. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9743. actionResult.Message = sre.Message;
  9744. }
  9745. else
  9746. {
  9747. actionResult.Status = (int)Constant.PDAResult.Fail;
  9748. actionResult.Result = sre.OtherStatus;
  9749. actionResult.Message = sre.Message;
  9750. }
  9751. return actionResult;
  9752. }
  9753. }
  9754. #endregion
  9755. #region 盖板型号
  9756. if (module == "SeatCoverType")
  9757. {
  9758. // 获取产成品信息及水效标识
  9759. if (action == "SendGoodsCodeToPLC")
  9760. {
  9761. string barcode = data["barcode"].ToString();
  9762. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  9763. if (sre == 0)
  9764. {
  9765. actionResult.Status = (int)Constant.PDAResult.Success;
  9766. }
  9767. else
  9768. {
  9769. actionResult.Status = (int)Constant.PDAResult.Fail;
  9770. actionResult.Result = sre;
  9771. switch (sre)
  9772. {
  9773. case 1:
  9774. case 2:
  9775. actionResult.Message = "无效条码";
  9776. break;
  9777. case 3:
  9778. actionResult.Message = "此产品型号没有设置盖板标识码";
  9779. break;
  9780. case 4:
  9781. actionResult.Message = "当前用户没有设置PLC参数";
  9782. break;
  9783. case 5:
  9784. actionResult.Message = "PLC参数设置不全";
  9785. break;
  9786. default:
  9787. actionResult.Message = "PLC通信异常";
  9788. break;
  9789. }
  9790. }
  9791. return actionResult;
  9792. }
  9793. }
  9794. #endregion
  9795. #region PDA PLC 相关功能
  9796. if (module == "PDA_FUN_PLC")
  9797. {
  9798. // PDA扫码发送到PLCServer
  9799. if (action == "SendBarcodeToPLCServer")
  9800. {
  9801. string barcode = data["barcode"].ToString();
  9802. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  9803. if (sre == 0)
  9804. {
  9805. actionResult.Status = (int)Constant.PDAResult.Success;
  9806. }
  9807. else
  9808. {
  9809. actionResult.Status = (int)Constant.PDAResult.Fail;
  9810. actionResult.Result = sre;
  9811. switch (sre)
  9812. {
  9813. case 1:
  9814. case 2:
  9815. actionResult.Message = "无效条码";
  9816. break;
  9817. case 3:
  9818. actionResult.Message = "PLC通信异常";
  9819. break;
  9820. case 4:
  9821. actionResult.Message = "当前用户没有设置PLC参数";
  9822. break;
  9823. case 5:
  9824. actionResult.Message = "PLC参数设置不全";
  9825. break;
  9826. default:
  9827. actionResult.Message = "PLC通信异常";
  9828. break;
  9829. }
  9830. }
  9831. return actionResult;
  9832. }
  9833. }
  9834. #endregion
  9835. #endregion
  9836. #region 半检返修
  9837. if (module == "SemiRework")
  9838. {
  9839. // 验证半检返修条码
  9840. if (action == "CheckSemiReworkBarcode")
  9841. {
  9842. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9843. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  9844. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9845. if (Convert.ToInt32(resultEntity.Result) < 0)
  9846. {
  9847. actionResult.Status = (int)Constant.PDAResult.Fail;
  9848. }
  9849. else
  9850. {
  9851. actionResult.Status = (int)Constant.PDAResult.Success;
  9852. }
  9853. actionResult.Message = resultEntity.Message;
  9854. return actionResult;
  9855. }
  9856. // 可以返修的工序
  9857. if (action == "GetSemiReworkProcedure")
  9858. {
  9859. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9860. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  9861. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9862. actionResult.Status = (int)Constant.PDAResult.Success;
  9863. return actionResult;
  9864. }
  9865. // 根据条码获取经过的工序,用于责任工序
  9866. if (action == "GetSemiReworkPassProcedure")
  9867. {
  9868. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9869. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  9870. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9871. actionResult.Status = (int)Constant.PDAResult.Success;
  9872. return actionResult;
  9873. }
  9874. // 根据所选生产工序(生产数据ID)查询责任员工
  9875. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  9876. {
  9877. int productionDataID = Convert.ToInt32(jsonData);
  9878. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9879. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  9880. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9881. actionResult.Status = (int)Constant.PDAResult.Success;
  9882. return actionResult;
  9883. }
  9884. // 根据所选工号,查出缺陷责任员工
  9885. if (action == "GetSemiReworkDefectStaffByUserID")
  9886. {
  9887. int userID = Convert.ToInt32(jsonData);
  9888. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9889. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  9890. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9891. actionResult.Status = (int)Constant.PDAResult.Success;
  9892. return actionResult;
  9893. }
  9894. // 新建半检返修
  9895. if (action == "AddSemiRework")
  9896. {
  9897. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"]+"");
  9898. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9899. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  9900. actionResult.Result = resultEntity.Result;
  9901. actionResult.Message = resultEntity.Message;
  9902. if (Convert.ToInt32(resultEntity.Result) > 0)
  9903. {
  9904. actionResult.Status = (int)Constant.PDAResult.Success;
  9905. }
  9906. else
  9907. {
  9908. actionResult.Status = (int)Constant.PDAResult.Fail;
  9909. }
  9910. return actionResult;
  9911. }
  9912. // 编辑半检返修
  9913. if (action == "EditSemiRework")
  9914. {
  9915. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9916. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9917. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  9918. actionResult.Result = resultEntity.Result;
  9919. actionResult.Message = resultEntity.Message;
  9920. if (Convert.ToInt32(resultEntity.Result) > 0)
  9921. {
  9922. actionResult.Status = (int)Constant.PDAResult.Success;
  9923. }
  9924. else
  9925. {
  9926. actionResult.Status = (int)Constant.PDAResult.Fail;
  9927. }
  9928. return actionResult;
  9929. }
  9930. // 撤销半检返修
  9931. if (action == "CancelSemiRework")
  9932. {
  9933. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9934. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9935. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  9936. actionResult.Result = resultEntity.Result;
  9937. actionResult.Message = resultEntity.Message;
  9938. if (Convert.ToInt32(resultEntity.Result) > 0)
  9939. {
  9940. actionResult.Status = (int)Constant.PDAResult.Success;
  9941. }
  9942. else
  9943. {
  9944. actionResult.Status = (int)Constant.PDAResult.Fail;
  9945. }
  9946. return actionResult;
  9947. }
  9948. // 获取半检返修数据(PDA编辑用)
  9949. if (action == "GetSemiReworkByID")
  9950. {
  9951. int id = Convert.ToInt32(jsonData);
  9952. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9953. PMModuleLogic.GetSemiReworkByID(id,sUserInfo.UserCode);
  9954. DataTable data1 = resultEntity.Data.Tables[0];
  9955. DataTable data2 = resultEntity.Data.Tables[1];
  9956. DataTable data3 = resultEntity.Data.Tables[2];
  9957. if (data1.Rows.Count == 0)
  9958. {
  9959. actionResult.Status = (int)Constant.PDAResult.Fail;
  9960. actionResult.Message = "半检返修信息不存在";
  9961. return actionResult;
  9962. }
  9963. SemiReworkEntity srEntity = new SemiReworkEntity();
  9964. srEntity.SemiReworkID = id;
  9965. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  9966. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  9967. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  9968. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  9969. foreach (DataRow row2 in data2.Rows)
  9970. {
  9971. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  9972. srEntity.SemiReworkDefects.Add(defectEntity);
  9973. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  9974. defectEntity.SemiReworkID = id;
  9975. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  9976. defectEntity.DefectCode = row2["DefectCode"] + "";
  9977. defectEntity.DefectName = row2["DefectName"] + "";
  9978. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  9979. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  9980. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  9981. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  9982. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  9983. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  9984. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  9985. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  9986. defectEntity.Remarks = row2["Remarks"] + "";
  9987. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  9988. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  9989. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  9990. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  9991. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  9992. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  9993. if (row3s.Length == 0)
  9994. {
  9995. continue;
  9996. }
  9997. foreach (DataRow row3 in row3s)
  9998. {
  9999. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  10000. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  10001. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  10002. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  10003. semiReworkRPS.StaffName = row3["StaffName"] + "";
  10004. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  10005. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  10006. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  10007. semiReworkRPS.UserCode = row3["UserCode"] + "";
  10008. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  10009. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  10010. }
  10011. }
  10012. //xuwei note 总单用于显示,信息较全
  10013. actionResult.Message = JsonHelper.ToJson(data1);
  10014. //xuwei note 总单信息不全,但有明细,用于回传保存
  10015. actionResult.Result = JsonHelper.ToJson(srEntity);
  10016. actionResult.Status = (int)Constant.PDAResult.Success;
  10017. }
  10018. }
  10019. #endregion
  10020. #region 窑车漏扫补件
  10021. if (module == "F_PM_0504")
  10022. {
  10023. // 验证窑车编码是否存在
  10024. if (action == "CheckKilnCar")
  10025. {
  10026. ClientRequestEntity cre = new ClientRequestEntity();
  10027. cre.Properties["kilncarcode"] = data["KilnCarCode"];
  10028. cre.Properties["procedureID"] = data["ProcedureID"];
  10029. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo);
  10030. if (sre.Status == Constant.ServiceResultStatus.Success)
  10031. {
  10032. actionResult.Status = (int)Constant.PDAResult.Success;
  10033. actionResult.Result = sre.Result;
  10034. }
  10035. else
  10036. {
  10037. actionResult.Status = (int)Constant.PDAResult.Fail;
  10038. actionResult.Message = sre.Message;
  10039. }
  10040. return actionResult;
  10041. }
  10042. // 验证窑车烧成批次号是否存在 和 是否能补漏扫
  10043. if (action == "CheckKilnCarBatchNo")
  10044. {
  10045. ClientRequestEntity cre = new ClientRequestEntity();
  10046. cre.Properties["KilnID"] = data["KilnID"];
  10047. cre.Properties["KilnCarID"] = data["KilnCarID"];
  10048. cre.Properties["ProcedureID"] = data["ProcedureID"];
  10049. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10050. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo);
  10051. if (sre.Status == Constant.ServiceResultStatus.Success)
  10052. {
  10053. actionResult.Status = (int)Constant.PDAResult.Success;
  10054. }
  10055. else
  10056. {
  10057. actionResult.Status = (int)Constant.PDAResult.Fail;
  10058. actionResult.Message = sre.Message;
  10059. }
  10060. return actionResult;
  10061. }
  10062. // 窑车漏扫补件
  10063. if (action == "SetKilnCarMissing")
  10064. {
  10065. ClientRequestEntity cre = new ClientRequestEntity();
  10066. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10067. string carData = data["CarData"] + "";
  10068. DataTable dataTable = JsonHelper.FromJson<DataTable>(carData);
  10069. cre.Data = new DataSet();
  10070. cre.Data.Tables.Add(dataTable);
  10071. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo);
  10072. if (sre.Status == Constant.ServiceResultStatus.Success)
  10073. {
  10074. actionResult.Status = (int)Constant.PDAResult.Success;
  10075. }
  10076. else
  10077. {
  10078. actionResult.Status = (int)Constant.PDAResult.Fail;
  10079. actionResult.Message = sre.Message;
  10080. }
  10081. return actionResult;
  10082. }
  10083. }
  10084. #endregion
  10085. return actionResult;
  10086. }
  10087. catch (Exception ex)
  10088. {
  10089. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  10090. OutputLog.TraceLog(LogPriority.Error,
  10091. this.ToString(),
  10092. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  10093. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  10094. " module:" + module + " action:" + action + " json:" + jsonData,
  10095. ex.ToString(),
  10096. LocalPath.LogExePath);
  10097. actionResult.Status = (int)Constant.PDAResult.Exception;
  10098. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  10099. }
  10100. return actionResult;
  10101. }
  10102. #endregion
  10103. }
  10104. }