PDAModuleService.cs 390 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037
  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 GetFP00002_1Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4600. int rptSProcedureID, string workcode, string date, string goodscode)
  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. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4613. () => PDAModuleLogic.GetFP00002_1Data(sUserInfo, rptSProcedureID, workcode,
  4614. Convert.ToDateTime(date), goodscode));
  4615. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4616. {
  4617. actionResult.Status = (int)Constant.PDAResult.Fail;
  4618. actionResult.Message = Messages.MSG_CMN_I002;
  4619. }
  4620. else
  4621. {
  4622. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4623. actionResult.Status = (int)Constant.PDAResult.Success;
  4624. }
  4625. }
  4626. catch (Exception ex)
  4627. {
  4628. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4629. OutputLog.TraceLog(LogPriority.Error,
  4630. this.ToString(),
  4631. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4632. ex.ToString(),
  4633. LocalPath.LogExePath);
  4634. actionResult.Status = (int)Constant.PDAResult.Exception;
  4635. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4636. }
  4637. return actionResult;
  4638. }
  4639. /// <summary>
  4640. /// 半检数据统计表
  4641. /// </summary>
  4642. /// <param name="accountCode"></param>
  4643. /// <param name="userCode"></param>
  4644. /// <param name="userPassword"></param>
  4645. /// <param name="sessionKey"></param>
  4646. /// <param name="se"></param>
  4647. /// <returns></returns>
  4648. public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4649. string workcode, string datebegin, string dateend)
  4650. {
  4651. ActionResult actionResult = new ActionResult();
  4652. try
  4653. {
  4654. // 验证请求头信息
  4655. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4656. // 验证失败
  4657. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4658. {
  4659. return actionResult;
  4660. }
  4661. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4662. DateTime datetimeend = Convert.ToDateTime(dateend);
  4663. datetimebegin = datetimebegin.Date;
  4664. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4665. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4666. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4667. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4668. {
  4669. actionResult.Status = (int)Constant.PDAResult.Fail;
  4670. actionResult.Message = Messages.MSG_CMN_I002;
  4671. }
  4672. else
  4673. {
  4674. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4675. actionResult.Status = (int)Constant.PDAResult.Success;
  4676. }
  4677. }
  4678. catch (Exception ex)
  4679. {
  4680. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4681. OutputLog.TraceLog(LogPriority.Error,
  4682. this.ToString(),
  4683. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4684. ex.ToString(),
  4685. LocalPath.LogExePath);
  4686. actionResult.Status = (int)Constant.PDAResult.Exception;
  4687. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4688. }
  4689. return actionResult;
  4690. }
  4691. /// <summary>
  4692. /// 工号质量统计表
  4693. /// </summary>
  4694. /// <param name="accountCode"></param>
  4695. /// <param name="userCode"></param>
  4696. /// <param name="userPassword"></param>
  4697. /// <param name="sessionKey"></param>
  4698. /// <param name="se"></param>
  4699. /// <returns></returns>
  4700. public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4701. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4702. {
  4703. ActionResult actionResult = new ActionResult();
  4704. try
  4705. {
  4706. // 验证请求头信息
  4707. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4708. // 验证失败
  4709. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4710. {
  4711. return actionResult;
  4712. }
  4713. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4714. DateTime datetimeend = Convert.ToDateTime(dateend);
  4715. datetimebegin = datetimebegin.Date;
  4716. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4717. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4718. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4719. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4720. {
  4721. actionResult.Status = (int)Constant.PDAResult.Fail;
  4722. actionResult.Message = Messages.MSG_CMN_I002;
  4723. }
  4724. else
  4725. {
  4726. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4727. actionResult.Status = (int)Constant.PDAResult.Success;
  4728. }
  4729. }
  4730. catch (Exception ex)
  4731. {
  4732. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4733. OutputLog.TraceLog(LogPriority.Error,
  4734. this.ToString(),
  4735. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4736. ex.ToString(),
  4737. LocalPath.LogExePath);
  4738. actionResult.Status = (int)Constant.PDAResult.Exception;
  4739. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4740. }
  4741. return actionResult;
  4742. }
  4743. /// <summary>
  4744. /// 损坯数据统计表
  4745. /// </summary>
  4746. /// <param name="accountCode"></param>
  4747. /// <param name="userCode"></param>
  4748. /// <param name="userPassword"></param>
  4749. /// <param name="sessionKey"></param>
  4750. /// <param name="se"></param>
  4751. /// <returns></returns>
  4752. public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4753. string workcode, string datebegin, string dateend)
  4754. {
  4755. ActionResult actionResult = new ActionResult();
  4756. try
  4757. {
  4758. // 验证请求头信息
  4759. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4760. // 验证失败
  4761. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4762. {
  4763. return actionResult;
  4764. }
  4765. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4766. DateTime datetimeend = Convert.ToDateTime(dateend);
  4767. datetimebegin = datetimebegin.Date;
  4768. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4769. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4770. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4771. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4772. {
  4773. actionResult.Status = (int)Constant.PDAResult.Fail;
  4774. actionResult.Message = Messages.MSG_CMN_I002;
  4775. }
  4776. else
  4777. {
  4778. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4779. actionResult.Status = (int)Constant.PDAResult.Success;
  4780. }
  4781. }
  4782. catch (Exception ex)
  4783. {
  4784. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4785. OutputLog.TraceLog(LogPriority.Error,
  4786. this.ToString(),
  4787. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4788. ex.ToString(),
  4789. LocalPath.LogExePath);
  4790. actionResult.Status = (int)Constant.PDAResult.Exception;
  4791. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4792. }
  4793. return actionResult;
  4794. }
  4795. #endregion
  4796. /// <summary>
  4797. /// 取得报表数据源数据
  4798. /// </summary>
  4799. /// <param name="accountCode"></param>
  4800. /// <param name="userCode"></param>
  4801. /// <param name="userPassword"></param>
  4802. /// <param name="sessionKey"></param>
  4803. /// <returns></returns>
  4804. public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
  4805. {
  4806. ActionResult actionResult = new ActionResult();
  4807. try
  4808. {
  4809. // 验证请求头信息
  4810. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4811. // 验证失败
  4812. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4813. {
  4814. return actionResult;
  4815. }
  4816. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4817. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4818. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4819. {
  4820. actionResult.Status = (int)Constant.PDAResult.Fail;
  4821. actionResult.Message = Messages.MSG_CMN_I002;
  4822. }
  4823. else
  4824. {
  4825. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4826. actionResult.Status = (int)Constant.PDAResult.Success;
  4827. }
  4828. }
  4829. catch (Exception ex)
  4830. {
  4831. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4832. OutputLog.TraceLog(LogPriority.Error,
  4833. this.ToString(),
  4834. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4835. ex.ToString(),
  4836. LocalPath.LogExePath);
  4837. actionResult.Status = (int)Constant.PDAResult.Exception;
  4838. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4839. }
  4840. return actionResult;
  4841. }
  4842. /// <summary>
  4843. /// 取得报表的查询数据源统计工序数据
  4844. /// </summary>
  4845. /// <param name="accountCode"></param>
  4846. /// <param name="userCode"></param>
  4847. /// <param name="userPassword"></param>
  4848. /// <param name="sessionKey"></param>
  4849. /// <param name="RptProcedureID"></param>
  4850. /// <returns></returns>
  4851. public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  4852. {
  4853. ActionResult actionResult = new ActionResult();
  4854. try
  4855. {
  4856. // 验证请求头信息
  4857. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4858. // 验证失败
  4859. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4860. {
  4861. return actionResult;
  4862. }
  4863. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4864. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  4865. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4866. {
  4867. actionResult.Status = (int)Constant.PDAResult.Fail;
  4868. actionResult.Message = Messages.MSG_CMN_I002;
  4869. }
  4870. else
  4871. {
  4872. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4873. actionResult.Status = (int)Constant.PDAResult.Success;
  4874. }
  4875. }
  4876. catch (Exception ex)
  4877. {
  4878. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4879. OutputLog.TraceLog(LogPriority.Error,
  4880. this.ToString(),
  4881. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4882. ex.ToString(),
  4883. LocalPath.LogExePath);
  4884. actionResult.Status = (int)Constant.PDAResult.Exception;
  4885. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4886. }
  4887. return actionResult;
  4888. }
  4889. /// <summary>
  4890. /// 获取用户是否有统计产成品权限
  4891. /// </summary>
  4892. /// <param name="accountCode"></param>
  4893. /// <param name="userCode"></param>
  4894. /// <param name="userPassword"></param>
  4895. /// <param name="sessionKey"></param>
  4896. /// <returns></returns>
  4897. public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4898. {
  4899. ActionResult actionResult = new ActionResult();
  4900. try
  4901. {
  4902. // 验证请求头信息
  4903. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4904. // 验证失败
  4905. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4906. {
  4907. return actionResult;
  4908. }
  4909. int returnValue = ServiceInvoker.Invoke<int>(this,
  4910. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  4911. actionResult.Result = JsonHelper.ToJson(returnValue);
  4912. actionResult.Status = (int)Constant.PDAResult.Success;
  4913. }
  4914. catch (Exception ex)
  4915. {
  4916. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4917. OutputLog.TraceLog(LogPriority.Error,
  4918. this.ToString(),
  4919. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4920. ex.ToString(),
  4921. LocalPath.LogExePath);
  4922. actionResult.Status = (int)Constant.PDAResult.Exception;
  4923. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4924. }
  4925. return actionResult;
  4926. }
  4927. /// <summary>
  4928. /// 获取用户是否有盘点权限
  4929. /// </summary>
  4930. /// <param name="accountCode"></param>
  4931. /// <param name="userCode"></param>
  4932. /// <param name="userPassword"></param>
  4933. /// <param name="sessionKey"></param>
  4934. /// <returns></returns>
  4935. public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4936. {
  4937. ActionResult actionResult = new ActionResult();
  4938. try
  4939. {
  4940. // 验证请求头信息
  4941. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4942. // 验证失败
  4943. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4944. {
  4945. return actionResult;
  4946. }
  4947. int returnValue = ServiceInvoker.Invoke<int>(this,
  4948. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  4949. actionResult.Result = JsonHelper.ToJson(returnValue);
  4950. actionResult.Status = (int)Constant.PDAResult.Success;
  4951. }
  4952. catch (Exception ex)
  4953. {
  4954. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4955. OutputLog.TraceLog(LogPriority.Error,
  4956. this.ToString(),
  4957. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4958. ex.ToString(),
  4959. LocalPath.LogExePath);
  4960. actionResult.Status = (int)Constant.PDAResult.Exception;
  4961. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4962. }
  4963. return actionResult;
  4964. }
  4965. /// <summary>
  4966. /// 根据条件查询是否存在班次配置
  4967. /// </summary>
  4968. /// <param name="accountCode"></param>
  4969. /// <param name="userCode"></param>
  4970. /// <param name="userPassword"></param>
  4971. /// <param name="sessionKey"></param>
  4972. /// <param name="userCode">工号编码</param>
  4973. /// <returns></returns>
  4974. public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  4975. {
  4976. ActionResult actionResult = new ActionResult();
  4977. try
  4978. {
  4979. // 验证请求头信息
  4980. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4981. // 验证失败
  4982. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4983. {
  4984. return actionResult;
  4985. }
  4986. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4987. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  4988. actionResult.Result = JsonHelper.ToJson(ds);
  4989. actionResult.Status = (int)Constant.PDAResult.Success;
  4990. }
  4991. catch (Exception ex)
  4992. {
  4993. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4994. OutputLog.TraceLog(LogPriority.Error,
  4995. this.ToString(),
  4996. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4997. ex.ToString(),
  4998. LocalPath.LogExePath);
  4999. actionResult.Status = (int)Constant.PDAResult.Exception;
  5000. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5001. }
  5002. return actionResult;
  5003. }
  5004. /// <summary>
  5005. /// 报损工序查出工号根据生产数据ID
  5006. /// </summary>
  5007. /// <param name="accountCode"></param>
  5008. /// <param name="userCode"></param>
  5009. /// <param name="userPassword"></param>
  5010. /// <param name="sessionKey"></param>
  5011. /// <param name="ProductionDataID">生产数据ID</param>
  5012. /// <returns></returns>
  5013. public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  5014. {
  5015. ActionResult actionResult = new ActionResult();
  5016. try
  5017. {
  5018. // 验证请求头信息
  5019. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5020. // 验证失败
  5021. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5022. {
  5023. return actionResult;
  5024. }
  5025. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5026. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  5027. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5028. {
  5029. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5030. actionResult.Status = (int)Constant.PDAResult.Success;
  5031. }
  5032. else
  5033. {
  5034. actionResult.Status = (int)Constant.PDAResult.Fail;
  5035. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5036. }
  5037. }
  5038. catch (Exception ex)
  5039. {
  5040. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5041. OutputLog.TraceLog(LogPriority.Error,
  5042. this.ToString(),
  5043. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5044. ex.ToString(),
  5045. LocalPath.LogExePath);
  5046. actionResult.Status = (int)Constant.PDAResult.Exception;
  5047. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5048. }
  5049. return actionResult;
  5050. }
  5051. /// <summary>
  5052. /// 在入窑工序检验窑车号是否存在
  5053. /// </summary>
  5054. /// <param name="accountCode"></param>
  5055. /// <param name="userCode"></param>
  5056. /// <param name="userPassword"></param>
  5057. /// <param name="sessionKey"></param>
  5058. /// <param name="kilncarcode">窑车编码</param>
  5059. /// <param name="procedureid">工序ID</param>
  5060. /// <returns></returns>
  5061. public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  5062. {
  5063. ActionResult actionResult = new ActionResult();
  5064. try
  5065. {
  5066. // 验证请求头信息
  5067. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5068. // 验证失败
  5069. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5070. {
  5071. return actionResult;
  5072. }
  5073. int returnValue = ServiceInvoker.Invoke<int>(this,
  5074. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  5075. if (returnValue == 1)
  5076. {
  5077. actionResult.Result = JsonHelper.ToJson(returnValue);
  5078. actionResult.Status = (int)Constant.PDAResult.Success;
  5079. }
  5080. else
  5081. {
  5082. actionResult.Status = (int)Constant.PDAResult.Fail;
  5083. if (returnValue == -99)
  5084. actionResult.Message = "窑炉车号无效";
  5085. else if (returnValue == -98)
  5086. actionResult.Message = "窑车己无产品";
  5087. else if (returnValue == -97)
  5088. actionResult.Message = "窑车没有入窑,不可以撤销";
  5089. else if (returnValue == -1)
  5090. actionResult.Message = "保存失败";
  5091. }
  5092. }
  5093. catch (Exception ex)
  5094. {
  5095. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5096. OutputLog.TraceLog(LogPriority.Error,
  5097. this.ToString(),
  5098. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5099. ex.ToString(),
  5100. LocalPath.LogExePath);
  5101. actionResult.Status = (int)Constant.PDAResult.Exception;
  5102. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5103. }
  5104. return actionResult;
  5105. }
  5106. /// <summary>
  5107. /// 撤销包装
  5108. /// </summary>
  5109. /// <param name="accountCode"></param>
  5110. /// <param name="userCode"></param>
  5111. /// <param name="userPassword"></param>
  5112. /// <param name="sessionKey"></param>
  5113. /// <param name="barcode"></param>
  5114. /// <returns></returns>
  5115. public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5116. {
  5117. ActionResult actionResult = new ActionResult();
  5118. try
  5119. {
  5120. // 验证请求头信息
  5121. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5122. // 验证失败
  5123. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5124. {
  5125. return actionResult;
  5126. }
  5127. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5128. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  5129. if (Convert.ToInt32(returnValue.Result) > 0)
  5130. {
  5131. actionResult.Result = JsonHelper.ToJson(returnValue);
  5132. actionResult.Status = (int)Constant.PDAResult.Success;
  5133. }
  5134. else
  5135. {
  5136. actionResult.Status = (int)Constant.PDAResult.Fail;
  5137. if (Convert.ToInt32(returnValue.Result) == -1)
  5138. actionResult.Message = "产品条码不存在包装记录";
  5139. else if (Convert.ToInt32(returnValue.Result) == -200)
  5140. actionResult.Message = returnValue.Message;
  5141. else
  5142. actionResult.Message = "成品撤销失败";
  5143. }
  5144. }
  5145. catch (Exception ex)
  5146. {
  5147. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5148. OutputLog.TraceLog(LogPriority.Error,
  5149. this.ToString(),
  5150. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5151. ex.ToString(),
  5152. LocalPath.LogExePath);
  5153. actionResult.Status = (int)Constant.PDAResult.Exception;
  5154. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5155. }
  5156. return actionResult;
  5157. }
  5158. /*
  5159. /// <summary>
  5160. /// 获取用户是否有撤销包装权限
  5161. /// </summary>
  5162. /// <param name="accountCode"></param>
  5163. /// <param name="userCode"></param>
  5164. /// <param name="userPassword"></param>
  5165. /// <param name="sessionKey"></param>
  5166. /// <returns></returns>
  5167. public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5168. {
  5169. ActionResult actionResult = new ActionResult();
  5170. try
  5171. {
  5172. // 验证请求头信息
  5173. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5174. // 验证失败
  5175. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5176. {
  5177. return actionResult;
  5178. }
  5179. int returnValue = ServiceInvoker.Invoke<int>(this,
  5180. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5181. actionResult.Result = JsonHelper.ToJson(returnValue);
  5182. actionResult.Status = (int)Constant.PDAResult.Success;
  5183. }
  5184. catch (Exception ex)
  5185. {
  5186. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5187. OutputLog.TraceLog(LogPriority.Error,
  5188. this.ToString(),
  5189. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5190. ex.ToString(),
  5191. LocalPath.LogExePath);
  5192. actionResult.Status = (int)Constant.PDAResult.Exception;
  5193. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5194. }
  5195. return actionResult;
  5196. }
  5197. */
  5198. /// <summary>
  5199. /// 窑车状态明细表查询
  5200. /// </summary>
  5201. /// <param name="accountCode"></param>
  5202. /// <param name="userCode"></param>
  5203. /// <param name="userPassword"></param>
  5204. /// <param name="sessionKey"></param>
  5205. /// <param name="kilnCarCode"></param>
  5206. /// <returns></returns>
  5207. public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5208. {
  5209. ActionResult actionResult = new ActionResult();
  5210. try
  5211. {
  5212. // 验证请求头信息
  5213. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5214. // 验证失败
  5215. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5216. {
  5217. return actionResult;
  5218. }
  5219. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5220. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5221. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5222. {
  5223. actionResult.Status = (int)Constant.PDAResult.Fail;
  5224. actionResult.Message = Messages.MSG_CMN_I002;
  5225. }
  5226. else
  5227. {
  5228. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5229. actionResult.Status = (int)Constant.PDAResult.Success;
  5230. }
  5231. }
  5232. catch (Exception ex)
  5233. {
  5234. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5235. OutputLog.TraceLog(LogPriority.Error,
  5236. this.ToString(),
  5237. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5238. ex.ToString(),
  5239. LocalPath.LogExePath);
  5240. actionResult.Status = (int)Constant.PDAResult.Exception;
  5241. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5242. }
  5243. return actionResult;
  5244. }
  5245. /// <summary>
  5246. /// 损坯撤销
  5247. /// </summary>
  5248. /// <param name="accountCode"></param>
  5249. /// <param name="userCode"></param>
  5250. /// <param name="userPassword"></param>
  5251. /// <param name="sessionKey"></param>
  5252. /// <param name="barcode"></param>
  5253. /// <returns></returns>
  5254. public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5255. {
  5256. ActionResult actionResult = new ActionResult();
  5257. try
  5258. {
  5259. // 验证请求头信息
  5260. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5261. // 验证失败
  5262. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5263. {
  5264. return actionResult;
  5265. }
  5266. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5267. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5268. if (Convert.ToInt32(returnValue.Result) > 0)
  5269. {
  5270. actionResult.Result = JsonHelper.ToJson(returnValue);
  5271. actionResult.Status = (int)Constant.PDAResult.Success;
  5272. }
  5273. else
  5274. {
  5275. actionResult.Status = (int)Constant.PDAResult.Fail;
  5276. if (Convert.ToInt32(returnValue.Result) == -1)
  5277. actionResult.Message = "此产品没有损坯,不能撤销";
  5278. else if (Convert.ToInt32(returnValue.Result) == -200)
  5279. actionResult.Message = returnValue.Message;
  5280. else
  5281. actionResult.Message = "损坯撤销失败";
  5282. }
  5283. }
  5284. catch (Exception ex)
  5285. {
  5286. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5287. OutputLog.TraceLog(LogPriority.Error,
  5288. this.ToString(),
  5289. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5290. ex.ToString(),
  5291. LocalPath.LogExePath);
  5292. actionResult.Status = (int)Constant.PDAResult.Exception;
  5293. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5294. }
  5295. return actionResult;
  5296. }
  5297. /*
  5298. /// <summary>
  5299. /// 获取用户是否有损坯撤销权限
  5300. /// </summary>
  5301. /// <param name="accountCode"></param>
  5302. /// <param name="userCode"></param>
  5303. /// <param name="userPassword"></param>
  5304. /// <param name="sessionKey"></param>
  5305. /// <returns></returns>
  5306. public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5307. {
  5308. ActionResult actionResult = new ActionResult();
  5309. try
  5310. {
  5311. // 验证请求头信息
  5312. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5313. // 验证失败
  5314. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5315. {
  5316. return actionResult;
  5317. }
  5318. int returnValue = ServiceInvoker.Invoke<int>(this,
  5319. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5320. actionResult.Result = JsonHelper.ToJson(returnValue);
  5321. actionResult.Status = (int)Constant.PDAResult.Success;
  5322. }
  5323. catch (Exception ex)
  5324. {
  5325. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5326. OutputLog.TraceLog(LogPriority.Error,
  5327. this.ToString(),
  5328. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5329. ex.ToString(),
  5330. LocalPath.LogExePath);
  5331. actionResult.Status = (int)Constant.PDAResult.Exception;
  5332. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5333. }
  5334. return actionResult;
  5335. }
  5336. */
  5337. /// <summary>
  5338. /// 获取条码注浆信息
  5339. /// </summary>
  5340. /// <param name="accountCode"></param>
  5341. /// <param name="userCode"></param>
  5342. /// <param name="userPassword"></param>
  5343. /// <param name="sessionKey"></param>
  5344. /// <returns></returns>
  5345. public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5346. {
  5347. ActionResult actionResult = new ActionResult();
  5348. try
  5349. {
  5350. // 验证请求头信息
  5351. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5352. // 验证失败
  5353. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5354. {
  5355. return actionResult;
  5356. }
  5357. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5358. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5359. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5360. {
  5361. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5362. actionResult.Status = (int)Constant.PDAResult.Success;
  5363. }
  5364. else
  5365. {
  5366. actionResult.Status = (int)Constant.PDAResult.Fail;
  5367. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5368. }
  5369. }
  5370. catch (Exception ex)
  5371. {
  5372. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5373. OutputLog.TraceLog(LogPriority.Error,
  5374. this.ToString(),
  5375. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5376. ex.ToString(),
  5377. LocalPath.LogExePath);
  5378. actionResult.Status = (int)Constant.PDAResult.Exception;
  5379. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5380. }
  5381. return actionResult;
  5382. }
  5383. /// <summary>
  5384. /// 获取条码注浆信息
  5385. /// </summary>
  5386. /// <param name="accountCode"></param>
  5387. /// <param name="userCode"></param>
  5388. /// <param name="userPassword"></param>
  5389. /// <param name="sessionKey"></param>
  5390. /// <returns></returns>
  5391. public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5392. {
  5393. ActionResult actionResult = new ActionResult();
  5394. try
  5395. {
  5396. // 验证请求头信息
  5397. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5398. // 验证失败
  5399. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5400. {
  5401. return actionResult;
  5402. }
  5403. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5404. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5405. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5406. {
  5407. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5408. actionResult.Status = (int)Constant.PDAResult.Success;
  5409. }
  5410. else
  5411. {
  5412. actionResult.Status = (int)Constant.PDAResult.Fail;
  5413. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5414. }
  5415. }
  5416. catch (Exception ex)
  5417. {
  5418. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5419. OutputLog.TraceLog(LogPriority.Error,
  5420. this.ToString(),
  5421. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5422. ex.ToString(),
  5423. LocalPath.LogExePath);
  5424. actionResult.Status = (int)Constant.PDAResult.Exception;
  5425. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5426. }
  5427. return actionResult;
  5428. }
  5429. /// <summary>
  5430. /// 公坯设定
  5431. /// </summary>
  5432. /// <param name="accountCode"></param>
  5433. /// <param name="userCode"></param>
  5434. /// <param name="userPassword"></param>
  5435. /// <param name="sessionKey"></param>
  5436. /// <param name="barcode"></param>
  5437. /// <returns></returns>
  5438. public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5439. {
  5440. ActionResult actionResult = new ActionResult();
  5441. try
  5442. {
  5443. // 验证请求头信息
  5444. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5445. // 验证失败
  5446. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5447. {
  5448. return actionResult;
  5449. }
  5450. int returnValue = ServiceInvoker.Invoke<int>(this,
  5451. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5452. if (returnValue > 0)
  5453. {
  5454. actionResult.Result = JsonHelper.ToJson(returnValue);
  5455. actionResult.Status = (int)Constant.PDAResult.Success;
  5456. }
  5457. else
  5458. {
  5459. actionResult.Status = (int)Constant.PDAResult.Fail;
  5460. if (returnValue == -1)
  5461. actionResult.Message = "此产品不在生产线上";
  5462. else if (returnValue == -2)
  5463. actionResult.Message = "该产品已经标识为公坯";
  5464. else
  5465. actionResult.Message = "公坯设定失败";
  5466. }
  5467. }
  5468. catch (Exception ex)
  5469. {
  5470. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5471. OutputLog.TraceLog(LogPriority.Error,
  5472. this.ToString(),
  5473. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5474. ex.ToString(),
  5475. LocalPath.LogExePath);
  5476. actionResult.Status = (int)Constant.PDAResult.Exception;
  5477. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5478. }
  5479. return actionResult;
  5480. }
  5481. /*
  5482. /// <summary>
  5483. /// 获取用户是否有公坯设定
  5484. /// </summary>
  5485. /// <param name="accountCode"></param>
  5486. /// <param name="userCode"></param>
  5487. /// <param name="userPassword"></param>
  5488. /// <param name="sessionKey"></param>
  5489. /// <returns></returns>
  5490. public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5491. {
  5492. ActionResult actionResult = new ActionResult();
  5493. try
  5494. {
  5495. // 验证请求头信息
  5496. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5497. // 验证失败
  5498. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5499. {
  5500. return actionResult;
  5501. }
  5502. int returnValue = ServiceInvoker.Invoke<int>(this,
  5503. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5504. actionResult.Result = JsonHelper.ToJson(returnValue);
  5505. actionResult.Status = (int)Constant.PDAResult.Success;
  5506. }
  5507. catch (Exception ex)
  5508. {
  5509. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5510. OutputLog.TraceLog(LogPriority.Error,
  5511. this.ToString(),
  5512. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5513. ex.ToString(),
  5514. LocalPath.LogExePath);
  5515. actionResult.Status = (int)Constant.PDAResult.Exception;
  5516. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5517. }
  5518. return actionResult;
  5519. }
  5520. */
  5521. /// <summary>
  5522. /// 校验产品条码是否可以走到该工序
  5523. /// </summary>
  5524. /// <param name="accountCode">帐套code</param>
  5525. /// <param name="userCode">用户code</param>
  5526. /// <param name="userPassword">用户密码</param>
  5527. /// <param name="sessionKey">本次登陆密钥</param>
  5528. /// <param name="procedureID">工序ID</param>
  5529. /// <param name="barcode">条码</param>
  5530. /// <returns></returns>
  5531. /// <remarks>
  5532. /// 陈冰 2014.09.18 新建
  5533. /// </remarks>
  5534. public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5535. {
  5536. ActionResult actionResult = new ActionResult();
  5537. try
  5538. {
  5539. // 验证请求头信息
  5540. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5541. // 验证失败
  5542. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5543. {
  5544. return actionResult;
  5545. }
  5546. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5547. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5548. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5549. {
  5550. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5551. actionResult.Status = (int)Constant.PDAResult.Success;
  5552. }
  5553. else
  5554. {
  5555. actionResult.Status = (int)Constant.PDAResult.Fail;
  5556. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5557. }
  5558. }
  5559. catch (Exception ex)
  5560. {
  5561. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5562. OutputLog.TraceLog(LogPriority.Error,
  5563. this.ToString(),
  5564. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5565. ex.ToString(),
  5566. LocalPath.LogExePath);
  5567. actionResult.Status = (int)Constant.PDAResult.Exception;
  5568. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5569. }
  5570. return actionResult;
  5571. }
  5572. /// <summary>
  5573. /// 获取用户所有菜单权限
  5574. /// </summary>
  5575. /// <param name="accountCode"></param>
  5576. /// <param name="userCode"></param>
  5577. /// <param name="userPassword"></param>
  5578. /// <param name="sessionKey"></param>
  5579. /// <returns></returns>
  5580. public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
  5581. {
  5582. ActionResult actionResult = new ActionResult();
  5583. try
  5584. {
  5585. // 验证请求头信息
  5586. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5587. // 验证失败
  5588. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5589. {
  5590. return actionResult;
  5591. }
  5592. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5593. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5594. actionResult.Result = JsonHelper.ToJson(returnValue);
  5595. actionResult.Status = (int)Constant.PDAResult.Success;
  5596. }
  5597. catch (Exception ex)
  5598. {
  5599. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5600. OutputLog.TraceLog(LogPriority.Error,
  5601. this.ToString(),
  5602. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5603. ex.ToString(),
  5604. LocalPath.LogExePath);
  5605. actionResult.Status = (int)Constant.PDAResult.Exception;
  5606. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5607. }
  5608. return actionResult;
  5609. }
  5610. public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5611. {
  5612. ActionResult actionResult = new ActionResult();
  5613. try
  5614. {
  5615. // 验证请求头信息
  5616. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5617. // 验证失败
  5618. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5619. {
  5620. return actionResult;
  5621. }
  5622. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5623. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5624. if (Convert.ToInt32(returnValue.Result) > 0)
  5625. {
  5626. actionResult.Result = JsonHelper.ToJson(returnValue);
  5627. actionResult.Status = (int)Constant.PDAResult.Success;
  5628. }
  5629. else
  5630. {
  5631. actionResult.Status = (int)Constant.PDAResult.Fail;
  5632. if (Convert.ToInt32(returnValue.Result) == -1)
  5633. actionResult.Message = "无效条码";
  5634. else if (Convert.ToInt32(returnValue.Result) == -2)
  5635. actionResult.Message = "已经生产完成";
  5636. else if (Convert.ToInt32(returnValue.Result) == -3)
  5637. actionResult.Message = "条码已经申请报废";
  5638. else if (Convert.ToInt32(returnValue.Result) == -4)
  5639. actionResult.Message = "此条码当前工序不允许进行撤销";
  5640. else if (Convert.ToInt32(returnValue.Result) == -5)
  5641. actionResult.Message = "此条码没有生产数据";
  5642. else if (Convert.ToInt32(returnValue.Result) == -6)
  5643. actionResult.Message = "没有当前工序权限";
  5644. else if (Convert.ToInt32(returnValue.Result) == -7)
  5645. actionResult.Message = "条码不在生产线上";
  5646. else if (Convert.ToInt32(returnValue.Result) == -8)
  5647. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5648. else if (Convert.ToInt32(returnValue.Result) == -9)
  5649. actionResult.Message = "条码已经是返工状态";
  5650. else if (Convert.ToInt32(returnValue.Result) == -200)
  5651. actionResult.Message = returnValue.Message;
  5652. }
  5653. }
  5654. catch (Exception ex)
  5655. {
  5656. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5657. OutputLog.TraceLog(LogPriority.Error,
  5658. this.ToString(),
  5659. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5660. ex.ToString(),
  5661. LocalPath.LogExePath);
  5662. actionResult.Status = (int)Constant.PDAResult.Exception;
  5663. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5664. }
  5665. return actionResult;
  5666. }
  5667. public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5668. {
  5669. ActionResult actionResult = new ActionResult();
  5670. try
  5671. {
  5672. // 验证请求头信息
  5673. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5674. // 验证失败
  5675. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5676. {
  5677. return actionResult;
  5678. }
  5679. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5680. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5681. if (Convert.ToInt32(returnValue.Result) > 0)
  5682. {
  5683. actionResult.Result = JsonHelper.ToJson(returnValue);
  5684. actionResult.Status = (int)Constant.PDAResult.Success;
  5685. }
  5686. else
  5687. {
  5688. actionResult.Status = (int)Constant.PDAResult.Fail;
  5689. if (Convert.ToInt32(returnValue.Result) == -1)
  5690. actionResult.Message = "无效条码";
  5691. else if (Convert.ToInt32(returnValue.Result) == -2)
  5692. actionResult.Message = "已经生产完成";
  5693. else if (Convert.ToInt32(returnValue.Result) == -3)
  5694. actionResult.Message = "条码已经申请报废";
  5695. else if (Convert.ToInt32(returnValue.Result) == -4)
  5696. actionResult.Message = "此条码当前工序不允许进行撤销";
  5697. else if (Convert.ToInt32(returnValue.Result) == -5)
  5698. actionResult.Message = "此条码没有生产数据";
  5699. else if (Convert.ToInt32(returnValue.Result) == -55)
  5700. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5701. else if (Convert.ToInt32(returnValue.Result) == -6)
  5702. actionResult.Message = "没有任何影响行";
  5703. else if (Convert.ToInt32(returnValue.Result) == -7)
  5704. actionResult.Message = "条码不在生产线上";
  5705. else if (Convert.ToInt32(returnValue.Result) == -8)
  5706. actionResult.Message = "条码已经是返工状态";
  5707. else if (Convert.ToInt32(returnValue.Result) == -200)
  5708. actionResult.Message = returnValue.Message;
  5709. }
  5710. }
  5711. catch (Exception ex)
  5712. {
  5713. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5714. OutputLog.TraceLog(LogPriority.Error,
  5715. this.ToString(),
  5716. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5717. ex.ToString(),
  5718. LocalPath.LogExePath);
  5719. actionResult.Status = (int)Constant.PDAResult.Exception;
  5720. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5721. }
  5722. return actionResult;
  5723. }
  5724. public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  5725. {
  5726. ActionResult actionResult = new ActionResult();
  5727. try
  5728. {
  5729. // 验证请求头信息
  5730. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5731. // 验证失败
  5732. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5733. {
  5734. return actionResult;
  5735. }
  5736. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5737. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5738. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5739. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5740. {
  5741. //DataView dv = returnValue.Tables[0].DefaultView;
  5742. //dv.RowFilter = "ValueFlag=1";
  5743. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5744. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5745. actionResult.Status = (int)Constant.PDAResult.Success;
  5746. }
  5747. }
  5748. catch (Exception ex)
  5749. {
  5750. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5751. OutputLog.TraceLog(LogPriority.Error,
  5752. this.ToString(),
  5753. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5754. ex.ToString(),
  5755. LocalPath.LogExePath);
  5756. actionResult.Status = (int)Constant.PDAResult.Exception;
  5757. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5758. }
  5759. return actionResult;
  5760. }
  5761. /// <summary>
  5762. /// 变更产品商标用
  5763. /// </summary>
  5764. /// <param name="accountCode"></param>
  5765. /// <param name="userCode"></param>
  5766. /// <param name="userPassword"></param>
  5767. /// <param name="sessionKey"></param>
  5768. /// <param name="goodsid"></param>
  5769. /// <returns></returns>
  5770. public ActionResult GetLogoInfoForChange(string accountCode, string userCode, string userPassword, string sessionKey
  5771. , int goodsid)
  5772. {
  5773. ActionResult actionResult = new ActionResult();
  5774. try
  5775. {
  5776. // 验证请求头信息
  5777. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5778. // 验证失败
  5779. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5780. {
  5781. return actionResult;
  5782. }
  5783. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5784. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5785. //() => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5786. () => SystemModuleLogic.GetLogoInfoForChange(sUserInfo, goodsid));
  5787. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5788. {
  5789. //DataView dv = returnValue.Tables[0].DefaultView;
  5790. //dv.RowFilter = "ValueFlag=1";
  5791. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5792. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5793. actionResult.Status = (int)Constant.PDAResult.Success;
  5794. }
  5795. }
  5796. catch (Exception ex)
  5797. {
  5798. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5799. OutputLog.TraceLog(LogPriority.Error,
  5800. this.ToString(),
  5801. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5802. ex.ToString(),
  5803. LocalPath.LogExePath);
  5804. actionResult.Status = (int)Constant.PDAResult.Exception;
  5805. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5806. }
  5807. return actionResult;
  5808. }
  5809. public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5810. {
  5811. ActionResult actionResult = new ActionResult();
  5812. try
  5813. {
  5814. // 验证请求头信息
  5815. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5816. // 验证失败
  5817. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5818. {
  5819. return actionResult;
  5820. }
  5821. int returnValue = ServiceInvoker.Invoke<int>(this,
  5822. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5823. actionResult.Result = JsonHelper.ToJson(returnValue);
  5824. actionResult.Status = (int)Constant.PDAResult.Success;
  5825. }
  5826. catch (Exception ex)
  5827. {
  5828. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5829. OutputLog.TraceLog(LogPriority.Error,
  5830. this.ToString(),
  5831. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5832. ex.ToString(),
  5833. LocalPath.LogExePath);
  5834. actionResult.Status = (int)Constant.PDAResult.Exception;
  5835. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5836. }
  5837. return actionResult;
  5838. }
  5839. public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  5840. {
  5841. ActionResult actionResult = new ActionResult();
  5842. try
  5843. {
  5844. // 验证请求头信息
  5845. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5846. // 验证失败
  5847. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5848. {
  5849. return actionResult;
  5850. }
  5851. int returnValue = ServiceInvoker.Invoke<int>(this,
  5852. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo));
  5853. actionResult.Result = JsonHelper.ToJson(returnValue);
  5854. actionResult.Status = (int)Constant.PDAResult.Success;
  5855. }
  5856. catch (Exception ex)
  5857. {
  5858. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5859. OutputLog.TraceLog(LogPriority.Error,
  5860. this.ToString(),
  5861. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5862. ex.ToString(),
  5863. LocalPath.LogExePath);
  5864. actionResult.Status = (int)Constant.PDAResult.Exception;
  5865. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5866. }
  5867. return actionResult;
  5868. }
  5869. public ActionResult SaveBarCodeLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  5870. string barcode, int logoid, int glazetypeid)
  5871. {
  5872. ActionResult actionResult = new ActionResult();
  5873. try
  5874. {
  5875. // 验证请求头信息
  5876. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5877. // 验证失败
  5878. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5879. {
  5880. return actionResult;
  5881. }
  5882. int returnValue = ServiceInvoker.Invoke<int>(this,
  5883. () => PMModuleLogicDAL.SaveBarCodeLogoAndGlazetype(barcode, logoid, glazetypeid, sUserInfo));
  5884. actionResult.Result = JsonHelper.ToJson(returnValue);
  5885. if (returnValue > 0)
  5886. {
  5887. actionResult.Status = (int)Constant.PDAResult.Success;
  5888. }
  5889. else
  5890. {
  5891. actionResult.Status = (int)Constant.PDAResult.Fail;
  5892. actionResult.Message = "条码不存在";
  5893. }
  5894. }
  5895. catch (Exception ex)
  5896. {
  5897. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5898. OutputLog.TraceLog(LogPriority.Error,
  5899. this.ToString(),
  5900. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5901. ex.ToString(),
  5902. LocalPath.LogExePath);
  5903. actionResult.Status = (int)Constant.PDAResult.Exception;
  5904. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5905. }
  5906. return actionResult;
  5907. }
  5908. public ActionResult SaveBarCodesLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  5909. string barcodes, int logoid, int glazetypeid, int procedureID)
  5910. {
  5911. ActionResult actionResult = new ActionResult();
  5912. try
  5913. {
  5914. // 验证请求头信息
  5915. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5916. // 验证失败
  5917. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5918. {
  5919. return actionResult;
  5920. }
  5921. int returnValue = ServiceInvoker.Invoke<int>(this,
  5922. () => PMModuleLogicDAL.SaveBarCodesLogoAndGlazetype(barcodes, logoid, glazetypeid, procedureID, sUserInfo));
  5923. actionResult.Result = JsonHelper.ToJson(returnValue);
  5924. if (returnValue > 0)
  5925. {
  5926. actionResult.Status = (int)Constant.PDAResult.Success;
  5927. }
  5928. else
  5929. {
  5930. actionResult.Status = (int)Constant.PDAResult.Fail;
  5931. actionResult.Message = "条码不存在";
  5932. }
  5933. }
  5934. catch (Exception ex)
  5935. {
  5936. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5937. OutputLog.TraceLog(LogPriority.Error,
  5938. this.ToString(),
  5939. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5940. ex.ToString(),
  5941. LocalPath.LogExePath);
  5942. actionResult.Status = (int)Constant.PDAResult.Exception;
  5943. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5944. }
  5945. return actionResult;
  5946. }
  5947. public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5948. {
  5949. ActionResult actionResult = new ActionResult();
  5950. try
  5951. {
  5952. // 验证请求头信息
  5953. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5954. // 验证失败
  5955. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5956. {
  5957. return actionResult;
  5958. }
  5959. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5960. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  5961. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5962. {
  5963. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5964. actionResult.Status = (int)Constant.PDAResult.Success;
  5965. }
  5966. }
  5967. catch (Exception ex)
  5968. {
  5969. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5970. OutputLog.TraceLog(LogPriority.Error,
  5971. this.ToString(),
  5972. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5973. ex.ToString(),
  5974. LocalPath.LogExePath);
  5975. actionResult.Status = (int)Constant.PDAResult.Exception;
  5976. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5977. }
  5978. return actionResult;
  5979. }
  5980. /// <summary>
  5981. /// 半检时,入窑前检验获取此条码是否报损为废品
  5982. /// </summary>
  5983. /// <param name="accountCode"></param>
  5984. /// <param name="userCode"></param>
  5985. /// <param name="userPassword"></param>
  5986. /// <param name="sessionKey"></param>
  5987. /// <param name="barcode">产品条码</param>
  5988. /// <returns></returns>
  5989. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5990. {
  5991. ActionResult actionResult = new ActionResult();
  5992. try
  5993. {
  5994. // 验证请求头信息
  5995. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5996. // 验证失败
  5997. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5998. {
  5999. return actionResult;
  6000. }
  6001. int returnValue = ServiceInvoker.Invoke<int>(this,
  6002. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  6003. if (returnValue != -100)
  6004. {
  6005. actionResult.Result = JsonHelper.ToJson(returnValue);
  6006. actionResult.Status = (int)Constant.PDAResult.Success;
  6007. }
  6008. else
  6009. {
  6010. actionResult.Status = (int)Constant.PDAResult.Fail;
  6011. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  6012. }
  6013. }
  6014. catch (Exception ex)
  6015. {
  6016. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6017. OutputLog.TraceLog(LogPriority.Error,
  6018. this.ToString(),
  6019. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6020. ex.ToString(),
  6021. LocalPath.LogExePath);
  6022. actionResult.Status = (int)Constant.PDAResult.Exception;
  6023. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6024. }
  6025. return actionResult;
  6026. }
  6027. /// <summary>
  6028. /// 获取登陆帐户有无入窑前检验数据编辑权限
  6029. /// </summary>
  6030. /// <param name="accountCode"></param>
  6031. /// <param name="userCode"></param>
  6032. /// <param name="userPassword"></param>
  6033. /// <param name="sessionKey"></param>
  6034. /// <param name="usercode">工号编码</param>
  6035. /// <returns></returns>
  6036. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6037. {
  6038. ActionResult actionResult = new ActionResult();
  6039. try
  6040. {
  6041. // 验证请求头信息
  6042. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6043. // 验证失败
  6044. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6045. {
  6046. return actionResult;
  6047. }
  6048. int returnValue = ServiceInvoker.Invoke<int>(this,
  6049. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  6050. actionResult.Result = JsonHelper.ToJson(returnValue);
  6051. actionResult.Status = (int)Constant.PDAResult.Success;
  6052. }
  6053. catch (Exception ex)
  6054. {
  6055. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6056. OutputLog.TraceLog(LogPriority.Error,
  6057. this.ToString(),
  6058. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6059. ex.ToString(),
  6060. LocalPath.LogExePath);
  6061. actionResult.Status = (int)Constant.PDAResult.Exception;
  6062. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6063. }
  6064. return actionResult;
  6065. }
  6066. /// <summary>
  6067. /// 获取登陆帐户有无半检验数据编辑权限
  6068. /// </summary>
  6069. /// <param name="accountCode"></param>
  6070. /// <param name="userCode"></param>
  6071. /// <param name="userPassword"></param>
  6072. /// <param name="sessionKey"></param>
  6073. /// <param name="usercode">工号编码</param>
  6074. /// <returns></returns>
  6075. public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6076. {
  6077. ActionResult actionResult = new ActionResult();
  6078. try
  6079. {
  6080. // 验证请求头信息
  6081. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6082. // 验证失败
  6083. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6084. {
  6085. return actionResult;
  6086. }
  6087. int returnValue = ServiceInvoker.Invoke<int>(this,
  6088. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  6089. actionResult.Result = JsonHelper.ToJson(returnValue);
  6090. actionResult.Status = (int)Constant.PDAResult.Success;
  6091. }
  6092. catch (Exception ex)
  6093. {
  6094. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6095. OutputLog.TraceLog(LogPriority.Error,
  6096. this.ToString(),
  6097. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6098. ex.ToString(),
  6099. LocalPath.LogExePath);
  6100. actionResult.Status = (int)Constant.PDAResult.Exception;
  6101. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6102. }
  6103. return actionResult;
  6104. }
  6105. /// <summary>
  6106. /// 获取缺陷扣罚管理的全部数据
  6107. /// </summary>
  6108. /// <param name="accountCode"></param>
  6109. /// <param name="userCode"></param>
  6110. /// <param name="userPassword"></param>
  6111. /// <param name="sessionKey"></param>
  6112. /// <returns></returns>
  6113. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  6114. {
  6115. ActionResult actionResult = new ActionResult();
  6116. try
  6117. {
  6118. // 验证请求头信息
  6119. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6120. // 验证失败
  6121. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6122. {
  6123. return actionResult;
  6124. }
  6125. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6126. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  6127. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6128. {
  6129. DataView dv = ds.Tables[0].DefaultView;
  6130. dv.RowFilter = "valueflag=1";
  6131. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6132. actionResult.Status = (int)Constant.PDAResult.Success;
  6133. }
  6134. else
  6135. {
  6136. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6137. actionResult.Status = (int)Constant.PDAResult.Success;
  6138. }
  6139. }
  6140. catch (Exception ex)
  6141. {
  6142. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6143. OutputLog.TraceLog(LogPriority.Error,
  6144. this.ToString(),
  6145. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6146. ex.ToString(),
  6147. LocalPath.LogExePath);
  6148. actionResult.Status = (int)Constant.PDAResult.Exception;
  6149. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6150. }
  6151. return actionResult;
  6152. }
  6153. /// <summary>
  6154. /// 获取缺陷扣除数管理的全部数据
  6155. /// </summary>
  6156. /// <param name="accountCode"></param>
  6157. /// <param name="userCode"></param>
  6158. /// <param name="userPassword"></param>
  6159. /// <param name="sessionKey"></param>
  6160. /// <returns></returns>
  6161. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  6162. {
  6163. ActionResult actionResult = new ActionResult();
  6164. try
  6165. {
  6166. // 验证请求头信息
  6167. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6168. // 验证失败
  6169. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6170. {
  6171. return actionResult;
  6172. }
  6173. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6174. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  6175. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6176. {
  6177. DataView dv = ds.Tables[0].DefaultView;
  6178. dv.RowFilter = "valueflag=1";
  6179. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6180. actionResult.Status = (int)Constant.PDAResult.Success;
  6181. }
  6182. else
  6183. {
  6184. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6185. actionResult.Status = (int)Constant.PDAResult.Success;
  6186. }
  6187. }
  6188. catch (Exception ex)
  6189. {
  6190. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6191. OutputLog.TraceLog(LogPriority.Error,
  6192. this.ToString(),
  6193. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6194. ex.ToString(),
  6195. LocalPath.LogExePath);
  6196. actionResult.Status = (int)Constant.PDAResult.Exception;
  6197. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6198. }
  6199. return actionResult;
  6200. }
  6201. /// <summary>
  6202. /// 获取缺陷扣罚关系管理的全部数据
  6203. /// </summary>
  6204. /// <param name="accountCode"></param>
  6205. /// <param name="userCode"></param>
  6206. /// <param name="userPassword"></param>
  6207. /// <param name="sessionKey"></param>
  6208. /// <returns></returns>
  6209. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6210. {
  6211. ActionResult actionResult = new ActionResult();
  6212. try
  6213. {
  6214. // 验证请求头信息
  6215. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6216. // 验证失败
  6217. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6218. {
  6219. return actionResult;
  6220. }
  6221. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6222. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  6223. DataTable dt = new DataTable();
  6224. dt.Columns.Add("DefectID");
  6225. dt.Columns.Add("DefectFineID");
  6226. DataView dv = ds.Tables[0].DefaultView;
  6227. DataTable dtFor = dv.ToTable("defectid", true);
  6228. for (int i = 0; i < dtFor.Rows.Count; i++)
  6229. {
  6230. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6231. string substring = "";
  6232. foreach (DataRow r1 in r)
  6233. {
  6234. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  6235. }
  6236. if (substring != "")
  6237. {
  6238. DataRow drnew = dt.NewRow();
  6239. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6240. drnew["DefectFineID"] = substring.TrimEnd(',');
  6241. dt.Rows.Add(drnew);
  6242. }
  6243. }
  6244. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6245. actionResult.Status = (int)Constant.PDAResult.Success;
  6246. }
  6247. catch (Exception ex)
  6248. {
  6249. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6250. OutputLog.TraceLog(LogPriority.Error,
  6251. this.ToString(),
  6252. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6253. ex.ToString(),
  6254. LocalPath.LogExePath);
  6255. actionResult.Status = (int)Constant.PDAResult.Exception;
  6256. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6257. }
  6258. return actionResult;
  6259. }
  6260. /// <summary>
  6261. /// 获取缺陷扣除数关系管理的全部数据
  6262. /// </summary>
  6263. /// <param name="accountCode"></param>
  6264. /// <param name="userCode"></param>
  6265. /// <param name="userPassword"></param>
  6266. /// <param name="sessionKey"></param>
  6267. /// <returns></returns>
  6268. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6269. {
  6270. ActionResult actionResult = new ActionResult();
  6271. try
  6272. {
  6273. // 验证请求头信息
  6274. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6275. // 验证失败
  6276. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6277. {
  6278. return actionResult;
  6279. }
  6280. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6281. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6282. DataTable dt = new DataTable();
  6283. dt.Columns.Add("DefectID");
  6284. dt.Columns.Add("DefectDeductionNum");
  6285. DataView dv = ds.Tables[0].DefaultView;
  6286. DataTable dtFor = dv.ToTable("defectid", true);
  6287. for (int i = 0; i < dtFor.Rows.Count; i++)
  6288. {
  6289. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6290. string substring = "";
  6291. foreach (DataRow r1 in r)
  6292. {
  6293. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6294. }
  6295. if (substring != "")
  6296. {
  6297. DataRow drnew = dt.NewRow();
  6298. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6299. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6300. dt.Rows.Add(drnew);
  6301. }
  6302. }
  6303. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6304. actionResult.Status = (int)Constant.PDAResult.Success;
  6305. }
  6306. catch (Exception ex)
  6307. {
  6308. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6309. OutputLog.TraceLog(LogPriority.Error,
  6310. this.ToString(),
  6311. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6312. ex.ToString(),
  6313. LocalPath.LogExePath);
  6314. actionResult.Status = (int)Constant.PDAResult.Exception;
  6315. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6316. }
  6317. return actionResult;
  6318. }
  6319. /// <summary>
  6320. /// 获取盘点单明细
  6321. /// </summary>
  6322. /// <param name="sUserInfo"></param>
  6323. /// <returns></returns>
  6324. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6325. {
  6326. ActionResult actionResult = new ActionResult();
  6327. try
  6328. {
  6329. // 验证请求头信息
  6330. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6331. // 验证失败
  6332. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6333. {
  6334. return actionResult;
  6335. }
  6336. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6337. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6338. actionResult.Result = JsonHelper.ToJson(ds);
  6339. actionResult.Status = (int)Constant.PDAResult.Success;
  6340. }
  6341. catch (Exception ex)
  6342. {
  6343. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6344. OutputLog.TraceLog(LogPriority.Error,
  6345. this.ToString(),
  6346. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6347. ex.ToString(),
  6348. LocalPath.LogExePath);
  6349. actionResult.Status = (int)Constant.PDAResult.Exception;
  6350. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6351. }
  6352. return actionResult;
  6353. }
  6354. /// <summary>
  6355. /// 半检检验条码
  6356. /// </summary>
  6357. /// <param name="sUserInfo"></param>
  6358. /// <returns></returns>
  6359. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6360. {
  6361. ActionResult actionResult = new ActionResult();
  6362. try
  6363. {
  6364. // 验证请求头信息
  6365. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6366. // 验证失败
  6367. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6368. {
  6369. return actionResult;
  6370. }
  6371. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6372. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6373. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6374. if (Convert.ToInt32(resultEntity.Result) < 0)
  6375. {
  6376. actionResult.Status = (int)Constant.PDAResult.Fail;
  6377. }
  6378. else
  6379. {
  6380. actionResult.Status = (int)Constant.PDAResult.Success;
  6381. }
  6382. actionResult.Message = resultEntity.Message;
  6383. }
  6384. catch (Exception ex)
  6385. {
  6386. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6387. OutputLog.TraceLog(LogPriority.Error,
  6388. this.ToString(),
  6389. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6390. ex.ToString(),
  6391. LocalPath.LogExePath);
  6392. actionResult.Status = (int)Constant.PDAResult.Exception;
  6393. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6394. }
  6395. return actionResult;
  6396. }
  6397. /// <summary>
  6398. /// 根据条码获取经过的工序,用于绑定返工工序
  6399. /// </summary>
  6400. /// <param name="sUserInfo"></param>
  6401. /// <returns></returns>
  6402. public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6403. {
  6404. ActionResult actionResult = new ActionResult();
  6405. try
  6406. {
  6407. // 验证请求头信息
  6408. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6409. // 验证失败
  6410. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6411. {
  6412. return actionResult;
  6413. }
  6414. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6415. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6416. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6417. actionResult.Status = (int)Constant.PDAResult.Success;
  6418. }
  6419. catch (Exception ex)
  6420. {
  6421. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6422. OutputLog.TraceLog(LogPriority.Error,
  6423. this.ToString(),
  6424. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6425. ex.ToString(),
  6426. LocalPath.LogExePath);
  6427. actionResult.Status = (int)Constant.PDAResult.Exception;
  6428. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6429. }
  6430. return actionResult;
  6431. }
  6432. /// <summary>
  6433. /// 获取登陆帐户有无半检状态权限
  6434. /// </summary>
  6435. /// <param name="sUserInfo"></param>
  6436. /// <returns></returns>
  6437. public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6438. {
  6439. ActionResult actionResult = new ActionResult();
  6440. try
  6441. {
  6442. // 验证请求头信息
  6443. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6444. // 验证失败
  6445. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6446. {
  6447. return actionResult;
  6448. }
  6449. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6450. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6451. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6452. actionResult.Status = (int)Constant.PDAResult.Success;
  6453. }
  6454. catch (Exception ex)
  6455. {
  6456. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6457. OutputLog.TraceLog(LogPriority.Error,
  6458. this.ToString(),
  6459. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6460. ex.ToString(),
  6461. LocalPath.LogExePath);
  6462. actionResult.Status = (int)Constant.PDAResult.Exception;
  6463. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6464. }
  6465. return actionResult;
  6466. }
  6467. /// <summary>
  6468. /// 复检状态数据源
  6469. /// </summary>
  6470. /// <param name="sUserInfo"></param>
  6471. /// <returns></returns>
  6472. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6473. {
  6474. ActionResult actionResult = new ActionResult();
  6475. try
  6476. {
  6477. // 验证请求头信息
  6478. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6479. // 验证失败
  6480. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6481. {
  6482. return actionResult;
  6483. }
  6484. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6485. () => SystemModuleLogic.GetSemiCheckType());
  6486. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6487. actionResult.Status = (int)Constant.PDAResult.Success;
  6488. }
  6489. catch (Exception ex)
  6490. {
  6491. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6492. OutputLog.TraceLog(LogPriority.Error,
  6493. this.ToString(),
  6494. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6495. ex.ToString(),
  6496. LocalPath.LogExePath);
  6497. actionResult.Status = (int)Constant.PDAResult.Exception;
  6498. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6499. }
  6500. return actionResult;
  6501. }
  6502. /// <summary>
  6503. /// 根据半成品检验数据ID,显示半成品数据信息
  6504. /// </summary>
  6505. /// <param name="sUserInfo"></param>
  6506. /// <returns></returns>
  6507. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6508. {
  6509. ActionResult actionResult = new ActionResult();
  6510. try
  6511. {
  6512. // 验证请求头信息
  6513. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6514. // 验证失败
  6515. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6516. {
  6517. return actionResult;
  6518. }
  6519. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6520. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6521. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6522. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6523. {
  6524. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6525. {
  6526. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6527. {
  6528. SemiCheckEntity productionData = new SemiCheckEntity();
  6529. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6530. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6531. {
  6532. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6533. }
  6534. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6535. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6536. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6537. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6538. productionData.ReFine = 0;
  6539. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6540. {
  6541. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6542. }
  6543. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6544. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6545. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6546. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6547. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6548. {
  6549. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6550. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6551. }
  6552. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6553. {
  6554. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6555. }
  6556. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6557. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6558. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6559. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6560. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6561. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6562. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6563. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6564. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6565. {
  6566. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6567. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6568. }
  6569. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6570. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6571. {
  6572. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6573. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6574. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6575. }
  6576. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6577. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6578. {
  6579. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6580. }
  6581. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6582. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6583. DataTable dtDefect = dvDefect.ToTable();
  6584. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6585. {
  6586. // 产品缺陷
  6587. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6588. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6589. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6590. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6591. //{
  6592. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6593. //}
  6594. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6595. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6596. {
  6597. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6598. }
  6599. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6600. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6601. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6602. {
  6603. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6604. }
  6605. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6606. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6607. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6608. {
  6609. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6610. }
  6611. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6612. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6613. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6614. {
  6615. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6616. }
  6617. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6618. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6619. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6620. //{
  6621. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6622. //}
  6623. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6624. //{
  6625. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6626. //}
  6627. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6628. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6629. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6630. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6631. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6632. {
  6633. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6634. }
  6635. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6636. {
  6637. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6638. }
  6639. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6640. //{
  6641. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6642. //}
  6643. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6644. //--------责任员工-------------------
  6645. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6646. if (drRow.Length > Constant.INT_IS_ZERO)
  6647. {
  6648. if (defect.DefectResponsibles == null)
  6649. {
  6650. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6651. }
  6652. foreach (DataRow r in drRow)
  6653. {
  6654. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6655. if (r["SemiCheckDefectID"].ToString() != "")
  6656. {
  6657. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6658. }
  6659. if (r["StaffID"].ToString() != "")
  6660. {
  6661. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6662. }
  6663. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6664. defectResponsible.StaffName = r["StaffName"].ToString();
  6665. if (r["StaffStatus"].ToString() != "")
  6666. {
  6667. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6668. }
  6669. if (r["UJobsID"].ToString() != "")
  6670. {
  6671. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6672. }
  6673. if (r["SJobsID"].ToString() != "")
  6674. {
  6675. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6676. }
  6677. defect.DefectResponsibles.Add(defectResponsible);
  6678. }
  6679. }
  6680. //------------------------------
  6681. if (productionData.SemiCheckDefects == null)
  6682. {
  6683. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6684. }
  6685. productionData.SemiCheckDefects.Add(defect);
  6686. }
  6687. //if (productionDatas.PDAProductionData == null)
  6688. //{
  6689. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6690. //}
  6691. productionDatas[0] = productionData;
  6692. //---------------------------------------------------------------------------------
  6693. }
  6694. }
  6695. }
  6696. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6697. actionResult.Status = (int)Constant.PDAResult.Success;
  6698. }
  6699. catch (Exception ex)
  6700. {
  6701. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6702. OutputLog.TraceLog(LogPriority.Error,
  6703. this.ToString(),
  6704. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6705. ex.ToString(),
  6706. LocalPath.LogExePath);
  6707. actionResult.Status = (int)Constant.PDAResult.Exception;
  6708. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6709. }
  6710. return actionResult;
  6711. }
  6712. /// <summary>
  6713. /// 保存半检登记
  6714. /// </summary>
  6715. /// <param name="accountCode">帐套code</param>
  6716. /// <param name="userCode">用户code</param>
  6717. /// <param name="userPassword">用户密码</param>
  6718. /// <param name="sessionKey">本次登陆密钥</param>
  6719. /// <param name="entity">半检实体类</param>
  6720. /// <param name="sUserInfo">用户基本信息</param>
  6721. /// <returns></returns>
  6722. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6723. {
  6724. ActionResult actionResult = new ActionResult();
  6725. try
  6726. {
  6727. // 验证请求头信息
  6728. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6729. // 验证失败
  6730. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6731. {
  6732. return actionResult;
  6733. }
  6734. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6735. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6736. string err = string.Empty;
  6737. err = resultEntity.Message;
  6738. if (err == null)
  6739. {
  6740. err = "";
  6741. }
  6742. SemiCheckEntity entity = entityobj[0];
  6743. if (entity.SemiCheckCategory == 1) // 半检登记
  6744. {
  6745. }
  6746. else if (entity.SemiCheckCategory == 2)// 复检登记
  6747. {
  6748. err = JsonHelper.ToJson(err);
  6749. }
  6750. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6751. {
  6752. err = JsonHelper.ToJson(err);
  6753. }
  6754. //actionResult.Result = JsonHelper.ToJson(err);
  6755. actionResult.Result = err;//JsonHelper.ToJson(err);
  6756. actionResult.Status = (int)Constant.PDAResult.Success;
  6757. }
  6758. catch (Exception ex)
  6759. {
  6760. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6761. OutputLog.TraceLog(LogPriority.Error,
  6762. this.ToString(),
  6763. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6764. ex.ToString(),
  6765. LocalPath.LogExePath);
  6766. actionResult.Status = (int)Constant.PDAResult.Exception;
  6767. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6768. }
  6769. return actionResult;
  6770. }
  6771. /// <summary>
  6772. /// 根据所选工号,查出缺陷责任员工
  6773. /// </summary>
  6774. /// <param name="sUserInfo"></param>
  6775. /// <returns></returns>
  6776. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6777. {
  6778. ActionResult actionResult = new ActionResult();
  6779. try
  6780. {
  6781. // 验证请求头信息
  6782. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6783. // 验证失败
  6784. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6785. {
  6786. return actionResult;
  6787. }
  6788. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6789. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  6790. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6791. actionResult.Status = (int)Constant.PDAResult.Success;
  6792. }
  6793. catch (Exception ex)
  6794. {
  6795. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6796. OutputLog.TraceLog(LogPriority.Error,
  6797. this.ToString(),
  6798. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6799. ex.ToString(),
  6800. LocalPath.LogExePath);
  6801. actionResult.Status = (int)Constant.PDAResult.Exception;
  6802. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6803. }
  6804. return actionResult;
  6805. }
  6806. /// <summary>
  6807. /// 获取半成品缺陷管理的全部数据
  6808. /// </summary>
  6809. /// <param name="sUserInfo"></param>
  6810. /// <returns></returns>
  6811. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  6812. {
  6813. ActionResult actionResult = new ActionResult();
  6814. try
  6815. {
  6816. // 验证请求头信息
  6817. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6818. // 验证失败
  6819. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6820. {
  6821. return actionResult;
  6822. }
  6823. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6824. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  6825. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6826. actionResult.Status = (int)Constant.PDAResult.Success;
  6827. }
  6828. catch (Exception ex)
  6829. {
  6830. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6831. OutputLog.TraceLog(LogPriority.Error,
  6832. this.ToString(),
  6833. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6834. ex.ToString(),
  6835. LocalPath.LogExePath);
  6836. actionResult.Status = (int)Constant.PDAResult.Exception;
  6837. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6838. }
  6839. return actionResult;
  6840. }
  6841. /// <summary>
  6842. /// 获取半成品缺陷位置管理的全部数据
  6843. /// </summary>
  6844. /// <param name="sUserInfo"></param>
  6845. /// <returns></returns>
  6846. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  6847. {
  6848. ActionResult actionResult = new ActionResult();
  6849. try
  6850. {
  6851. // 验证请求头信息
  6852. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6853. // 验证失败
  6854. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6855. {
  6856. return actionResult;
  6857. }
  6858. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6859. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  6860. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6861. actionResult.Status = (int)Constant.PDAResult.Success;
  6862. }
  6863. catch (Exception ex)
  6864. {
  6865. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6866. OutputLog.TraceLog(LogPriority.Error,
  6867. this.ToString(),
  6868. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6869. ex.ToString(),
  6870. LocalPath.LogExePath);
  6871. actionResult.Status = (int)Constant.PDAResult.Exception;
  6872. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6873. }
  6874. return actionResult;
  6875. }
  6876. /// <summary>
  6877. /// 复检验条码
  6878. /// </summary>
  6879. /// <param name="sUserInfo"></param>
  6880. /// <returns></returns>
  6881. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6882. {
  6883. ActionResult actionResult = new ActionResult();
  6884. try
  6885. {
  6886. // 验证请求头信息
  6887. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6888. // 验证失败
  6889. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6890. {
  6891. return actionResult;
  6892. }
  6893. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6894. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  6895. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6896. if (Convert.ToInt32(resultEntity.Result) < 0)
  6897. {
  6898. actionResult.Status = (int)Constant.PDAResult.Fail;
  6899. }
  6900. else
  6901. {
  6902. actionResult.Status = (int)Constant.PDAResult.Success;
  6903. }
  6904. actionResult.Message = resultEntity.Message;
  6905. }
  6906. catch (Exception ex)
  6907. {
  6908. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6909. OutputLog.TraceLog(LogPriority.Error,
  6910. this.ToString(),
  6911. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6912. ex.ToString(),
  6913. LocalPath.LogExePath);
  6914. actionResult.Status = (int)Constant.PDAResult.Exception;
  6915. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6916. }
  6917. return actionResult;
  6918. }
  6919. /// <summary>
  6920. /// 撤销复检验条码
  6921. /// </summary>
  6922. /// <param name="sUserInfo"></param>
  6923. /// <returns></returns>
  6924. public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  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. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6937. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  6938. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6939. if (Convert.ToInt32(resultEntity.Result) < 0)
  6940. {
  6941. actionResult.Status = (int)Constant.PDAResult.Fail;
  6942. }
  6943. else
  6944. {
  6945. actionResult.Status = (int)Constant.PDAResult.Success;
  6946. }
  6947. actionResult.Message = resultEntity.Message;
  6948. }
  6949. catch (Exception ex)
  6950. {
  6951. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6952. OutputLog.TraceLog(LogPriority.Error,
  6953. this.ToString(),
  6954. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6955. ex.ToString(),
  6956. LocalPath.LogExePath);
  6957. actionResult.Status = (int)Constant.PDAResult.Exception;
  6958. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6959. }
  6960. return actionResult;
  6961. }
  6962. /// <summary>
  6963. /// 恢复数据
  6964. /// </summary>
  6965. /// <param name="sUserInfo"></param>
  6966. /// <returns></returns>
  6967. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6968. {
  6969. ActionResult actionResult = new ActionResult();
  6970. try
  6971. {
  6972. // 验证请求头信息
  6973. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6974. // 验证失败
  6975. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6976. {
  6977. return actionResult;
  6978. }
  6979. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6980. () => PMModuleLogicDAL.ResetBarCode(barcode));
  6981. if (resultEntity > 0)
  6982. {
  6983. actionResult.Status = (int)Constant.PDAResult.Success;
  6984. actionResult.Message = "恢复数据成功";
  6985. }
  6986. else
  6987. {
  6988. actionResult.Status = (int)Constant.PDAResult.Fail;
  6989. if (resultEntity == -1)
  6990. {
  6991. actionResult.Message = "此条码没有清除,不能恢复";
  6992. }
  6993. else if (resultEntity == 0)
  6994. {
  6995. actionResult.Message = "没有可恢复的数据";
  6996. }
  6997. }
  6998. }
  6999. catch (Exception ex)
  7000. {
  7001. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7002. OutputLog.TraceLog(LogPriority.Error,
  7003. this.ToString(),
  7004. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7005. ex.ToString(),
  7006. LocalPath.LogExePath);
  7007. actionResult.Status = (int)Constant.PDAResult.Exception;
  7008. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7009. }
  7010. return actionResult;
  7011. }
  7012. /// <summary>
  7013. /// 通过SettingCode获取系统参数管理的数据
  7014. /// </summary>
  7015. /// <param name="accountCode"></param>
  7016. /// <param name="userCode"></param>
  7017. /// <param name="userPassword"></param>
  7018. /// <param name="sessionKey"></param>
  7019. /// <param name="settingcode">设置编码</param>
  7020. /// <returns></returns>
  7021. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  7022. {
  7023. ActionResult actionResult = new ActionResult();
  7024. try
  7025. {
  7026. // 验证请求头信息
  7027. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7028. // 验证失败
  7029. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7030. {
  7031. return actionResult;
  7032. }
  7033. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7034. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  7035. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7036. actionResult.Status = (int)Constant.PDAResult.Success;
  7037. }
  7038. catch (Exception ex)
  7039. {
  7040. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7041. OutputLog.TraceLog(LogPriority.Error,
  7042. this.ToString(),
  7043. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7044. ex.ToString(),
  7045. LocalPath.LogExePath);
  7046. actionResult.Status = (int)Constant.PDAResult.Exception;
  7047. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7048. }
  7049. return actionResult;
  7050. }
  7051. /// <summary>
  7052. /// 校验条码是否允许撤销,如果不允许提示错误消息
  7053. /// </summary>
  7054. /// <param name="accountCode"></param>
  7055. /// <param name="userCode"></param>
  7056. /// <param name="userPassword"></param>
  7057. /// <param name="sessionKey"></param>
  7058. /// <param name="orgTime">原时间</param>
  7059. /// <param name="days">允许撤销天数</param>
  7060. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  7061. /// <returns></returns>
  7062. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  7063. {
  7064. ActionResult actionResult = new ActionResult();
  7065. try
  7066. {
  7067. // 验证请求头信息
  7068. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7069. // 验证失败
  7070. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7071. {
  7072. return actionResult;
  7073. }
  7074. string[] subOrgTime = orgTime.Split('-');
  7075. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  7076. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7077. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  7078. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7079. if (Convert.ToInt32(resultEntity.Result) < 0)
  7080. {
  7081. actionResult.Status = (int)Constant.PDAResult.Fail;
  7082. }
  7083. else
  7084. {
  7085. actionResult.Status = (int)Constant.PDAResult.Success;
  7086. }
  7087. actionResult.Message = resultEntity.Message;
  7088. }
  7089. catch (Exception ex)
  7090. {
  7091. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7092. OutputLog.TraceLog(LogPriority.Error,
  7093. this.ToString(),
  7094. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7095. ex.ToString(),
  7096. LocalPath.LogExePath);
  7097. actionResult.Status = (int)Constant.PDAResult.Exception;
  7098. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7099. }
  7100. return actionResult;
  7101. }
  7102. /// <summary>
  7103. /// 获取生产订单管理的全部数据
  7104. /// </summary>
  7105. /// <param name="sUserInfo"></param>
  7106. /// <returns></returns>
  7107. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  7108. {
  7109. ActionResult actionResult = new ActionResult();
  7110. try
  7111. {
  7112. // 验证请求头信息
  7113. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7114. // 验证失败
  7115. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7116. {
  7117. return actionResult;
  7118. }
  7119. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7120. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  7121. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7122. actionResult.Status = (int)Constant.PDAResult.Success;
  7123. }
  7124. catch (Exception ex)
  7125. {
  7126. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7127. OutputLog.TraceLog(LogPriority.Error,
  7128. this.ToString(),
  7129. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7130. ex.ToString(),
  7131. LocalPath.LogExePath);
  7132. actionResult.Status = (int)Constant.PDAResult.Exception;
  7133. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7134. }
  7135. return actionResult;
  7136. }
  7137. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7138. {
  7139. ActionResult actionResult = new ActionResult();
  7140. try
  7141. {
  7142. // 验证请求头信息
  7143. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7144. // 验证失败
  7145. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7146. {
  7147. return actionResult;
  7148. }
  7149. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7150. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  7151. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7152. if (Convert.ToInt32(resultEntity.Result) < 0)
  7153. {
  7154. actionResult.Status = (int)Constant.PDAResult.Fail;
  7155. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  7156. }
  7157. else
  7158. {
  7159. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  7160. actionResult.Status = (int)Constant.PDAResult.Success;
  7161. }
  7162. actionResult.Message = resultEntity.Message;
  7163. }
  7164. catch (Exception ex)
  7165. {
  7166. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7167. OutputLog.TraceLog(LogPriority.Error,
  7168. this.ToString(),
  7169. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7170. ex.ToString(),
  7171. LocalPath.LogExePath);
  7172. actionResult.Status = (int)Constant.PDAResult.Exception;
  7173. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7174. }
  7175. return actionResult;
  7176. }
  7177. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  7178. {
  7179. ActionResult actionResult = new ActionResult();
  7180. try
  7181. {
  7182. // 验证请求头信息
  7183. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7184. // 验证失败
  7185. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7186. {
  7187. return actionResult;
  7188. }
  7189. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7190. () => SystemModuleLogic.GetSystemData(sUserInfo));
  7191. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7192. actionResult.Status = (int)Constant.PDAResult.Success;
  7193. }
  7194. catch (Exception ex)
  7195. {
  7196. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7197. OutputLog.TraceLog(LogPriority.Error,
  7198. this.ToString(),
  7199. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7200. ex.ToString(),
  7201. LocalPath.LogExePath);
  7202. actionResult.Status = (int)Constant.PDAResult.Exception;
  7203. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7204. }
  7205. return actionResult;
  7206. }
  7207. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  7208. {
  7209. ActionResult actionResult = new ActionResult();
  7210. try
  7211. {
  7212. // 验证请求头信息
  7213. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7214. // 验证失败
  7215. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7216. {
  7217. return actionResult;
  7218. }
  7219. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  7220. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7221. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  7222. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7223. if (Convert.ToInt32(resultEntity.Result) < 0)
  7224. {
  7225. actionResult.Status = (int)Constant.PDAResult.Fail;
  7226. }
  7227. else
  7228. {
  7229. actionResult.Status = (int)Constant.PDAResult.Success;
  7230. }
  7231. actionResult.Message = resultEntity.Message;
  7232. }
  7233. catch (Exception ex)
  7234. {
  7235. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7236. OutputLog.TraceLog(LogPriority.Error,
  7237. this.ToString(),
  7238. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7239. ex.ToString(),
  7240. LocalPath.LogExePath);
  7241. actionResult.Status = (int)Constant.PDAResult.Exception;
  7242. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7243. }
  7244. return actionResult;
  7245. }
  7246. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7247. {
  7248. ActionResult actionResult = new ActionResult();
  7249. try
  7250. {
  7251. // 验证请求头信息
  7252. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7253. // 验证失败
  7254. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7255. {
  7256. return actionResult;
  7257. }
  7258. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7259. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7260. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7261. if (Convert.ToInt32(resultEntity.Result) < 0)
  7262. {
  7263. actionResult.Status = (int)Constant.PDAResult.Fail;
  7264. }
  7265. else
  7266. {
  7267. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7268. actionResult.Status = (int)Constant.PDAResult.Success;
  7269. }
  7270. actionResult.Message = resultEntity.Message;
  7271. }
  7272. catch (Exception ex)
  7273. {
  7274. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7275. OutputLog.TraceLog(LogPriority.Error,
  7276. this.ToString(),
  7277. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7278. ex.ToString(),
  7279. LocalPath.LogExePath);
  7280. actionResult.Status = (int)Constant.PDAResult.Exception;
  7281. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7282. }
  7283. return actionResult;
  7284. }
  7285. public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7286. {
  7287. ActionResult actionResult = new ActionResult();
  7288. try
  7289. {
  7290. // 验证请求头信息
  7291. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7292. // 验证失败
  7293. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7294. {
  7295. return actionResult;
  7296. }
  7297. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7298. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7299. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7300. if (Convert.ToInt32(resultEntity.Result) < 0)
  7301. {
  7302. actionResult.Status = (int)Constant.PDAResult.Fail;
  7303. }
  7304. else
  7305. {
  7306. actionResult.Status = (int)Constant.PDAResult.Success;
  7307. }
  7308. actionResult.Message = resultEntity.Message;
  7309. }
  7310. catch (Exception ex)
  7311. {
  7312. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7313. OutputLog.TraceLog(LogPriority.Error,
  7314. this.ToString(),
  7315. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7316. ex.ToString(),
  7317. LocalPath.LogExePath);
  7318. actionResult.Status = (int)Constant.PDAResult.Exception;
  7319. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7320. }
  7321. return actionResult;
  7322. }
  7323. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7324. {
  7325. ActionResult actionResult = new ActionResult();
  7326. try
  7327. {
  7328. // 验证请求头信息
  7329. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7330. // 验证失败
  7331. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7332. {
  7333. return actionResult;
  7334. }
  7335. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7336. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7337. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7338. if (Convert.ToInt32(resultEntity.Result) < 0)
  7339. {
  7340. actionResult.Status = (int)Constant.PDAResult.Fail;
  7341. }
  7342. else
  7343. {
  7344. actionResult.Status = (int)Constant.PDAResult.Success;
  7345. }
  7346. actionResult.Message = resultEntity.Message;
  7347. }
  7348. catch (Exception ex)
  7349. {
  7350. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7351. OutputLog.TraceLog(LogPriority.Error,
  7352. this.ToString(),
  7353. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7354. ex.ToString(),
  7355. LocalPath.LogExePath);
  7356. actionResult.Status = (int)Constant.PDAResult.Exception;
  7357. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7358. }
  7359. return actionResult;
  7360. }
  7361. #region PDA条码打印
  7362. /// <summary>
  7363. /// 获取条码打印机
  7364. /// </summary>
  7365. /// <param name="accountCode"></param>
  7366. /// <param name="userCode"></param>
  7367. /// <param name="userPassword"></param>
  7368. /// <param name="sessionKey"></param>
  7369. /// <returns></returns>
  7370. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printType=0)
  7371. {
  7372. ActionResult actionResult = new ActionResult();
  7373. try
  7374. {
  7375. // 验证请求头信息
  7376. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7377. // 验证失败
  7378. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7379. {
  7380. return actionResult;
  7381. }
  7382. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType);
  7383. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7384. actionResult.Status = (int)Constant.PDAResult.Success;
  7385. }
  7386. catch (Exception ex)
  7387. {
  7388. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7389. OutputLog.TraceLog(LogPriority.Error,
  7390. this.ToString(),
  7391. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7392. ex.ToString(),
  7393. LocalPath.LogExePath);
  7394. actionResult.Status = (int)Constant.PDAResult.Exception;
  7395. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7396. }
  7397. return actionResult;
  7398. }
  7399. /// <summary>
  7400. /// 打印条码样式(补打)
  7401. /// </summary>
  7402. /// <param name="accountCode"></param>
  7403. /// <param name="userCode"></param>
  7404. /// <param name="userPassword"></param>
  7405. /// <param name="sessionKey"></param>
  7406. /// <returns></returns>
  7407. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey,
  7408. string barcode, int copies, int printerID, int printWay=2)
  7409. {
  7410. ActionResult actionResult = new ActionResult();
  7411. try
  7412. {
  7413. // 验证请求头信息
  7414. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7415. // 验证失败
  7416. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7417. {
  7418. return actionResult;
  7419. }
  7420. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7421. // copies, printerID, sUserInfo);
  7422. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(barcode,
  7423. copies, printerID, sUserInfo, printWay);
  7424. if (sre.Status != Constant.ServiceResultStatus.Success)
  7425. {
  7426. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7427. actionResult.Message = sre.Message;
  7428. return actionResult;
  7429. }
  7430. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7431. actionResult.Status = (int)Constant.PDAResult.Success;
  7432. }
  7433. catch (Exception ex)
  7434. {
  7435. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7436. OutputLog.TraceLog(LogPriority.Error,
  7437. this.ToString(),
  7438. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7439. ex.ToString(),
  7440. LocalPath.LogExePath);
  7441. actionResult.Status = (int)Constant.PDAResult.Exception;
  7442. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7443. }
  7444. return actionResult;
  7445. }
  7446. #endregion PDA条码打印
  7447. #region 统计报表
  7448. /// <summary>
  7449. /// 成型结算报表
  7450. /// </summary>
  7451. /// <param name="accountCode"></param>
  7452. /// <param name="userCode"></param>
  7453. /// <param name="userPassword"></param>
  7454. /// <param name="sessionKey"></param>
  7455. /// <returns></returns>
  7456. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7457. int currentMonth)
  7458. {
  7459. ActionResult actionResult = new ActionResult();
  7460. try
  7461. {
  7462. // 验证请求头信息
  7463. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7464. // 验证失败
  7465. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7466. {
  7467. return actionResult;
  7468. }
  7469. DateTime date = DateTime.Now;
  7470. if (currentMonth != 1)
  7471. {
  7472. date = date.AddMonths(-1);
  7473. }
  7474. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7475. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7476. if (resultEntity == null || resultEntity.Data == null)
  7477. {
  7478. actionResult.Status = (int)Constant.PDAResult.Fail;
  7479. actionResult.Message = "查询失败";
  7480. return actionResult;
  7481. }
  7482. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7483. {
  7484. actionResult.Status = (int)Constant.PDAResult.Fail;
  7485. actionResult.Message = resultEntity.Message;
  7486. return actionResult;
  7487. }
  7488. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7489. actionResult.Status = (int)Constant.PDAResult.Success;
  7490. }
  7491. catch (Exception ex)
  7492. {
  7493. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7494. OutputLog.TraceLog(LogPriority.Error,
  7495. this.ToString(),
  7496. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7497. ex.ToString(),
  7498. LocalPath.LogExePath);
  7499. actionResult.Status = (int)Constant.PDAResult.Exception;
  7500. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7501. }
  7502. return actionResult;
  7503. }
  7504. #endregion
  7505. #region 设置当期用户默认打印机配置
  7506. /// <summary>
  7507. /// 设置当期用户默认打印机配置
  7508. /// </summary>
  7509. /// <param name="accountCode"></param>
  7510. /// <param name="userCode"></param>
  7511. /// <param name="userPassword"></param>
  7512. /// <param name="sessionKey"></param>
  7513. /// <param name="printerID"></param>
  7514. /// <returns></returns>
  7515. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7516. int printerID)
  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. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7529. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7530. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7531. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7532. {
  7533. actionResult.Status = (int)Constant.PDAResult.Fail;
  7534. }
  7535. else
  7536. {
  7537. actionResult.Status = (int)Constant.PDAResult.Success;
  7538. }
  7539. actionResult.Message = resultEntity.Message;
  7540. }
  7541. catch (Exception ex)
  7542. {
  7543. OutputLog.TraceLog(LogPriority.Error,
  7544. this.ToString(),
  7545. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7546. ex.ToString(),
  7547. LocalPath.LogExePath);
  7548. actionResult.Status = (int)Constant.PDAResult.Exception;
  7549. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7550. }
  7551. return actionResult;
  7552. }
  7553. /// <summary>
  7554. /// 校验产品条码是否可以进行回收
  7555. /// </summary>
  7556. /// <param name="accountCode">帐套code</param>
  7557. /// <param name="userCode">用户code</param>
  7558. /// <param name="userPassword">用户密码</param>
  7559. /// <param name="sessionKey">本次登陆密钥</param>
  7560. /// <param name="procedureID">工序ID</param>
  7561. /// <param name="barcode">条码</param>
  7562. /// <returns></returns>
  7563. /// <remarks>
  7564. /// 王鑫 2017.7.21 新建
  7565. /// </remarks>
  7566. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7567. {
  7568. ActionResult actionResult = new ActionResult();
  7569. try
  7570. {
  7571. // 验证请求头信息
  7572. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7573. // 验证失败
  7574. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7575. {
  7576. return actionResult;
  7577. }
  7578. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7579. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7580. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7581. {
  7582. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7583. actionResult.Status = (int)Constant.PDAResult.Success;
  7584. }
  7585. else
  7586. {
  7587. actionResult.Status = (int)Constant.PDAResult.Fail;
  7588. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7589. }
  7590. }
  7591. catch (Exception ex)
  7592. {
  7593. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7594. OutputLog.TraceLog(LogPriority.Error,
  7595. this.ToString(),
  7596. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7597. ex.ToString(),
  7598. LocalPath.LogExePath);
  7599. actionResult.Status = (int)Constant.PDAResult.Exception;
  7600. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7601. }
  7602. return actionResult;
  7603. }
  7604. /// <summary>
  7605. /// 获取回收标识
  7606. /// </summary>
  7607. /// <param name="accountCode"></param>
  7608. /// <param name="userCode"></param>
  7609. /// <param name="userPassword"></param>
  7610. /// <param name="sessionKey"></param>
  7611. /// <param name="usercode">工号编码</param>
  7612. /// <returns></returns>
  7613. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7614. {
  7615. ActionResult actionResult = new ActionResult();
  7616. try
  7617. {
  7618. // 验证请求头信息
  7619. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7620. // 验证失败
  7621. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7622. {
  7623. return actionResult;
  7624. }
  7625. int returnValue = ServiceInvoker.Invoke<int>(this,
  7626. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7627. actionResult.Result = JsonHelper.ToJson(returnValue);
  7628. actionResult.Status = (int)Constant.PDAResult.Success;
  7629. }
  7630. catch (Exception ex)
  7631. {
  7632. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7633. OutputLog.TraceLog(LogPriority.Error,
  7634. this.ToString(),
  7635. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7636. ex.ToString(),
  7637. LocalPath.LogExePath);
  7638. actionResult.Status = (int)Constant.PDAResult.Exception;
  7639. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7640. }
  7641. return actionResult;
  7642. }
  7643. #endregion
  7644. #region 注浆盘点
  7645. /// <summary>
  7646. /// 获取注浆盘点单列表
  7647. /// </summary>
  7648. /// <param name="sUserInfo"></param>
  7649. /// <returns></returns>
  7650. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7651. {
  7652. ActionResult actionResult = new ActionResult();
  7653. try
  7654. {
  7655. // 验证请求头信息
  7656. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7657. // 验证失败
  7658. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7659. {
  7660. return actionResult;
  7661. }
  7662. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7663. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7664. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7665. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7666. actionResult.Result = JsonHelper.ToJson(ds);
  7667. actionResult.Status = (int)Constant.PDAResult.Success;
  7668. }
  7669. catch (Exception ex)
  7670. {
  7671. string json = JsonHelper.ToJson(entity);
  7672. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7673. OutputLog.TraceLog(LogPriority.Error,
  7674. this.ToString(),
  7675. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7676. ex.ToString(),
  7677. LocalPath.LogExePath);
  7678. actionResult.Status = (int)Constant.PDAResult.Exception;
  7679. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7680. }
  7681. return actionResult;
  7682. }
  7683. /// <summary>
  7684. /// 进行盘点操作
  7685. /// </summary>
  7686. /// <param name="accountCode"></param>
  7687. /// <param name="userCode"></param>
  7688. /// <param name="userPassword"></param>
  7689. /// <param name="sessionKey"></param>
  7690. /// <param name="InCheckedID">盘点单ID</param>
  7691. /// <param name="BarCode">产品条码</param>
  7692. /// <returns></returns>
  7693. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7694. {
  7695. ActionResult actionResult = new ActionResult();
  7696. try
  7697. {
  7698. // 验证请求头信息
  7699. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7700. // 验证失败
  7701. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7702. {
  7703. return actionResult;
  7704. }
  7705. ClientRequestEntity cre = new ClientRequestEntity();
  7706. cre.Properties["CheckedID"] = CheckedID;
  7707. cre.Properties["Barcode"] = BarCode;
  7708. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7709. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7710. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7711. {
  7712. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7713. actionResult.Status = (int)Constant.PDAResult.Success;
  7714. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7715. }
  7716. else
  7717. {
  7718. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7719. actionResult.Status = (int)Constant.PDAResult.Fail;
  7720. actionResult.Message = returnValue.Message;
  7721. }
  7722. }
  7723. catch (Exception ex)
  7724. {
  7725. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7726. OutputLog.TraceLog(LogPriority.Error,
  7727. this.ToString(),
  7728. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7729. ex.ToString(),
  7730. LocalPath.LogExePath);
  7731. actionResult.Status = (int)Constant.PDAResult.Exception;
  7732. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7733. }
  7734. return actionResult;
  7735. }
  7736. /// <summary>
  7737. /// 获取盘点单明细
  7738. /// </summary>
  7739. /// <param name="sUserInfo"></param>
  7740. /// <returns></returns>
  7741. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7742. {
  7743. ActionResult actionResult = new ActionResult();
  7744. try
  7745. {
  7746. // 验证请求头信息
  7747. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7748. // 验证失败
  7749. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7750. {
  7751. return actionResult;
  7752. }
  7753. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7754. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  7755. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  7756. actionResult.Result = JsonHelper.ToJson(ds);
  7757. actionResult.Status = (int)Constant.PDAResult.Success;
  7758. }
  7759. catch (Exception ex)
  7760. {
  7761. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7762. OutputLog.TraceLog(LogPriority.Error,
  7763. this.ToString(),
  7764. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7765. ex.ToString(),
  7766. LocalPath.LogExePath);
  7767. actionResult.Status = (int)Constant.PDAResult.Exception;
  7768. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7769. }
  7770. return actionResult;
  7771. }
  7772. #endregion
  7773. #region 模具盘点
  7774. /// <summary>
  7775. /// 获取模具盘点单列表
  7776. /// </summary>
  7777. /// <param name="sUserInfo"></param>
  7778. /// <returns></returns>
  7779. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7780. {
  7781. ActionResult actionResult = new ActionResult();
  7782. try
  7783. {
  7784. // 验证请求头信息
  7785. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7786. // 验证失败
  7787. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7788. {
  7789. return actionResult;
  7790. }
  7791. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7792. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7793. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7794. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  7795. actionResult.Result = JsonHelper.ToJson(ds);
  7796. actionResult.Status = (int)Constant.PDAResult.Success;
  7797. }
  7798. catch (Exception ex)
  7799. {
  7800. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7801. OutputLog.TraceLog(LogPriority.Error,
  7802. this.ToString(),
  7803. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7804. ex.ToString(),
  7805. LocalPath.LogExePath);
  7806. actionResult.Status = (int)Constant.PDAResult.Exception;
  7807. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7808. }
  7809. return actionResult;
  7810. }
  7811. /// <summary>
  7812. /// 进行盘点操作
  7813. /// </summary>
  7814. /// <param name="accountCode"></param>
  7815. /// <param name="userCode"></param>
  7816. /// <param name="userPassword"></param>
  7817. /// <param name="sessionKey"></param>
  7818. /// <param name="InCheckedID">盘点单ID</param>
  7819. /// <param name="BarCode">产品条码</param>
  7820. /// <returns></returns>
  7821. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7822. {
  7823. ActionResult actionResult = new ActionResult();
  7824. try
  7825. {
  7826. // 验证请求头信息
  7827. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7828. // 验证失败
  7829. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7830. {
  7831. return actionResult;
  7832. }
  7833. ClientRequestEntity cre = new ClientRequestEntity();
  7834. cre.Properties["CheckedID"] = CheckedID;
  7835. cre.Properties["Barcode"] = BarCode;
  7836. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7837. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  7838. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7839. {
  7840. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7841. actionResult.Status = (int)Constant.PDAResult.Success;
  7842. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7843. }
  7844. else
  7845. {
  7846. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7847. actionResult.Status = (int)Constant.PDAResult.Fail;
  7848. actionResult.Message = returnValue.Message;
  7849. }
  7850. }
  7851. catch (Exception ex)
  7852. {
  7853. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7854. OutputLog.TraceLog(LogPriority.Error,
  7855. this.ToString(),
  7856. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7857. ex.ToString(),
  7858. LocalPath.LogExePath);
  7859. actionResult.Status = (int)Constant.PDAResult.Exception;
  7860. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7861. }
  7862. return actionResult;
  7863. }
  7864. /// <summary>
  7865. /// 获取盘点单明细
  7866. /// </summary>
  7867. /// <param name="sUserInfo"></param>
  7868. /// <returns></returns>
  7869. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7870. {
  7871. ActionResult actionResult = new ActionResult();
  7872. try
  7873. {
  7874. // 验证请求头信息
  7875. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7876. // 验证失败
  7877. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7878. {
  7879. return actionResult;
  7880. }
  7881. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7882. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  7883. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  7884. actionResult.Result = JsonHelper.ToJson(ds);
  7885. actionResult.Status = (int)Constant.PDAResult.Success;
  7886. }
  7887. catch (Exception ex)
  7888. {
  7889. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7890. OutputLog.TraceLog(LogPriority.Error,
  7891. this.ToString(),
  7892. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7893. ex.ToString(),
  7894. LocalPath.LogExePath);
  7895. actionResult.Status = (int)Constant.PDAResult.Exception;
  7896. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7897. }
  7898. return actionResult;
  7899. }
  7900. #endregion
  7901. #region 通用接口
  7902. /// <summary>
  7903. /// PDA调用通用接口
  7904. /// </summary>
  7905. /// <param name="accountCode"></param>
  7906. /// <param name="userCode"></param>
  7907. /// <param name="userPassword"></param>
  7908. /// <param name="sessionKey"></param>
  7909. /// <param name="module"></param>
  7910. /// <param name="action"></param>
  7911. /// <param name="data"></param>
  7912. /// <returns></returns>
  7913. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  7914. string module, string action, string jsonData)
  7915. {
  7916. ActionResult actionResult = null;
  7917. try
  7918. {
  7919. // 验证请求头信息
  7920. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7921. // 验证失败
  7922. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7923. {
  7924. return actionResult;
  7925. }
  7926. actionResult.Status = (int)Constant.PDAResult.Fail;
  7927. Dictionary<string, object> data = null;
  7928. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  7929. {
  7930. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  7931. }
  7932. #region PDA报表
  7933. if (module == "Report")
  7934. {
  7935. // 成型月度结算
  7936. if (action == "GetGroutingSettlementInfo")
  7937. {
  7938. DateTime month = DateTime.Now;
  7939. month = new DateTime(month.Year, month.Month, 1);
  7940. //month = new DateTime(2017, 6, 1);
  7941. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7942. if (currentMonth != 1)
  7943. {
  7944. month = month.AddMonths(-1);
  7945. }
  7946. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  7947. if (sre.Status == Constant.ServiceResultStatus.Success)
  7948. {
  7949. actionResult.Status = (int)Constant.PDAResult.Success;
  7950. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7951. }
  7952. else
  7953. {
  7954. actionResult.Status = (int)Constant.PDAResult.Fail;
  7955. actionResult.Message = sre.Message;
  7956. }
  7957. return actionResult;
  7958. }
  7959. // 成型月度结算-明细
  7960. if (action == "GetGroutingSettlementDetail")
  7961. {
  7962. DateTime month = DateTime.Now;
  7963. month = new DateTime(month.Year, month.Month, 1);
  7964. //month = new DateTime(2017, 6, 1);
  7965. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7966. if (currentMonth != 1)
  7967. {
  7968. month = month.AddMonths(-1);
  7969. }
  7970. string goodsCode = data["GoodsCode"].ToString();
  7971. string detailDate = data["DetailDate"].ToString();
  7972. DateTime? date = null;
  7973. if (detailDate != "合计")
  7974. {
  7975. date = DateTime.Parse(detailDate);
  7976. }
  7977. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  7978. if (sre.Status == Constant.ServiceResultStatus.Success)
  7979. {
  7980. actionResult.Status = (int)Constant.PDAResult.Success;
  7981. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7982. }
  7983. else
  7984. {
  7985. actionResult.Status = (int)Constant.PDAResult.Fail;
  7986. actionResult.Message = sre.Message;
  7987. }
  7988. return actionResult;
  7989. }
  7990. // 产成品交接汇总
  7991. if (action == "GetFinishedProductHandoverSum")
  7992. {
  7993. DateTime date = DateTime.Parse(data["date"].ToString());
  7994. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  7995. data["goodscode"] as string, sUserInfo);
  7996. if (sre.Status == Constant.ServiceResultStatus.Success)
  7997. {
  7998. actionResult.Status = (int)Constant.PDAResult.Success;
  7999. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8000. }
  8001. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  8002. {
  8003. actionResult.Status = (int)Constant.PDAResult.Success;
  8004. }
  8005. else
  8006. {
  8007. actionResult.Status = (int)Constant.PDAResult.Fail;
  8008. actionResult.Message = sre.Message;
  8009. }
  8010. return actionResult;
  8011. }
  8012. //xuwei add 2019-10-21
  8013. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  8014. if (action == "GetSemiReworkDayCount")
  8015. {
  8016. //不指定参数查询当天
  8017. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  8018. //dateStr = "2019-10-17";
  8019. //指定参数查询特定日期
  8020. if(data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  8021. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  8022. if (sre.Status == Constant.ServiceResultStatus.Success)
  8023. {
  8024. actionResult.Status = (int)Constant.PDAResult.Success;
  8025. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8026. }
  8027. else
  8028. {
  8029. actionResult.Status = (int)Constant.PDAResult.Fail;
  8030. actionResult.Message = sre.Message;
  8031. }
  8032. return actionResult;
  8033. }
  8034. //xuwe end
  8035. return actionResult;
  8036. }
  8037. #endregion
  8038. #region 模具管理
  8039. if (module == "PC_Mould")
  8040. {
  8041. #region 模具新建画面数据初始化
  8042. if (action == "GetMouldAddInit")
  8043. {
  8044. ClientRequestEntity cre = new ClientRequestEntity();
  8045. cre.Properties["MouldID"] = 0;
  8046. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  8047. if (sre.Status == Constant.ServiceResultStatus.Success)
  8048. {
  8049. actionResult.Status = (int)Constant.PDAResult.Success;
  8050. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8051. }
  8052. else
  8053. {
  8054. actionResult.Status = (int)Constant.PDAResult.Fail;
  8055. actionResult.Message = sre.Message;
  8056. }
  8057. return actionResult;
  8058. }
  8059. #endregion
  8060. #region 验证模具产品型号
  8061. if (action == "CheckGoodsCodeOnMould")
  8062. {
  8063. ClientRequestEntity cre = new ClientRequestEntity();
  8064. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8065. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  8066. if (sre.Status == Constant.ServiceResultStatus.Success &&
  8067. sre.Data.Tables[0].Rows.Count > 0)
  8068. {
  8069. actionResult.Status = (int)Constant.PDAResult.Success;
  8070. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8071. }
  8072. else
  8073. {
  8074. actionResult.Status = (int)Constant.PDAResult.Fail;
  8075. actionResult.Message = "无效产品型号";
  8076. }
  8077. return actionResult;
  8078. }
  8079. #endregion
  8080. #region 验证模具生产工号
  8081. if (action == "CheckUserCodeOnMould")
  8082. {
  8083. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  8084. if (sre != null && sre.Rows.Count > 0)
  8085. {
  8086. actionResult.Status = (int)Constant.PDAResult.Success;
  8087. actionResult.Result = JsonHelper.ToJson(sre);
  8088. }
  8089. else
  8090. {
  8091. actionResult.Status = (int)Constant.PDAResult.Fail;
  8092. actionResult.Message = "无效生产工号";
  8093. }
  8094. return actionResult;
  8095. }
  8096. #endregion
  8097. #region 新建保存
  8098. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  8099. {
  8100. ClientRequestEntity cre = new ClientRequestEntity();
  8101. foreach (string item in data.Keys)
  8102. {
  8103. if (item == "ProductionDate")
  8104. {
  8105. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  8106. }
  8107. else
  8108. {
  8109. cre.Properties.Add(item, data[item]);
  8110. }
  8111. }
  8112. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  8113. if (sre.Status == Constant.ServiceResultStatus.Success)
  8114. {
  8115. actionResult.Status = (int)Constant.PDAResult.Success;
  8116. }
  8117. else
  8118. {
  8119. actionResult.Status = (int)Constant.PDAResult.Fail;
  8120. actionResult.Result = sre.OtherStatus;
  8121. actionResult.Message = sre.Message;
  8122. }
  8123. return actionResult;
  8124. }
  8125. #endregion
  8126. #region 模具编辑画面数据初始化
  8127. if (action == "GetMouldEditInfo")
  8128. {
  8129. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  8130. if (sre != null && sre.Rows.Count > 0)
  8131. {
  8132. actionResult.Status = (int)Constant.PDAResult.Success;
  8133. actionResult.Result = JsonHelper.ToJson(sre);
  8134. }
  8135. else
  8136. {
  8137. actionResult.Status = (int)Constant.PDAResult.Fail;
  8138. actionResult.Message = "无效模具条码";
  8139. }
  8140. return actionResult;
  8141. }
  8142. #endregion
  8143. #region 模具操作-画面初始化
  8144. if (action == "GetMouldOperationInit")
  8145. {
  8146. ClientRequestEntity cre = new ClientRequestEntity();
  8147. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8148. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8149. if (sre.Status == Constant.ServiceResultStatus.Success)
  8150. {
  8151. actionResult.Status = (int)Constant.PDAResult.Success;
  8152. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8153. }
  8154. else
  8155. {
  8156. actionResult.Status = (int)Constant.PDAResult.Fail;
  8157. actionResult.Result = sre.OtherStatus;
  8158. actionResult.Message = sre.Message;
  8159. }
  8160. return actionResult;
  8161. }
  8162. #endregion
  8163. #region 模具操作-验证模具条码
  8164. if (action == "CheckMouldBarcode")
  8165. {
  8166. ClientRequestEntity cre = new ClientRequestEntity();
  8167. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8168. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8169. if (sre.Status == Constant.ServiceResultStatus.Success)
  8170. {
  8171. if (sre.Data.Tables[0].Rows.Count == 0)
  8172. {
  8173. actionResult.Status = (int)Constant.PDAResult.Fail;
  8174. actionResult.Result = -1;
  8175. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8176. return actionResult;
  8177. }
  8178. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8179. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8180. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8181. #region 报损
  8182. if (mouldOperationType == 2)
  8183. {
  8184. if (mouldStatusID == 1 || mouldStatusID == 3)
  8185. {
  8186. actionResult.Status = (int)Constant.PDAResult.Success;
  8187. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8188. }
  8189. else
  8190. {
  8191. actionResult.Status = (int)Constant.PDAResult.Fail;
  8192. actionResult.Result = -2;
  8193. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8194. }
  8195. return actionResult;
  8196. }
  8197. #endregion
  8198. #region 撤销
  8199. if (mouldOperationType == 3)
  8200. {
  8201. if (mouldStatusID == 4)
  8202. {
  8203. actionResult.Status = (int)Constant.PDAResult.Success;
  8204. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8205. }
  8206. else
  8207. {
  8208. actionResult.Status = (int)Constant.PDAResult.Fail;
  8209. actionResult.Result = -2;
  8210. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  8211. }
  8212. return actionResult;
  8213. }
  8214. #endregion
  8215. #region 领用
  8216. if (mouldOperationType == 4)
  8217. {
  8218. if (mouldStatusID == 1)
  8219. {
  8220. actionResult.Status = (int)Constant.PDAResult.Success;
  8221. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8222. }
  8223. else
  8224. {
  8225. actionResult.Status = (int)Constant.PDAResult.Fail;
  8226. actionResult.Result = -2;
  8227. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  8228. }
  8229. return actionResult;
  8230. }
  8231. #endregion
  8232. #region 回收
  8233. if (mouldOperationType == 5)
  8234. {
  8235. if (mouldStatusID == 3)
  8236. {
  8237. actionResult.Status = (int)Constant.PDAResult.Success;
  8238. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8239. }
  8240. else
  8241. {
  8242. actionResult.Status = (int)Constant.PDAResult.Fail;
  8243. actionResult.Result = -2;
  8244. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  8245. }
  8246. return actionResult;
  8247. }
  8248. #endregion
  8249. #region 变更型号
  8250. if (mouldOperationType == -1)
  8251. {
  8252. if (mouldStatusID != 4)
  8253. {
  8254. actionResult.Status = (int)Constant.PDAResult.Success;
  8255. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8256. }
  8257. else
  8258. {
  8259. actionResult.Status = (int)Constant.PDAResult.Fail;
  8260. actionResult.Result = -2;
  8261. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  8262. }
  8263. return actionResult;
  8264. }
  8265. #endregion
  8266. #region 替换条码
  8267. if (mouldOperationType == -2)
  8268. {
  8269. actionResult.Status = (int)Constant.PDAResult.Success;
  8270. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8271. return actionResult;
  8272. }
  8273. #endregion
  8274. return actionResult;
  8275. }
  8276. }
  8277. #endregion
  8278. #region 模具操作-保存
  8279. if (action == "SetMouldOperation")
  8280. {
  8281. ClientRequestEntity cre = new ClientRequestEntity();
  8282. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8283. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8284. cre.Properties["Remarks"] = data["Remarks"];
  8285. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8286. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8287. {
  8288. cre.Properties["GoodsID"] = data["GoodsID"];
  8289. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8290. }
  8291. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8292. {
  8293. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8294. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8295. }
  8296. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8297. if (sre.Status == Constant.ServiceResultStatus.Success)
  8298. {
  8299. actionResult.Status = (int)Constant.PDAResult.Success;
  8300. }
  8301. else
  8302. {
  8303. actionResult.Status = (int)Constant.PDAResult.Fail;
  8304. }
  8305. return actionResult;
  8306. }
  8307. #endregion
  8308. #region 模具操作-替换条码
  8309. if (action == "ChangedMouldBarcode")
  8310. {
  8311. ClientRequestEntity cre = new ClientRequestEntity();
  8312. cre.Properties["MouldID"] = data["MouldID"];
  8313. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8314. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8315. cre.Properties["Remarks"] = data["Remarks"];
  8316. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8317. if (sre.Status == Constant.ServiceResultStatus.Success)
  8318. {
  8319. actionResult.Status = (int)Constant.PDAResult.Success;
  8320. }
  8321. else
  8322. {
  8323. actionResult.Status = (int)Constant.PDAResult.Fail;
  8324. actionResult.Result = sre.OtherStatus;
  8325. actionResult.Message = sre.Message;
  8326. }
  8327. return actionResult;
  8328. }
  8329. #endregion
  8330. #region 模具跟踪表
  8331. if (action == "GetMoldTracking")
  8332. {
  8333. ClientRequestEntity cre = new ClientRequestEntity();
  8334. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8335. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8336. if (sre.Status == Constant.ServiceResultStatus.Success)
  8337. {
  8338. actionResult.Status = (int)Constant.PDAResult.Success;
  8339. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8340. }
  8341. else
  8342. {
  8343. actionResult.Status = (int)Constant.PDAResult.Fail;
  8344. actionResult.Message = "此模具条码不存在";
  8345. }
  8346. return actionResult;
  8347. }
  8348. #endregion
  8349. return actionResult;
  8350. }
  8351. #endregion
  8352. #region 成型线模具管理
  8353. if (module == "PC_GroutingLineMould")
  8354. {
  8355. #region 获取当前用户成型线模具管理权限
  8356. if (action == "GetGMouldStatusRight")
  8357. {
  8358. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8359. actionResult.Status = (int)Constant.PDAResult.Success;
  8360. if (right != null && right.Rows.Count > 0)
  8361. {
  8362. actionResult.Result = JsonHelper.ToJson(right);
  8363. }
  8364. return actionResult;
  8365. }
  8366. #endregion
  8367. #region 获取成型线状态等信息,和成型模具信息
  8368. if (action == "GetGroutingLineMould")
  8369. {
  8370. int? groutingLineID = null;
  8371. string groutingLineCode = null;
  8372. if (data.ContainsKey("GroutingLineID"))
  8373. {
  8374. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8375. }
  8376. else
  8377. {
  8378. groutingLineCode = data["GroutingLineCode"] + "";
  8379. }
  8380. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8381. if (lineInfo == null)
  8382. {
  8383. actionResult.Status = (int)Constant.PDAResult.Fail;
  8384. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8385. }
  8386. else
  8387. {
  8388. actionResult.Status = (int)Constant.PDAResult.Success;
  8389. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8390. }
  8391. return actionResult;
  8392. }
  8393. #endregion
  8394. #region 模具操作-画面初始化
  8395. if (action == "GetMouldOperationInit")
  8396. {
  8397. ClientRequestEntity cre = new ClientRequestEntity();
  8398. cre.Properties["MouldOperationType"] = 2;
  8399. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8400. if (sre.Status == Constant.ServiceResultStatus.Success)
  8401. {
  8402. actionResult.Status = (int)Constant.PDAResult.Success;
  8403. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8404. }
  8405. else
  8406. {
  8407. actionResult.Status = (int)Constant.PDAResult.Fail;
  8408. actionResult.Result = sre.OtherStatus;
  8409. actionResult.Message = sre.Message;
  8410. }
  8411. return actionResult;
  8412. }
  8413. #endregion
  8414. #region 成型模具操作-画面初始化
  8415. if (action == "GetGroutingMouldOperationInit")
  8416. {
  8417. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8418. if (initData != null && initData.Rows.Count > 0)
  8419. {
  8420. actionResult.Status = (int)Constant.PDAResult.Success;
  8421. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8422. foreach (DataRow item in initData.Rows)
  8423. {
  8424. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8425. }
  8426. actionResult.Result = JsonHelper.ToJson(syssetting);
  8427. }
  8428. else
  8429. {
  8430. actionResult.Status = (int)Constant.PDAResult.Fail;
  8431. }
  8432. return actionResult;
  8433. }
  8434. #endregion
  8435. #region 模具操作-验证模具条码
  8436. if (action == "CheckMouldBarcode")
  8437. {
  8438. ClientRequestEntity cre = new ClientRequestEntity();
  8439. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8440. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8441. if (sre.Status == Constant.ServiceResultStatus.Success)
  8442. {
  8443. if (sre.Data.Tables[0].Rows.Count == 0)
  8444. {
  8445. actionResult.Status = (int)Constant.PDAResult.Fail;
  8446. actionResult.Result = -1;
  8447. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8448. return actionResult;
  8449. }
  8450. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8451. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8452. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8453. #region 上线
  8454. if (mouldOperationType == 6)
  8455. {
  8456. if (mouldStatusID == 1 || mouldStatusID == 3)
  8457. {
  8458. if (data.ContainsKey("GoodsID"))
  8459. {
  8460. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8461. {
  8462. actionResult.Status = (int)Constant.PDAResult.Fail;
  8463. actionResult.Result = -3;
  8464. actionResult.Message =
  8465. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8466. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8467. "】与当前不一致";
  8468. return actionResult;
  8469. }
  8470. }
  8471. actionResult.Status = (int)Constant.PDAResult.Success;
  8472. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8473. }
  8474. else
  8475. {
  8476. actionResult.Status = (int)Constant.PDAResult.Fail;
  8477. actionResult.Result = -2;
  8478. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8479. }
  8480. return actionResult;
  8481. }
  8482. #endregion
  8483. return actionResult;
  8484. }
  8485. }
  8486. #endregion
  8487. #region 停用
  8488. if (action == "StopGroutingLineDetail")
  8489. {
  8490. if (data == null || !data.ContainsKey("Details"))
  8491. {
  8492. actionResult.Status = (int)Constant.PDAResult.Fail;
  8493. actionResult.Message = "参数错误";
  8494. return actionResult;
  8495. }
  8496. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8497. DataTable gTable = new DataTable();
  8498. gTable.Columns.Add("GroutingLineID", typeof(int));
  8499. gTable.Columns.Add("GroutingLineCode");
  8500. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8501. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8502. gTable.Columns.Add("GroutingMouldCode");
  8503. gTable.Columns.Add("RecordRemarks");
  8504. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8505. gTable.Columns.Add("MouldID", typeof(int));
  8506. gTable.Columns.Add("MouldCode");
  8507. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8508. string groutingLineCode = data["GroutingLineCode"] + "";
  8509. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8510. foreach (Dictionary<string, object> item in details)
  8511. {
  8512. int? mouldID = null;
  8513. if (item.ContainsKey("MouldID"))
  8514. {
  8515. mouldID = Convert.ToInt32(item["MouldID"]);
  8516. if (mouldID == 0)
  8517. {
  8518. mouldID = null;
  8519. }
  8520. }
  8521. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8522. item["GLineDetailID"], item["GLineDetailCode"],
  8523. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8524. mouldID, item["MouldCode"]);
  8525. }
  8526. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8527. if (result > 0)
  8528. {
  8529. actionResult.Status = (int)Constant.PDAResult.Success;
  8530. }
  8531. else
  8532. {
  8533. actionResult.Status = (int)Constant.PDAResult.Fail;
  8534. actionResult.Result = result;
  8535. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8536. return actionResult;
  8537. }
  8538. return actionResult;
  8539. }
  8540. #endregion
  8541. #region 启用
  8542. if (action == "StartGroutingLineDetail")
  8543. {
  8544. if (data == null || !data.ContainsKey("Details"))
  8545. {
  8546. actionResult.Status = (int)Constant.PDAResult.Fail;
  8547. actionResult.Message = "参数错误";
  8548. return actionResult;
  8549. }
  8550. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8551. DataTable gTable = new DataTable();
  8552. gTable.Columns.Add("GroutingLineID", typeof(int));
  8553. gTable.Columns.Add("GroutingLineCode");
  8554. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8555. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8556. gTable.Columns.Add("GroutingMouldCode");
  8557. gTable.Columns.Add("RecordRemarks");
  8558. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8559. gTable.Columns.Add("MouldID", typeof(int));
  8560. gTable.Columns.Add("MouldCode");
  8561. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8562. string groutingLineCode = data["GroutingLineCode"] + "";
  8563. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8564. foreach (Dictionary<string, object> item in details)
  8565. {
  8566. int? mouldID = null;
  8567. if (item.ContainsKey("MouldID"))
  8568. {
  8569. mouldID = Convert.ToInt32(item["MouldID"]);
  8570. if (mouldID == 0)
  8571. {
  8572. mouldID = null;
  8573. }
  8574. }
  8575. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8576. item["GLineDetailID"], item["GLineDetailCode"],
  8577. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8578. mouldID, item["MouldCode"]);
  8579. }
  8580. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8581. if (result > 0)
  8582. {
  8583. actionResult.Status = (int)Constant.PDAResult.Success;
  8584. }
  8585. else
  8586. {
  8587. actionResult.Status = (int)Constant.PDAResult.Fail;
  8588. actionResult.Result = result;
  8589. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8590. return actionResult;
  8591. }
  8592. return actionResult;
  8593. }
  8594. #endregion
  8595. #region 维修
  8596. if (action == "RepairStartGroutingLineDetail")
  8597. {
  8598. if (data == null || !data.ContainsKey("Details"))
  8599. {
  8600. actionResult.Status = (int)Constant.PDAResult.Fail;
  8601. actionResult.Message = "参数错误";
  8602. return actionResult;
  8603. }
  8604. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8605. DataTable gTable = new DataTable();
  8606. gTable.Columns.Add("GroutingLineID", typeof(int));
  8607. gTable.Columns.Add("GroutingLineCode");
  8608. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8609. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8610. gTable.Columns.Add("GroutingMouldCode");
  8611. gTable.Columns.Add("RecordRemarks");
  8612. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8613. gTable.Columns.Add("MouldID", typeof(int));
  8614. gTable.Columns.Add("MouldCode");
  8615. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8616. string groutingLineCode = data["GroutingLineCode"] + "";
  8617. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8618. foreach (Dictionary<string, object> item in details)
  8619. {
  8620. int? mouldID = null;
  8621. if (item.ContainsKey("MouldID"))
  8622. {
  8623. mouldID = Convert.ToInt32(item["MouldID"]);
  8624. if (mouldID == 0)
  8625. {
  8626. mouldID = null;
  8627. }
  8628. }
  8629. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8630. item["GLineDetailID"], item["GLineDetailCode"],
  8631. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8632. mouldID, item["MouldCode"]);
  8633. }
  8634. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8635. if (result > 0)
  8636. {
  8637. actionResult.Status = (int)Constant.PDAResult.Success;
  8638. }
  8639. else
  8640. {
  8641. actionResult.Status = (int)Constant.PDAResult.Fail;
  8642. actionResult.Result = result;
  8643. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8644. return actionResult;
  8645. }
  8646. return actionResult;
  8647. }
  8648. #endregion
  8649. #region 结束维修
  8650. if (action == "RepairEndGroutingLineDetail")
  8651. {
  8652. if (data == null || !data.ContainsKey("Details"))
  8653. {
  8654. actionResult.Status = (int)Constant.PDAResult.Fail;
  8655. actionResult.Message = "参数错误";
  8656. return actionResult;
  8657. }
  8658. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8659. DataTable gTable = new DataTable();
  8660. gTable.Columns.Add("GroutingLineID", typeof(int));
  8661. gTable.Columns.Add("GroutingLineCode");
  8662. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8663. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8664. gTable.Columns.Add("GroutingMouldCode");
  8665. gTable.Columns.Add("RecordRemarks");
  8666. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8667. gTable.Columns.Add("MouldID", typeof(int));
  8668. gTable.Columns.Add("MouldCode");
  8669. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8670. string groutingLineCode = data["GroutingLineCode"] + "";
  8671. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8672. foreach (Dictionary<string, object> item in details)
  8673. {
  8674. int? mouldID = null;
  8675. if (item.ContainsKey("MouldID"))
  8676. {
  8677. mouldID = Convert.ToInt32(item["MouldID"]);
  8678. if (mouldID == 0)
  8679. {
  8680. mouldID = null;
  8681. }
  8682. }
  8683. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8684. item["GLineDetailID"], item["GLineDetailCode"],
  8685. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8686. mouldID, item["MouldCode"]);
  8687. }
  8688. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8689. if (result > 0)
  8690. {
  8691. actionResult.Status = (int)Constant.PDAResult.Success;
  8692. }
  8693. else
  8694. {
  8695. actionResult.Status = (int)Constant.PDAResult.Fail;
  8696. actionResult.Result = result;
  8697. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8698. return actionResult;
  8699. }
  8700. return actionResult;
  8701. }
  8702. #endregion
  8703. #region 换模
  8704. if (action == "ChangeGMouldStartGroutingLineDetail")
  8705. {
  8706. if (data == null || !data.ContainsKey("Details"))
  8707. {
  8708. actionResult.Status = (int)Constant.PDAResult.Fail;
  8709. actionResult.Message = "参数错误";
  8710. return actionResult;
  8711. }
  8712. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8713. DataTable gTable = new DataTable();
  8714. gTable.Columns.Add("GroutingLineID", typeof(int));
  8715. gTable.Columns.Add("GroutingLineCode");
  8716. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8717. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8718. gTable.Columns.Add("GroutingMouldCode");
  8719. gTable.Columns.Add("RecordRemarks");
  8720. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8721. gTable.Columns.Add("MouldID", typeof(int));
  8722. gTable.Columns.Add("MouldCode");
  8723. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8724. gTable.Columns.Add("MouldStatus", typeof(int));
  8725. gTable.Columns.Add("ScrapReason", typeof(int));
  8726. gTable.Columns.Add("ScrapResponsibility");
  8727. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8728. string groutingLineCode = data["GroutingLineCode"] + "";
  8729. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8730. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8731. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8732. string scrapResponsibility = data["ScrapRemarks"] + "";
  8733. foreach (Dictionary<string, object> item in details)
  8734. {
  8735. int? mouldID = null;
  8736. if (item.ContainsKey("MouldID"))
  8737. {
  8738. mouldID = Convert.ToInt32(item["MouldID"]);
  8739. if (mouldID == 0)
  8740. {
  8741. mouldID = null;
  8742. }
  8743. }
  8744. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8745. item["GLineDetailID"], item["GLineDetailCode"],
  8746. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8747. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8748. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8749. }
  8750. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  8751. if (result > 0)
  8752. {
  8753. actionResult.Status = (int)Constant.PDAResult.Success;
  8754. }
  8755. else
  8756. {
  8757. actionResult.Status = (int)Constant.PDAResult.Fail;
  8758. actionResult.Result = result;
  8759. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8760. return actionResult;
  8761. }
  8762. return actionResult;
  8763. }
  8764. #endregion
  8765. #region 变产
  8766. if (action == "UpdateLineStartGroutingLineDetail")
  8767. {
  8768. if (data == null || !data.ContainsKey("Details"))
  8769. {
  8770. actionResult.Status = (int)Constant.PDAResult.Fail;
  8771. actionResult.Message = "参数错误";
  8772. return actionResult;
  8773. }
  8774. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8775. DataTable gTable = new DataTable();
  8776. gTable.Columns.Add("GroutingLineID", typeof(int));
  8777. gTable.Columns.Add("GroutingLineCode");
  8778. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8779. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8780. gTable.Columns.Add("GroutingMouldCode");
  8781. gTable.Columns.Add("RecordRemarks");
  8782. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8783. gTable.Columns.Add("MouldID", typeof(int));
  8784. gTable.Columns.Add("MouldCode");
  8785. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8786. gTable.Columns.Add("MouldStatus", typeof(int));
  8787. gTable.Columns.Add("ScrapReason", typeof(int));
  8788. gTable.Columns.Add("ScrapResponsibility");
  8789. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8790. string groutingLineCode = data["GroutingLineCode"] + "";
  8791. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8792. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8793. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8794. string scrapResponsibility = data["ScrapRemarks"] + "";
  8795. foreach (Dictionary<string, object> item in details)
  8796. {
  8797. int? mouldID = null;
  8798. if (item.ContainsKey("MouldID"))
  8799. {
  8800. mouldID = Convert.ToInt32(item["MouldID"]);
  8801. if (mouldID == 0)
  8802. {
  8803. mouldID = null;
  8804. }
  8805. }
  8806. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8807. item["GLineDetailID"], item["GLineDetailCode"],
  8808. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8809. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8810. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8811. }
  8812. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  8813. if (result > 0)
  8814. {
  8815. actionResult.Status = (int)Constant.PDAResult.Success;
  8816. }
  8817. else
  8818. {
  8819. actionResult.Status = (int)Constant.PDAResult.Fail;
  8820. actionResult.Result = result;
  8821. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8822. return actionResult;
  8823. }
  8824. return actionResult;
  8825. }
  8826. #endregion
  8827. #region 整线变产
  8828. if (action == "UpdateAllLineStartGroutingLineDetail")
  8829. {
  8830. if (data == null || !data.ContainsKey("Details"))
  8831. {
  8832. actionResult.Status = (int)Constant.PDAResult.Fail;
  8833. actionResult.Message = "参数错误";
  8834. return actionResult;
  8835. }
  8836. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8837. DataTable gTable = new DataTable();
  8838. gTable.Columns.Add("GroutingLineID", typeof(int));
  8839. gTable.Columns.Add("GroutingLineCode");
  8840. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8841. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8842. gTable.Columns.Add("GroutingMouldCode");
  8843. gTable.Columns.Add("RecordRemarks");
  8844. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8845. gTable.Columns.Add("MouldID", typeof(int));
  8846. gTable.Columns.Add("MouldCode");
  8847. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8848. gTable.Columns.Add("MouldStatus", typeof(int));
  8849. gTable.Columns.Add("ScrapReason", typeof(int));
  8850. gTable.Columns.Add("ScrapResponsibility");
  8851. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8852. string groutingLineCode = data["GroutingLineCode"] + "";
  8853. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8854. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8855. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8856. string scrapResponsibility = data["ScrapRemarks"] + "";
  8857. foreach (Dictionary<string, object> item in details)
  8858. {
  8859. int? mouldID = null;
  8860. if (item.ContainsKey("MouldID"))
  8861. {
  8862. mouldID = Convert.ToInt32(item["MouldID"]);
  8863. if (mouldID == 0)
  8864. {
  8865. mouldID = null;
  8866. }
  8867. }
  8868. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8869. item["GLineDetailID"], item["GLineDetailCode"],
  8870. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8871. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8872. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8873. }
  8874. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  8875. if (result > 0)
  8876. {
  8877. actionResult.Status = (int)Constant.PDAResult.Success;
  8878. }
  8879. else
  8880. {
  8881. actionResult.Status = (int)Constant.PDAResult.Fail;
  8882. actionResult.Result = result;
  8883. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8884. return actionResult;
  8885. }
  8886. return actionResult;
  8887. }
  8888. #endregion
  8889. #region 卸模
  8890. if (action == "UnloadGroutingLineDetail")
  8891. {
  8892. if (data == null || !data.ContainsKey("Details"))
  8893. {
  8894. actionResult.Status = (int)Constant.PDAResult.Fail;
  8895. actionResult.Message = "参数错误";
  8896. return actionResult;
  8897. }
  8898. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8899. DataTable gTable = new DataTable();
  8900. gTable.Columns.Add("GroutingLineID", typeof(int));
  8901. gTable.Columns.Add("GroutingLineCode");
  8902. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8903. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8904. gTable.Columns.Add("GroutingMouldCode");
  8905. gTable.Columns.Add("RecordRemarks");
  8906. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8907. gTable.Columns.Add("MouldID", typeof(int));
  8908. gTable.Columns.Add("MouldCode");
  8909. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8910. gTable.Columns.Add("MouldStatus", typeof(int));
  8911. gTable.Columns.Add("ScrapReason", typeof(int));
  8912. gTable.Columns.Add("ScrapResponsibility");
  8913. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8914. string groutingLineCode = data["GroutingLineCode"] + "";
  8915. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8916. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8917. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8918. string scrapResponsibility = data["ScrapRemarks"] + "";
  8919. foreach (Dictionary<string, object> item in details)
  8920. {
  8921. int? mouldID = null;
  8922. if (item.ContainsKey("MouldID"))
  8923. {
  8924. mouldID = Convert.ToInt32(item["MouldID"]);
  8925. if (mouldID == 0)
  8926. {
  8927. mouldID = null;
  8928. }
  8929. }
  8930. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8931. item["GLineDetailID"], item["GLineDetailCode"],
  8932. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8933. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8934. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8935. }
  8936. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  8937. if (result > 0)
  8938. {
  8939. actionResult.Status = (int)Constant.PDAResult.Success;
  8940. }
  8941. else
  8942. {
  8943. actionResult.Status = (int)Constant.PDAResult.Fail;
  8944. actionResult.Result = result;
  8945. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8946. return actionResult;
  8947. }
  8948. return actionResult;
  8949. }
  8950. #endregion
  8951. #region 结束换模
  8952. if (action == "ChangeGMouldEndGroutingLineDetail")
  8953. {
  8954. if (data == null || !data.ContainsKey("Details"))
  8955. {
  8956. actionResult.Status = (int)Constant.PDAResult.Fail;
  8957. actionResult.Message = "参数错误";
  8958. return actionResult;
  8959. }
  8960. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8961. DataTable gTable = new DataTable();
  8962. gTable.Columns.Add("GroutingLineID", typeof(int));
  8963. gTable.Columns.Add("GroutingLineCode");
  8964. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8965. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8966. gTable.Columns.Add("GroutingMouldCode");
  8967. gTable.Columns.Add("RreasonRemarks");
  8968. gTable.Columns.Add("RecordRemarks");
  8969. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8970. gTable.Columns.Add("MouldID", typeof(int));
  8971. gTable.Columns.Add("MouldCode");
  8972. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8973. gTable.Columns.Add("GoodsID", typeof(int));
  8974. gTable.Columns.Add("GoodsCode");
  8975. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8976. gTable.Columns.Add("GroutingCount", typeof(int));
  8977. gTable.Columns.Add("MouldSource");
  8978. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8979. string groutingLineCode = data["GroutingLineCode"] + "";
  8980. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8981. foreach (Dictionary<string, object> item in details)
  8982. {
  8983. int? mouldID = null;
  8984. if (item.ContainsKey("MouldID"))
  8985. {
  8986. mouldID = Convert.ToInt32(item["MouldID"]);
  8987. if (mouldID == 0)
  8988. {
  8989. mouldID = null;
  8990. }
  8991. }
  8992. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8993. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8994. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8995. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8996. item["GoodsID"], item["GoodsCode"],
  8997. item["StandardGroutingCount"], item["GroutingCount"],
  8998. (mouldID == null ? "0" : "1"));
  8999. }
  9000. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  9001. if (result.Status == Constant.ServiceResultStatus.Success)
  9002. {
  9003. actionResult.Status = (int)Constant.PDAResult.Success;
  9004. }
  9005. else if (result.OtherStatus == -100)
  9006. {
  9007. actionResult.Status = (int)Constant.PDAResult.Fail;
  9008. actionResult.Result = -100;
  9009. actionResult.Message = result.Message;
  9010. return actionResult;
  9011. }
  9012. else
  9013. {
  9014. actionResult.Status = (int)Constant.PDAResult.Fail;
  9015. actionResult.Result = -500;
  9016. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9017. return actionResult;
  9018. }
  9019. return actionResult;
  9020. }
  9021. #endregion
  9022. #region 结束变产
  9023. if (action == "UpdateLineEndGroutingLineDetail")
  9024. {
  9025. if (data == null || !data.ContainsKey("Details"))
  9026. {
  9027. actionResult.Status = (int)Constant.PDAResult.Fail;
  9028. actionResult.Message = "参数错误";
  9029. return actionResult;
  9030. }
  9031. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9032. DataTable gTable = new DataTable();
  9033. gTable.Columns.Add("GroutingLineID", typeof(int));
  9034. gTable.Columns.Add("GroutingLineCode");
  9035. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9036. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9037. gTable.Columns.Add("GroutingMouldCode");
  9038. gTable.Columns.Add("RreasonRemarks");
  9039. gTable.Columns.Add("RecordRemarks");
  9040. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9041. gTable.Columns.Add("MouldID", typeof(int));
  9042. gTable.Columns.Add("MouldCode");
  9043. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9044. gTable.Columns.Add("GoodsID", typeof(int));
  9045. gTable.Columns.Add("GoodsCode");
  9046. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9047. gTable.Columns.Add("GroutingCount", typeof(int));
  9048. gTable.Columns.Add("MouldSource");
  9049. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9050. string groutingLineCode = data["GroutingLineCode"] + "";
  9051. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9052. foreach (Dictionary<string, object> item in details)
  9053. {
  9054. int? mouldID = null;
  9055. if (item.ContainsKey("MouldID"))
  9056. {
  9057. mouldID = Convert.ToInt32(item["MouldID"]);
  9058. if (mouldID == 0)
  9059. {
  9060. mouldID = null;
  9061. }
  9062. }
  9063. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9064. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9065. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9066. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9067. item["GoodsID"], item["GoodsCode"],
  9068. item["StandardGroutingCount"], item["GroutingCount"],
  9069. (mouldID == null ? "0" : "1"));
  9070. }
  9071. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  9072. if (result.Status == Constant.ServiceResultStatus.Success)
  9073. {
  9074. actionResult.Status = (int)Constant.PDAResult.Success;
  9075. }
  9076. else if (result.OtherStatus == -100)
  9077. {
  9078. actionResult.Status = (int)Constant.PDAResult.Fail;
  9079. actionResult.Result = -100;
  9080. actionResult.Message = result.Message;
  9081. return actionResult;
  9082. }
  9083. else
  9084. {
  9085. actionResult.Status = (int)Constant.PDAResult.Fail;
  9086. actionResult.Result = -500;
  9087. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9088. return actionResult;
  9089. }
  9090. return actionResult;
  9091. }
  9092. #endregion
  9093. #region 结束整线变产
  9094. if (action == "UpdateAllLineEndGroutingLineDetail")
  9095. {
  9096. if (data == null || !data.ContainsKey("Details"))
  9097. {
  9098. actionResult.Status = (int)Constant.PDAResult.Fail;
  9099. actionResult.Message = "参数错误";
  9100. return actionResult;
  9101. }
  9102. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9103. DataTable gTable = new DataTable();
  9104. gTable.Columns.Add("GroutingLineID", typeof(int));
  9105. gTable.Columns.Add("GroutingLineCode");
  9106. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9107. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9108. gTable.Columns.Add("GroutingMouldCode");
  9109. gTable.Columns.Add("Remarks");
  9110. gTable.Columns.Add("RecordRemarks");
  9111. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9112. gTable.Columns.Add("MouldID", typeof(int));
  9113. gTable.Columns.Add("MouldCode");
  9114. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9115. gTable.Columns.Add("GoodsID", typeof(int));
  9116. gTable.Columns.Add("GoodsCode");
  9117. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9118. gTable.Columns.Add("GroutingCount", typeof(int));
  9119. gTable.Columns.Add("MouldSource");
  9120. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9121. string groutingLineCode = data["GroutingLineCode"] + "";
  9122. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9123. foreach (Dictionary<string, object> item in details)
  9124. {
  9125. int? mouldID = null;
  9126. if (item.ContainsKey("MouldID"))
  9127. {
  9128. mouldID = Convert.ToInt32(item["MouldID"]);
  9129. if (mouldID == 0)
  9130. {
  9131. mouldID = null;
  9132. }
  9133. }
  9134. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9135. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9136. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  9137. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9138. item["GoodsID"], item["GoodsCode"],
  9139. item["StandardGroutingCount"], item["GroutingCount"],
  9140. (mouldID == null ? "0" : "1"));
  9141. }
  9142. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  9143. if (result.Status == Constant.ServiceResultStatus.Success)
  9144. {
  9145. actionResult.Status = (int)Constant.PDAResult.Success;
  9146. }
  9147. else if (result.OtherStatus == -100)
  9148. {
  9149. actionResult.Status = (int)Constant.PDAResult.Fail;
  9150. actionResult.Result = -100;
  9151. actionResult.Message = result.Message;
  9152. return actionResult;
  9153. }
  9154. else
  9155. {
  9156. actionResult.Status = (int)Constant.PDAResult.Fail;
  9157. actionResult.Result = -500;
  9158. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9159. return actionResult;
  9160. }
  9161. return actionResult;
  9162. }
  9163. #endregion
  9164. #region 上模
  9165. if (action == "UpdateGroutingLine_AddMould")
  9166. {
  9167. if (data == null || !data.ContainsKey("Details"))
  9168. {
  9169. actionResult.Status = (int)Constant.PDAResult.Fail;
  9170. actionResult.Message = "参数错误";
  9171. return actionResult;
  9172. }
  9173. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9174. DataTable gTable = new DataTable();
  9175. gTable.Columns.Add("GroutingLineID", typeof(int));
  9176. gTable.Columns.Add("GroutingLineCode");
  9177. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9178. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9179. gTable.Columns.Add("GroutingMouldCode");
  9180. gTable.Columns.Add("Remarks");
  9181. gTable.Columns.Add("RecordRemarks");
  9182. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9183. gTable.Columns.Add("MouldID", typeof(int));
  9184. gTable.Columns.Add("MouldCode");
  9185. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9186. gTable.Columns.Add("GoodsID", typeof(int));
  9187. gTable.Columns.Add("GoodsCode");
  9188. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9189. gTable.Columns.Add("GroutingCount", typeof(int));
  9190. gTable.Columns.Add("MouldSource");
  9191. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9192. string groutingLineCode = data["GroutingLineCode"] + "";
  9193. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9194. foreach (Dictionary<string, object> item in details)
  9195. {
  9196. int? mouldID = null;
  9197. if (item.ContainsKey("MouldID"))
  9198. {
  9199. mouldID = Convert.ToInt32(item["MouldID"]);
  9200. if (mouldID == 0)
  9201. {
  9202. mouldID = null;
  9203. }
  9204. }
  9205. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  9206. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9207. gldID, item["GLineDetailCode"],
  9208. item["DetailRemarks"], item["RecordRemarks"],
  9209. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  9210. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9211. item["GoodsID"], item["GoodsCode"],
  9212. item["StandardGroutingCount"], item["GroutingCount"],
  9213. (mouldID == null ? "0" : "1"));
  9214. }
  9215. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  9216. if (result.Status == Constant.ServiceResultStatus.Success)
  9217. {
  9218. actionResult.Status = (int)Constant.PDAResult.Success;
  9219. }
  9220. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  9221. {
  9222. actionResult.Status = (int)Constant.PDAResult.Fail;
  9223. actionResult.Result = result.OtherStatus;
  9224. actionResult.Message = result.Message;
  9225. return actionResult;
  9226. }
  9227. else
  9228. {
  9229. actionResult.Status = (int)Constant.PDAResult.Fail;
  9230. actionResult.Result = -500;
  9231. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9232. return actionResult;
  9233. }
  9234. return actionResult;
  9235. }
  9236. #endregion
  9237. return actionResult;
  9238. }
  9239. #endregion
  9240. #region 包装装板限制
  9241. if (module == "FinishedLoadingCar")
  9242. {
  9243. if (action == "GetSetting")
  9244. {
  9245. ClientRequestEntity cre = new ClientRequestEntity();
  9246. cre.Properties["GoodsID"] = data["GoodsID"];
  9247. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9248. if (sre.Status == Constant.ServiceResultStatus.Success)
  9249. {
  9250. actionResult.Status = (int)Constant.PDAResult.Success;
  9251. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9252. {
  9253. if (item["settingcode"].ToString() == "S_PM_011")
  9254. {
  9255. cre.Properties["S_PM_011"] = item["settingvalue"];
  9256. }
  9257. else if (item["settingcode"].ToString() == "S_PM_012")
  9258. {
  9259. cre.Properties["S_PM_012"] = item["settingvalue"];
  9260. }
  9261. else if (item["settingcode"].ToString() == "S_PM_013")
  9262. {
  9263. cre.Properties["S_PM_013"] = item["settingvalue"];
  9264. }
  9265. }
  9266. cre.Properties["PlatelitNum"] = sre.Result;
  9267. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9268. }
  9269. else
  9270. {
  9271. actionResult.Status = (int)Constant.PDAResult.Fail;
  9272. actionResult.Message = "";
  9273. }
  9274. return actionResult;
  9275. }
  9276. }
  9277. #endregion
  9278. #region 成型报损
  9279. if (module == "GroutingScrapProduct")
  9280. {
  9281. // 查询注浆日报明细表
  9282. if ("GetGroutingDailyDetail" == action)
  9283. {
  9284. ClientRequestEntity cre = new ClientRequestEntity();
  9285. cre.NameSpace = module;
  9286. cre.Name = action;
  9287. if (!string.IsNullOrEmpty(jsonData))
  9288. {
  9289. cre.Properties["BarCode"] = data["BarCode"];
  9290. }
  9291. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9292. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9293. actionResult.Status = (int)Constant.PDAResult.Success;
  9294. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9295. || sre.Data.Tables[0].Rows.Count == 0)
  9296. {
  9297. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9298. actionResult.Status = (int)Constant.PDAResult.Fail;
  9299. }
  9300. else
  9301. {
  9302. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9303. // 判断是否进行了注浆
  9304. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9305. {
  9306. actionResult.Message = "该产品还未进行注浆!";
  9307. actionResult.Status = (int)Constant.PDAResult.Fail;
  9308. }
  9309. // 判断是否进行了交坯
  9310. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9311. {
  9312. actionResult.Message = "该产品已经交坯!";
  9313. actionResult.Status = (int)Constant.PDAResult.Fail;
  9314. }
  9315. // 判断是否已经报损
  9316. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9317. {
  9318. actionResult.Message = "该产品已经报损!";
  9319. actionResult.Status = (int)Constant.PDAResult.Fail;
  9320. }
  9321. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9322. }
  9323. }
  9324. // 获取成型报损原因
  9325. else if ("GetScrapReasonData" == action)
  9326. {
  9327. ClientRequestEntity cre = new ClientRequestEntity();
  9328. cre.NameSpace = module;
  9329. cre.Name = action;
  9330. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo, "1");
  9331. actionResult.Status = (int)Constant.PDAResult.Success;
  9332. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9333. }
  9334. // 保存成型报损
  9335. else if ("SaveGroutingScrapProduct" == action)
  9336. {
  9337. ClientRequestEntity cre = new ClientRequestEntity();
  9338. cre.NameSpace = module;
  9339. cre.Name = action;
  9340. if (!string.IsNullOrEmpty(jsonData))
  9341. {
  9342. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9343. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9344. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9345. if (dt != null && dt.Rows.Count > 0)
  9346. {
  9347. // 总单信息
  9348. DataRow properties = dt.Rows[0];
  9349. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9350. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9351. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9352. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9353. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9354. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9355. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9356. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9357. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9358. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9359. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9360. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9361. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9362. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9363. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9364. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9365. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9366. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9367. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9368. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9369. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9370. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9371. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9372. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9373. // 责任员工
  9374. cre.Data = new DataSet();
  9375. //DataTable returnTable = returnData.Tables[1].Copy();
  9376. cre.Data.Tables.Add(dtResponsible);
  9377. }
  9378. }
  9379. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9380. if (sre.Status == Constant.ServiceResultStatus.Success)
  9381. {
  9382. actionResult.Status = (int)Constant.PDAResult.Success;
  9383. actionResult.Result = sre.Result;
  9384. }
  9385. else
  9386. {
  9387. actionResult.Status = (int)Constant.PDAResult.Fail;
  9388. actionResult.Result = sre.OtherStatus;
  9389. actionResult.Message = sre.Message;
  9390. }
  9391. }
  9392. // 获取成型报损信息 用于撤销使用
  9393. else if ("GetGroutingScrapProduct" == action)
  9394. {
  9395. ClientRequestEntity cre = new ClientRequestEntity();
  9396. cre.NameSpace = module;
  9397. cre.Name = action;
  9398. if (!string.IsNullOrEmpty(jsonData))
  9399. {
  9400. cre.Properties["BarCode"] = data["BarCode"];
  9401. }
  9402. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9403. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9404. actionResult.Status = (int)Constant.PDAResult.Success;
  9405. }
  9406. //xuwei add 2020-03-23
  9407. //获取成型报损信息 用于撤销使用 支持 浆日报直接报损
  9408. else if ("GetGroutingScrap" == action)
  9409. {
  9410. ClientRequestEntity cre = new ClientRequestEntity();
  9411. cre.NameSpace = module;
  9412. cre.Name = action;
  9413. if (!string.IsNullOrEmpty(jsonData))
  9414. {
  9415. cre.Properties["BarCode"] = data["BarCode"];
  9416. }
  9417. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrap(cre, sUserInfo);
  9418. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9419. actionResult.Status = (int)Constant.PDAResult.Success;
  9420. }
  9421. // 撤销成型报损
  9422. else if ("ReverseGroutingScrapProduct" == action)
  9423. {
  9424. ClientRequestEntity cre = new ClientRequestEntity();
  9425. cre.NameSpace = module;
  9426. cre.Name = action;
  9427. if (!string.IsNullOrEmpty(jsonData))
  9428. {
  9429. cre.Properties["BarCode"] = data["BarCode"];
  9430. }
  9431. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9432. if (sre.Status == Constant.ServiceResultStatus.Success)
  9433. {
  9434. actionResult.Status = (int)Constant.PDAResult.Success;
  9435. actionResult.Result = sre.Result;
  9436. }
  9437. else
  9438. {
  9439. actionResult.Status = (int)Constant.PDAResult.Fail;
  9440. actionResult.Result = sre.OtherStatus;
  9441. actionResult.Message = sre.Message;
  9442. }
  9443. }
  9444. }
  9445. #endregion
  9446. #region 产品挂起
  9447. if (module == "ProductSuspend")
  9448. {
  9449. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9450. if (action == "GetSuspendProcedure")
  9451. {
  9452. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9453. if (sre.Status == Constant.ServiceResultStatus.Success)
  9454. {
  9455. actionResult.Status = (int)Constant.PDAResult.Success;
  9456. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9457. }
  9458. else
  9459. {
  9460. actionResult.Status = (int)Constant.PDAResult.Fail;
  9461. actionResult.Message = sre.Message;
  9462. }
  9463. return actionResult;
  9464. }
  9465. // 验证挂起条码
  9466. if (action == "CheckSuspendBarcode")
  9467. {
  9468. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  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
  9475. {
  9476. actionResult.Status = (int)Constant.PDAResult.Fail;
  9477. actionResult.Message = sre.Message;
  9478. }
  9479. return actionResult;
  9480. }
  9481. // 挂起条码
  9482. if (action == "SaveSuspendProduct")
  9483. {
  9484. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9485. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9486. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9487. if (sre.Status == Constant.ServiceResultStatus.Success)
  9488. {
  9489. actionResult.Status = (int)Constant.PDAResult.Success;
  9490. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9491. }
  9492. else
  9493. {
  9494. actionResult.Status = (int)Constant.PDAResult.Fail;
  9495. actionResult.Message = sre.Message;
  9496. }
  9497. return actionResult;
  9498. }
  9499. // 撤销挂起条码
  9500. if (action == "DeleteSuspendProduct")
  9501. {
  9502. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9503. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9504. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  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. // 查询挂起条码
  9518. if (action == "GetSuspendProduct")
  9519. {
  9520. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9521. if (sre.Status == Constant.ServiceResultStatus.Success)
  9522. {
  9523. if (sre.Data.Tables[0].Rows.Count == 0)
  9524. {
  9525. actionResult.Status = (int)Constant.PDAResult.Fail;
  9526. actionResult.Message = "此条码没有可撤销的挂起信息";
  9527. }
  9528. else
  9529. {
  9530. actionResult.Status = (int)Constant.PDAResult.Success;
  9531. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9532. }
  9533. }
  9534. else
  9535. {
  9536. actionResult.Status = (int)Constant.PDAResult.Fail;
  9537. actionResult.Message = sre.Message;
  9538. }
  9539. return actionResult;
  9540. }
  9541. }
  9542. #endregion
  9543. #region 品保抽查
  9544. if (module == "QASpotCheck")
  9545. {
  9546. if (action == "GetAllQASpotCheck")
  9547. {
  9548. ClientRequestEntity cre = new ClientRequestEntity();
  9549. cre.NameSpace = module;
  9550. cre.Name = action;
  9551. if (data != null && data.Count > 0)
  9552. {
  9553. foreach (string item in data.Keys)
  9554. {
  9555. if (item.StartsWith("checktime"))
  9556. {
  9557. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9558. }
  9559. else
  9560. {
  9561. cre.Properties.Add(item, data[item]);
  9562. }
  9563. }
  9564. }
  9565. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9566. if (sre.Status == Constant.ServiceResultStatus.Success)
  9567. {
  9568. actionResult.Status = (int)Constant.PDAResult.Success;
  9569. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9570. }
  9571. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9572. {
  9573. actionResult.Status = (int)Constant.PDAResult.Success;
  9574. }
  9575. else
  9576. {
  9577. actionResult.Status = (int)Constant.PDAResult.Fail;
  9578. actionResult.Message = sre.Message;
  9579. }
  9580. return actionResult;
  9581. }
  9582. if (action == "AutoSaveQASpotCheck")
  9583. {
  9584. string barcode = data["barcode"] + "";
  9585. string remarks = data["remarks"] + "";
  9586. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9587. if (sre.Status == Constant.ServiceResultStatus.Success)
  9588. {
  9589. actionResult.Status = (int)Constant.PDAResult.Success;
  9590. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9591. }
  9592. else
  9593. {
  9594. actionResult.Status = (int)Constant.PDAResult.Fail;
  9595. actionResult.Message = sre.Message;
  9596. }
  9597. return actionResult;
  9598. }
  9599. if (action == "CheckQASpotCheck")
  9600. {
  9601. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9602. if (sre.Status == Constant.ServiceResultStatus.Success)
  9603. {
  9604. actionResult.Status = (int)Constant.PDAResult.Success;
  9605. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9606. }
  9607. else
  9608. {
  9609. actionResult.Status = (int)Constant.PDAResult.Fail;
  9610. actionResult.Message = sre.Message;
  9611. }
  9612. return actionResult;
  9613. }
  9614. if (action == "SaveQASpotCheck")
  9615. {
  9616. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9617. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9618. if (sre.Status == Constant.ServiceResultStatus.Success)
  9619. {
  9620. actionResult.Status = (int)Constant.PDAResult.Success;
  9621. }
  9622. else
  9623. {
  9624. actionResult.Status = (int)Constant.PDAResult.Fail;
  9625. actionResult.Message = sre.Message;
  9626. }
  9627. return actionResult;
  9628. }
  9629. return null;
  9630. }
  9631. #endregion
  9632. #region 产成品交接
  9633. if (module == "FinishedProduct")
  9634. {
  9635. // 设定商标
  9636. if (action == "GetFinishedBarcode")
  9637. {
  9638. string barcode = data["barcode"].ToString();
  9639. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  9640. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9641. if (Convert.ToInt32(resultEntity.Result) < 0)
  9642. {
  9643. actionResult.Status = (int)Constant.PDAResult.Fail;
  9644. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9645. actionResult.Message = resultEntity.Message;
  9646. }
  9647. else
  9648. {
  9649. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9650. actionResult.Status = (int)Constant.PDAResult.Success;
  9651. actionResult.Message = resultEntity.Message;
  9652. }
  9653. return actionResult;
  9654. }
  9655. if (action == "GetHandoveredBarcode")
  9656. {
  9657. string barcode = data["barcode"].ToString();
  9658. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  9659. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9660. if (Convert.ToInt32(resultEntity.Result) < 0)
  9661. {
  9662. actionResult.Status = (int)Constant.PDAResult.Fail;
  9663. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9664. actionResult.Message = resultEntity.Message;
  9665. }
  9666. else
  9667. {
  9668. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9669. actionResult.Status = (int)Constant.PDAResult.Success;
  9670. actionResult.Message = resultEntity.Message;
  9671. }
  9672. return actionResult;
  9673. }
  9674. if (action == "SetFinishedLogo")
  9675. {
  9676. int logoid = Convert.ToInt32(data["logoid"]);
  9677. string[] barcodes = data["barcodes"].ToString().Split(',');
  9678. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo);
  9679. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9680. if (result < 0)
  9681. {
  9682. actionResult.Status = (int)Constant.PDAResult.Fail;
  9683. }
  9684. else
  9685. {
  9686. actionResult.Status = (int)Constant.PDAResult.Success;
  9687. }
  9688. return actionResult;
  9689. }
  9690. if (action == "SetHandoveredOrder")
  9691. {
  9692. int orderID = Convert.ToInt32(data["orderID"]);
  9693. string[] barcodes = data["barcodes"].ToString().Split(',');
  9694. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  9695. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9696. if (result < 0)
  9697. {
  9698. actionResult.Status = (int)Constant.PDAResult.Fail;
  9699. }
  9700. else
  9701. {
  9702. actionResult.Status = (int)Constant.PDAResult.Success;
  9703. }
  9704. return actionResult;
  9705. }
  9706. }
  9707. #endregion
  9708. #region 产成品装车
  9709. /*
  9710. if (module == "FinishedLoading")
  9711. {
  9712. // 设定商标
  9713. if (action == "GetMaxLoadingNo")
  9714. {
  9715. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  9716. actionResult.Status = (int)Constant.PDAResult.Success;
  9717. actionResult.Result = no;
  9718. return actionResult;
  9719. }
  9720. if (action == "CheckFinishedLaodingBarcode")
  9721. {
  9722. string barcode = data["barcode"].ToString();
  9723. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  9724. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  9725. {
  9726. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9727. actionResult.Status = (int)Constant.PDAResult.Success;
  9728. actionResult.Message = resultEntity.Message;
  9729. }
  9730. else
  9731. {
  9732. actionResult.Status = (int)Constant.PDAResult.Fail;
  9733. actionResult.Result = resultEntity.OtherStatus;
  9734. actionResult.Message = resultEntity.Message;
  9735. }
  9736. return actionResult;
  9737. }
  9738. if (action == "SaveFinishedLoading")
  9739. {
  9740. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  9741. string carLicense = data["carLicense"] + "";
  9742. int palletNum = Convert.ToInt32(data["palletNum"]);
  9743. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  9744. string remarks = data["remarks"] + "";
  9745. Dictionary<string, object>[] details =
  9746. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  9747. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  9748. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  9749. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  9750. if (result.Status == Constant.ServiceResultStatus.Success)
  9751. {
  9752. actionResult.Status = (int)Constant.PDAResult.Success;
  9753. actionResult.Message = result.Message;
  9754. }
  9755. else
  9756. {
  9757. actionResult.Status = (int)Constant.PDAResult.Fail;
  9758. actionResult.Result = result.OtherStatus;
  9759. actionResult.Message = result.Message;
  9760. }
  9761. return actionResult;
  9762. }
  9763. }
  9764. */
  9765. #endregion
  9766. #region 产成品质量改判
  9767. if (module == "FinishedProductTamper")
  9768. {
  9769. // 获取产成品信息及缺陷数据
  9770. if (action == "GetDefectData")
  9771. {
  9772. string barcode = data["barcode"].ToString();
  9773. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  9774. if (sre.Status == Constant.ServiceResultStatus.Success)
  9775. {
  9776. actionResult.Status = (int)Constant.PDAResult.Success;
  9777. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9778. actionResult.Message = sre.Message;
  9779. }
  9780. else
  9781. {
  9782. actionResult.Status = (int)Constant.PDAResult.Fail;
  9783. actionResult.Result = sre.OtherStatus;
  9784. actionResult.Message = sre.Message;
  9785. }
  9786. return actionResult;
  9787. }
  9788. // 获取产成品信息及缺陷数据
  9789. if (action == "SaveDefectData")
  9790. {
  9791. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  9792. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  9793. if (sre.Status == Constant.ServiceResultStatus.Success)
  9794. {
  9795. actionResult.Status = (int)Constant.PDAResult.Success;
  9796. actionResult.Message = sre.Message;
  9797. }
  9798. else
  9799. {
  9800. actionResult.Status = (int)Constant.PDAResult.Fail;
  9801. actionResult.Message = sre.Message;
  9802. }
  9803. return actionResult;
  9804. }
  9805. // 通过条码查出责任工序(成品改判用)
  9806. if (action == "GetDutyProcedureByBarCodeForTamper")
  9807. {
  9808. string barcode = data["barcode"] + "";
  9809. int defectid = int.Parse(data["defectid"] + "");
  9810. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  9811. if (sre.Status == Constant.ServiceResultStatus.Success)
  9812. {
  9813. actionResult.Status = (int)Constant.PDAResult.Success;
  9814. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9815. actionResult.Message = sre.Message;
  9816. }
  9817. else
  9818. {
  9819. actionResult.Status = (int)Constant.PDAResult.Fail;
  9820. actionResult.Result = sre.OtherStatus;
  9821. actionResult.Message = sre.Message;
  9822. }
  9823. return actionResult;
  9824. }
  9825. }
  9826. #endregion
  9827. #region PDA独立功能
  9828. #region 水效标识
  9829. if (module == "WaterEffect")
  9830. {
  9831. // 获取产成品信息及水效标识
  9832. if (action == "GetGoodsByBarCode")
  9833. {
  9834. string barcode = data["barcode"].ToString();
  9835. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  9836. if (sre.Status == Constant.ServiceResultStatus.Success)
  9837. {
  9838. actionResult.Status = (int)Constant.PDAResult.Success;
  9839. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9840. actionResult.Message = sre.Message;
  9841. }
  9842. else
  9843. {
  9844. actionResult.Status = (int)Constant.PDAResult.Fail;
  9845. actionResult.Result = sre.OtherStatus;
  9846. actionResult.Message = sre.Message;
  9847. }
  9848. return actionResult;
  9849. }
  9850. }
  9851. #endregion
  9852. #region 盖板型号
  9853. if (module == "SeatCoverType")
  9854. {
  9855. // 获取产成品信息及水效标识
  9856. if (action == "SendGoodsCodeToPLC")
  9857. {
  9858. string barcode = data["barcode"].ToString();
  9859. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  9860. if (sre == 0)
  9861. {
  9862. actionResult.Status = (int)Constant.PDAResult.Success;
  9863. }
  9864. else
  9865. {
  9866. actionResult.Status = (int)Constant.PDAResult.Fail;
  9867. actionResult.Result = sre;
  9868. switch (sre)
  9869. {
  9870. case 1:
  9871. case 2:
  9872. actionResult.Message = "无效条码";
  9873. break;
  9874. case 3:
  9875. actionResult.Message = "此产品型号没有设置盖板标识码";
  9876. break;
  9877. case 4:
  9878. actionResult.Message = "当前用户没有设置PLC参数";
  9879. break;
  9880. case 5:
  9881. actionResult.Message = "PLC参数设置不全";
  9882. break;
  9883. default:
  9884. actionResult.Message = "PLC通信异常";
  9885. break;
  9886. }
  9887. }
  9888. return actionResult;
  9889. }
  9890. }
  9891. #endregion
  9892. #region PDA PLC 相关功能
  9893. if (module == "PDA_FUN_PLC")
  9894. {
  9895. // PDA扫码发送到PLCServer
  9896. if (action == "SendBarcodeToPLCServer")
  9897. {
  9898. string barcode = data["barcode"].ToString();
  9899. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  9900. if (sre == 0)
  9901. {
  9902. actionResult.Status = (int)Constant.PDAResult.Success;
  9903. }
  9904. else
  9905. {
  9906. actionResult.Status = (int)Constant.PDAResult.Fail;
  9907. actionResult.Result = sre;
  9908. switch (sre)
  9909. {
  9910. case 1:
  9911. case 2:
  9912. actionResult.Message = "无效条码";
  9913. break;
  9914. case 3:
  9915. actionResult.Message = "PLC通信异常";
  9916. break;
  9917. case 4:
  9918. actionResult.Message = "当前用户没有设置PLC参数";
  9919. break;
  9920. case 5:
  9921. actionResult.Message = "PLC参数设置不全";
  9922. break;
  9923. default:
  9924. actionResult.Message = "PLC通信异常";
  9925. break;
  9926. }
  9927. }
  9928. return actionResult;
  9929. }
  9930. }
  9931. #endregion
  9932. #endregion
  9933. #region 半检返修
  9934. if (module == "SemiRework")
  9935. {
  9936. // 验证半检返修条码
  9937. if (action == "CheckSemiReworkBarcode")
  9938. {
  9939. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9940. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  9941. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9942. if (Convert.ToInt32(resultEntity.Result) < 0)
  9943. {
  9944. actionResult.Status = (int)Constant.PDAResult.Fail;
  9945. }
  9946. else
  9947. {
  9948. actionResult.Status = (int)Constant.PDAResult.Success;
  9949. }
  9950. actionResult.Message = resultEntity.Message;
  9951. return actionResult;
  9952. }
  9953. // 可以返修的工序
  9954. if (action == "GetSemiReworkProcedure")
  9955. {
  9956. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9957. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  9958. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9959. actionResult.Status = (int)Constant.PDAResult.Success;
  9960. return actionResult;
  9961. }
  9962. // 根据条码获取经过的工序,用于责任工序
  9963. if (action == "GetSemiReworkPassProcedure")
  9964. {
  9965. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9966. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  9967. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9968. actionResult.Status = (int)Constant.PDAResult.Success;
  9969. return actionResult;
  9970. }
  9971. // 根据所选生产工序(生产数据ID)查询责任员工
  9972. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  9973. {
  9974. int productionDataID = Convert.ToInt32(jsonData);
  9975. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9976. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  9977. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9978. actionResult.Status = (int)Constant.PDAResult.Success;
  9979. return actionResult;
  9980. }
  9981. // 根据所选工号,查出缺陷责任员工
  9982. if (action == "GetSemiReworkDefectStaffByUserID")
  9983. {
  9984. int userID = Convert.ToInt32(jsonData);
  9985. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9986. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  9987. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9988. actionResult.Status = (int)Constant.PDAResult.Success;
  9989. return actionResult;
  9990. }
  9991. // 新建半检返修
  9992. if (action == "AddSemiRework")
  9993. {
  9994. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"]+"");
  9995. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9996. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  9997. actionResult.Result = resultEntity.Result;
  9998. actionResult.Message = resultEntity.Message;
  9999. if (Convert.ToInt32(resultEntity.Result) > 0)
  10000. {
  10001. actionResult.Status = (int)Constant.PDAResult.Success;
  10002. }
  10003. else
  10004. {
  10005. actionResult.Status = (int)Constant.PDAResult.Fail;
  10006. }
  10007. return actionResult;
  10008. }
  10009. // 编辑半检返修
  10010. if (action == "EditSemiRework")
  10011. {
  10012. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10013. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10014. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  10015. actionResult.Result = resultEntity.Result;
  10016. actionResult.Message = resultEntity.Message;
  10017. if (Convert.ToInt32(resultEntity.Result) > 0)
  10018. {
  10019. actionResult.Status = (int)Constant.PDAResult.Success;
  10020. }
  10021. else
  10022. {
  10023. actionResult.Status = (int)Constant.PDAResult.Fail;
  10024. }
  10025. return actionResult;
  10026. }
  10027. // 撤销半检返修
  10028. if (action == "CancelSemiRework")
  10029. {
  10030. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10031. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10032. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  10033. actionResult.Result = resultEntity.Result;
  10034. actionResult.Message = resultEntity.Message;
  10035. if (Convert.ToInt32(resultEntity.Result) > 0)
  10036. {
  10037. actionResult.Status = (int)Constant.PDAResult.Success;
  10038. }
  10039. else
  10040. {
  10041. actionResult.Status = (int)Constant.PDAResult.Fail;
  10042. }
  10043. return actionResult;
  10044. }
  10045. // 获取半检返修数据(PDA编辑用)
  10046. if (action == "GetSemiReworkByID")
  10047. {
  10048. int id = Convert.ToInt32(jsonData);
  10049. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10050. PMModuleLogic.GetSemiReworkByID(id,sUserInfo.UserCode);
  10051. DataTable data1 = resultEntity.Data.Tables[0];
  10052. DataTable data2 = resultEntity.Data.Tables[1];
  10053. DataTable data3 = resultEntity.Data.Tables[2];
  10054. if (data1.Rows.Count == 0)
  10055. {
  10056. actionResult.Status = (int)Constant.PDAResult.Fail;
  10057. actionResult.Message = "半检返修信息不存在";
  10058. return actionResult;
  10059. }
  10060. SemiReworkEntity srEntity = new SemiReworkEntity();
  10061. srEntity.SemiReworkID = id;
  10062. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  10063. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  10064. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  10065. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  10066. foreach (DataRow row2 in data2.Rows)
  10067. {
  10068. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  10069. srEntity.SemiReworkDefects.Add(defectEntity);
  10070. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  10071. defectEntity.SemiReworkID = id;
  10072. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  10073. defectEntity.DefectCode = row2["DefectCode"] + "";
  10074. defectEntity.DefectName = row2["DefectName"] + "";
  10075. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  10076. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  10077. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  10078. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  10079. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  10080. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  10081. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  10082. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  10083. defectEntity.Remarks = row2["Remarks"] + "";
  10084. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  10085. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  10086. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  10087. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  10088. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  10089. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  10090. if (row3s.Length == 0)
  10091. {
  10092. continue;
  10093. }
  10094. foreach (DataRow row3 in row3s)
  10095. {
  10096. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  10097. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  10098. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  10099. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  10100. semiReworkRPS.StaffName = row3["StaffName"] + "";
  10101. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  10102. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  10103. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  10104. semiReworkRPS.UserCode = row3["UserCode"] + "";
  10105. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  10106. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  10107. }
  10108. }
  10109. //xuwei note 总单用于显示,信息较全
  10110. actionResult.Message = JsonHelper.ToJson(data1);
  10111. //xuwei note 总单信息不全,但有明细,用于回传保存
  10112. actionResult.Result = JsonHelper.ToJson(srEntity);
  10113. actionResult.Status = (int)Constant.PDAResult.Success;
  10114. }
  10115. }
  10116. #endregion
  10117. #region 窑车漏扫补件
  10118. if (module == "F_PM_0504")
  10119. {
  10120. // 验证窑车编码是否存在
  10121. if (action == "CheckKilnCar")
  10122. {
  10123. ClientRequestEntity cre = new ClientRequestEntity();
  10124. cre.Properties["kilncarcode"] = data["KilnCarCode"];
  10125. cre.Properties["procedureID"] = data["ProcedureID"];
  10126. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo);
  10127. if (sre.Status == Constant.ServiceResultStatus.Success)
  10128. {
  10129. actionResult.Status = (int)Constant.PDAResult.Success;
  10130. actionResult.Result = sre.Result;
  10131. }
  10132. else
  10133. {
  10134. actionResult.Status = (int)Constant.PDAResult.Fail;
  10135. actionResult.Message = sre.Message;
  10136. }
  10137. return actionResult;
  10138. }
  10139. // 验证窑车烧成批次号是否存在 和 是否能补漏扫
  10140. if (action == "CheckKilnCarBatchNo")
  10141. {
  10142. ClientRequestEntity cre = new ClientRequestEntity();
  10143. cre.Properties["KilnID"] = data["KilnID"];
  10144. cre.Properties["KilnCarID"] = data["KilnCarID"];
  10145. cre.Properties["ProcedureID"] = data["ProcedureID"];
  10146. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10147. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo);
  10148. if (sre.Status == Constant.ServiceResultStatus.Success)
  10149. {
  10150. actionResult.Status = (int)Constant.PDAResult.Success;
  10151. }
  10152. else
  10153. {
  10154. actionResult.Status = (int)Constant.PDAResult.Fail;
  10155. actionResult.Message = sre.Message;
  10156. }
  10157. return actionResult;
  10158. }
  10159. // 窑车漏扫补件
  10160. if (action == "SetKilnCarMissing")
  10161. {
  10162. ClientRequestEntity cre = new ClientRequestEntity();
  10163. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10164. string carData = data["CarData"] + "";
  10165. DataTable dataTable = JsonHelper.FromJson<DataTable>(carData);
  10166. cre.Data = new DataSet();
  10167. cre.Data.Tables.Add(dataTable);
  10168. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo);
  10169. if (sre.Status == Constant.ServiceResultStatus.Success)
  10170. {
  10171. actionResult.Status = (int)Constant.PDAResult.Success;
  10172. }
  10173. else
  10174. {
  10175. actionResult.Status = (int)Constant.PDAResult.Fail;
  10176. actionResult.Message = sre.Message;
  10177. }
  10178. return actionResult;
  10179. }
  10180. }
  10181. #endregion
  10182. return actionResult;
  10183. }
  10184. catch (Exception ex)
  10185. {
  10186. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  10187. OutputLog.TraceLog(LogPriority.Error,
  10188. this.ToString(),
  10189. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  10190. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  10191. " module:" + module + " action:" + action + " json:" + jsonData,
  10192. ex.ToString(),
  10193. LocalPath.LogExePath);
  10194. actionResult.Status = (int)Constant.PDAResult.Exception;
  10195. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  10196. }
  10197. return actionResult;
  10198. }
  10199. #endregion
  10200. }
  10201. }