PDAModuleService.cs 608 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:PDAModuleService.cs
  5. * 2.功能描述:PDA模块WCF服务
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 陈晓野 2014/09/16 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.IO;
  14. using System.Linq;
  15. using System.ServiceModel;
  16. using System.ServiceModel.Activation;
  17. using Dongke.IBOSS.PRD.Basics.BaseResources;
  18. using Dongke.IBOSS.PRD.Basics.Library;
  19. using Dongke.IBOSS.PRD.Service.BarcodePrintService;
  20. using Dongke.IBOSS.PRD.Service.CommonModuleLogic;
  21. using Dongke.IBOSS.PRD.Service.DataModels;
  22. using Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic;
  23. using Dongke.IBOSS.PRD.Service.PCModuleLogic;
  24. using Dongke.IBOSS.PRD.Service.PDAModuleLogic;
  25. using Dongke.IBOSS.PRD.Service.PMModuleLogic;
  26. using Dongke.IBOSS.PRD.Service.PublicModuleService;
  27. using Dongke.IBOSS.PRD.Service.ReportModuleLogic;
  28. using Dongke.IBOSS.PRD.Service.SmartDeviceService;
  29. using Dongke.IBOSS.PRD.Service.SystemModuleLogic;
  30. using Dongke.IBOSS.PRD.WCF.Contracts;
  31. using Dongke.IBOSS.PRD.WCF.DataModels;
  32. using Dongke.IBOSS.PRD.WCF.DataModels.ConfigModule;
  33. using Dongke.IBOSS.PRD.WCF.DataModels.HRModule;
  34. using Dongke.IBOSS.PRD.WCF.DataModels.PCModule;
  35. using Dongke.IBOSS.PRD.WCF.DataModels.PDAModule;
  36. using Dongke.IBOSS.PRD.WCF.DataModels.PMModule;
  37. namespace Dongke.IBOSS.PRD.WCF.Services
  38. {
  39. // 服务实现类,继承服务声明接口
  40. // 该标签声明该服务可以在ASP.NET下运行
  41. [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
  42. [ServiceBehavior(ConfigurationName = "PDAModuleService",
  43. InstanceContextMode = InstanceContextMode.PerCall,
  44. ConcurrencyMode = ConcurrencyMode.Multiple,
  45. UseSynchronizationContext = false)]
  46. public partial class PDAModuleService : IPDAModule
  47. {
  48. #region 属性
  49. /// <summary>
  50. /// 用户登陆的信息
  51. /// </summary>
  52. SUserInfo sUserInfo
  53. {
  54. get;
  55. set;
  56. }
  57. #endregion
  58. #region 构造函数
  59. /// <summary>
  60. /// 构造函数
  61. /// </summary>
  62. public PDAModuleService()
  63. : base()
  64. {
  65. }
  66. #endregion
  67. #region 验证
  68. /// <summary>
  69. /// 验证访问头
  70. /// </summary>
  71. /// <param name="accountCode">帐套编码</param>
  72. /// <param name="userCode">用户编码</param>
  73. /// <param name="userPassword">用户密码</param>
  74. /// <param name="sessionKey">访问密钥</param>
  75. /// <returns></returns>
  76. private ActionResult DoPDACheck(string accountCode, string userCode, string userPassword, string sessionKey)
  77. {
  78. try
  79. {
  80. ActionResult actionResult = new ActionResult();
  81. LoginRequestEntity requestEntity = new LoginRequestEntity();
  82. requestEntity.AccountCode = accountCode;
  83. requestEntity.UserCode = userCode;
  84. requestEntity.Password = userPassword;
  85. requestEntity.SessionKey = sessionKey;
  86. SUserInfo userInfo = null;
  87. string loginStatus = DKIBOSSPRDLogic.AuthenticateRepeatLogin(requestEntity, out userInfo);
  88. // 用户登录信息错误
  89. if (Constant.INT_IS_ONE.ToString().Equals(loginStatus))
  90. {
  91. actionResult.Status = (int)Constant.PDAResult.LoginInfoError;
  92. actionResult.Message = Constant.PDA_RESULT_LOGININFOERROR;
  93. }
  94. // 用户在其它终端登陆
  95. else if (Constant.INT_IS_TWO.ToString().Equals(loginStatus))
  96. {
  97. actionResult.Status = (int)Constant.PDAResult.RepeatLogin;
  98. actionResult.Message = Constant.PDA_RESULT_REPEATLOGIN;
  99. }
  100. // Lic错误
  101. else if ("3".Equals(loginStatus))
  102. {
  103. actionResult.Status = (int)Constant.PDAResult.LicInfoError;
  104. actionResult.Message = "授权信息错误,请联系管理员。";
  105. }
  106. else
  107. {
  108. actionResult.Status = (int)Constant.PDAResult.Success;
  109. }
  110. sUserInfo = userInfo;
  111. return actionResult;
  112. }
  113. catch (Exception ex)
  114. {
  115. throw ex;
  116. }
  117. }
  118. #endregion
  119. #region WCF服务
  120. /// <summary>
  121. /// 测试PDA连接WCF服务
  122. /// </summary>
  123. /// <param name="value">测试文本</param>
  124. /// <returns>返回文本</returns>
  125. public string TestConnectionEx(string value)
  126. {
  127. return "连接成功!" + value;
  128. }
  129. public string TestConnection()
  130. {
  131. return "连接成功!";
  132. }
  133. #endregion
  134. #region 系统登录
  135. /// <summary>
  136. /// 系统登录
  137. /// </summary>
  138. /// <param name="accountCode"></param>
  139. /// <param name="userCode"></param>
  140. /// <param name="userPassword"></param>
  141. /// <param name="macAddress"></param>
  142. /// <param name="ipAddress"></param>
  143. /// <param name="phoneCode"></param>
  144. /// <param name="phoneType"></param>
  145. /// <param name="appVersion"></param>
  146. /// <param name="systemType"></param>
  147. /// <param name="systemVersion"></param>
  148. /// <returns></returns>
  149. public PDALoginResult DoPDALogin(string accountCode, string userCode, string userPassword,
  150. string macAddress, string ipAddress, string phoneCode, string phoneType,
  151. string appVersion, string systemType, string systemVersion)
  152. {
  153. try
  154. {
  155. LoginRequestEntity requestEntity = new LoginRequestEntity();
  156. requestEntity.AccountCode = accountCode;
  157. requestEntity.UserCode = userCode;
  158. requestEntity.Password = userPassword;
  159. requestEntity.ComputerName = phoneCode;
  160. requestEntity.IPAddress = ipAddress;
  161. requestEntity.MACAddress = macAddress;
  162. PDALoginResult result = ServiceInvoker.Invoke<PDALoginResult>(this,
  163. () => PDAModuleLogic.DoPDALogin(requestEntity));
  164. return result;
  165. }
  166. catch (Exception ex)
  167. {
  168. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  169. OutputLog.TraceLog(LogPriority.Error,
  170. this.ToString(),
  171. System.Reflection.MethodBase.GetCurrentMethod().Name,
  172. ex.ToString(),
  173. LocalPath.LogExePath);
  174. PDALoginResult result = new PDALoginResult();
  175. result.Status = (int)Constant.PDAResult.Exception;
  176. result.Message = Constant.PDA_RESULT_EXCEPTION;
  177. return result;
  178. }
  179. }
  180. /// <summary>
  181. /// 退出
  182. /// </summary>
  183. /// <param name="accountCode">帐套code</param>
  184. /// <param name="userCode">用户code</param>
  185. /// <param name="userPassword">用户密码</param>
  186. /// <param name="sessionKey">本次登陆密钥</param>
  187. /// <returns></returns>
  188. public ActionResult DoPDAOut(string accountCode, string userCode, string userPassword, string sessionKey)
  189. {
  190. ActionResult actionResult = new ActionResult();
  191. try
  192. {
  193. // 验证请求头信息
  194. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  195. // 验证失败
  196. if (actionResult.Status != (int)Constant.PDAResult.Success)
  197. {
  198. return actionResult;
  199. }
  200. bool result = DKIBOSSPRDLogic.Logout(sUserInfo.UserID, "3", sUserInfo);
  201. actionResult.Result = JsonHelper.ToJson(result);
  202. actionResult.Status = (int)Constant.PDAResult.Success;
  203. }
  204. catch (Exception ex)
  205. {
  206. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  207. OutputLog.TraceLog(LogPriority.Error,
  208. this.ToString(),
  209. System.Reflection.MethodBase.GetCurrentMethod().Name,
  210. ex.ToString(),
  211. LocalPath.LogExePath);
  212. actionResult.Status = (int)Constant.PDAResult.Exception;
  213. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  214. }
  215. return actionResult;
  216. }
  217. /// <summary>
  218. /// 修改密码
  219. /// </summary>
  220. /// <param name="accountCode"></param>
  221. /// <param name="userCode"></param>
  222. /// <param name="userPassword"></param>
  223. /// <param name="sessionKey"></param>
  224. /// <returns></returns>
  225. public ActionResult ChangeUserPassword(string accountCode, string userCode, string userPassword, string sessionKey,
  226. string newPassWord)
  227. {
  228. ActionResult actionResult = new ActionResult();
  229. try
  230. {
  231. // 验证请求头信息
  232. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  233. // 验证失败
  234. if (actionResult.Status != (int)Constant.PDAResult.Success)
  235. {
  236. return actionResult;
  237. }
  238. string result = ServiceInvoker.Invoke<string>(this,
  239. () => SystemModuleDAL.SaveUserPassWord(newPassWord, userCode, null, sUserInfo));
  240. actionResult.Status = (int)Constant.PDAResult.Success;
  241. }
  242. catch (Exception ex)
  243. {
  244. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  245. OutputLog.TraceLog(LogPriority.Error,
  246. this.ToString(),
  247. System.Reflection.MethodBase.GetCurrentMethod().Name,
  248. ex.ToString(),
  249. LocalPath.LogExePath);
  250. actionResult.Status = (int)Constant.PDAResult.Exception;
  251. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  252. }
  253. return actionResult;
  254. }
  255. /// <summary>
  256. /// 获取Apk信息
  257. /// </summary>
  258. /// <returns></returns>
  259. public string GetApkInfoNew(int sdk)
  260. {
  261. try
  262. {
  263. ServiceResultEntity sre = PDAModuleLogic.GetApkInfo(sdk);
  264. return JsonHelper.ToJson(sre);
  265. }
  266. catch (Exception ex)
  267. {
  268. OutputLog.TraceLog(LogPriority.Error,
  269. this.ToString(),
  270. System.Reflection.MethodBase.GetCurrentMethod().Name,
  271. ex.ToString(),
  272. LocalPath.LogExePath);
  273. return null;
  274. }
  275. }
  276. /// <summary>
  277. /// 获取Apk信息
  278. /// </summary>
  279. /// <returns></returns>
  280. public string GetApkInfo()
  281. {
  282. try
  283. {
  284. ServiceResultEntity sre = PDAModuleLogic.GetApkInfo();
  285. return JsonHelper.ToJson(sre);
  286. }
  287. catch (Exception ex)
  288. {
  289. OutputLog.TraceLog(LogPriority.Error,
  290. this.ToString(),
  291. System.Reflection.MethodBase.GetCurrentMethod().Name,
  292. ex.ToString(),
  293. LocalPath.LogExePath);
  294. return null;
  295. }
  296. }
  297. #endregion
  298. #region 取得展示数据
  299. /// <summary>
  300. /// 获得生产线菜单
  301. /// </summary>
  302. /// <param name="accountCode">帐套code</param>
  303. /// <param name="userCode">用户code</param>
  304. /// <param name="userPassword">用户密码</param>
  305. /// <param name="sessionKey">本次登陆密钥</param>
  306. /// <returns></returns>
  307. /// <remarks>
  308. /// 陈冰 2014.09.18 新建
  309. /// </remarks>
  310. public ActionResult GetProductionLineMenu(string accountCode, string userCode, string userPassword, string sessionKey)
  311. {
  312. ActionResult actionResult = new ActionResult();
  313. try
  314. {
  315. // 验证请求头信息
  316. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  317. // 验证失败
  318. if (actionResult.Status != (int)Constant.PDAResult.Success)
  319. {
  320. return actionResult;
  321. }
  322. // 查询菜单
  323. DataTable dtPLM = ServiceInvoker.Invoke<DataTable>(this,
  324. () => PDAModuleLogic.GetProductionLineMenu(sUserInfo));
  325. PDAFunctionResult pdaFunction = new PDAFunctionResult();
  326. pdaFunction.MenuCode = "Root";
  327. DataRow[] navigationRows = dtPLM.Select("LEN(MenuCode) = " + Constant.INT_IS_TWO.ToString(), "MenuCode ASC"); // 编号2为一级菜单
  328. foreach (DataRow newRow in navigationRows)
  329. {
  330. #region 插入子节点数据
  331. int? intProcedureID = null;
  332. int? intModelType = null;
  333. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  334. {
  335. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  336. }
  337. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  338. {
  339. intModelType = Convert.ToInt32(newRow["ModelType"]);
  340. }
  341. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  342. //xuwei add 2020-01-02
  343. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  344. //pdaFunctionChild.IsGlazeChange = 0;
  345. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  346. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  347. pdaFunctionChild.ProcedureID = intProcedureID;
  348. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  349. pdaFunctionChild.ModelType = intModelType;
  350. pdaFunction.PDAFunctions.Add(pdaFunctionChild);
  351. #endregion
  352. InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild);
  353. }
  354. //actionResult.Result = JsonHelper.ToJson(dtPLM);
  355. actionResult.Result = JsonHelper.ToJson(pdaFunction);
  356. actionResult.Status = (int)Constant.PDAResult.Success;
  357. }
  358. catch (Exception ex)
  359. {
  360. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  361. OutputLog.TraceLog(LogPriority.Error,
  362. this.ToString(),
  363. System.Reflection.MethodBase.GetCurrentMethod().Name,
  364. ex.ToString(),
  365. LocalPath.LogExePath);
  366. actionResult.Status = (int)Constant.PDAResult.Exception;
  367. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  368. }
  369. return actionResult;
  370. }
  371. /// <summary>
  372. /// 初始化树形控件
  373. /// </summary>
  374. /// <param name="treeTable">菜单数据表</param>
  375. /// <param name="rows">待处理的菜单集合</param>
  376. /// <param name="node">当前树节点</param>
  377. private void InitTreeView(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions)
  378. {
  379. string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = "
  380. + (pFuncCode.Length + Constant.INT_IS_TWO);
  381. DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC");
  382. //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC");
  383. foreach (DataRow newRow in subRows)
  384. {
  385. #region 插入子节点数据
  386. int? intProcedureID = null;
  387. int? intModelType = null;
  388. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  389. {
  390. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  391. }
  392. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  393. {
  394. intModelType = Convert.ToInt32(newRow["ModelType"]);
  395. }
  396. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  397. //xuwei add 2020-01-02
  398. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  399. //pdaFunctionChild.IsGlazeChange = 0;
  400. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  401. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  402. pdaFunctionChild.ProcedureID = intProcedureID;
  403. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  404. pdaFunctionChild.ModelType = intModelType;
  405. pFunctions.PDAFunctions.Add(pdaFunctionChild);
  406. #endregion
  407. // 递归方法
  408. InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild);
  409. }
  410. }
  411. #endregion
  412. #region 获得工序信息
  413. /// <summary>
  414. /// 获得工序信息
  415. /// </summary>
  416. /// <param name="accountCode">帐套code</param>
  417. /// <param name="userCode">用户code</param>
  418. /// <param name="userPassword">用户密码</param>
  419. /// <param name="sessionKey">本次登陆密钥</param>
  420. /// <param name="procedureID">工序ID</param>
  421. /// <returns></returns>
  422. /// <remarks>
  423. /// 陈冰 2014.09.18 新建
  424. /// </remarks>
  425. public ActionResult GetProcedureByID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  426. {
  427. ActionResult actionResult = new ActionResult();
  428. try
  429. {
  430. // 验证请求头信息
  431. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  432. // 验证失败
  433. if (actionResult.Status != (int)Constant.PDAResult.Success)
  434. {
  435. return actionResult;
  436. }
  437. ProcedureEntity procedureEntity = ServiceInvoker.Invoke<ProcedureEntity>(this,
  438. () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo));
  439. actionResult.Result = JsonHelper.ToJson(procedureEntity);
  440. actionResult.Status = (int)Constant.PDAResult.Success;
  441. }
  442. catch (Exception ex)
  443. {
  444. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  445. OutputLog.TraceLog(LogPriority.Error,
  446. this.ToString(),
  447. System.Reflection.MethodBase.GetCurrentMethod().Name,
  448. ex.ToString(),
  449. LocalPath.LogExePath);
  450. actionResult.Status = (int)Constant.PDAResult.Exception;
  451. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  452. }
  453. return actionResult;
  454. }
  455. #endregion
  456. #region 校验
  457. /// <summary>
  458. /// 校验产品条码是否可以走到该工序
  459. /// </summary>
  460. /// <param name="accountCode">帐套code</param>
  461. /// <param name="userCode">用户code</param>
  462. /// <param name="userPassword">用户密码</param>
  463. /// <param name="sessionKey">本次登陆密钥</param>
  464. /// <param name="procedureID">工序ID</param>
  465. /// <param name="barcode">条码</param>
  466. /// <returns></returns>
  467. /// <remarks>
  468. /// 陈冰 2014.09.18 新建
  469. /// </remarks>
  470. public ActionResult CheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode, bool isNewCheck)
  471. {
  472. ActionResult actionResult = new ActionResult();
  473. try
  474. {
  475. // 验证请求头信息
  476. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  477. // 验证失败
  478. if (actionResult.Status != (int)Constant.PDAResult.Success)
  479. {
  480. return actionResult;
  481. }
  482. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  483. () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo));
  484. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  485. {
  486. if (isNewCheck)
  487. {
  488. actionResult.Result = JsonHelper.ToJson(barcodeDataSet);
  489. }
  490. else
  491. {
  492. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  493. }
  494. actionResult.Status = (int)Constant.PDAResult.Success;
  495. }
  496. else
  497. {
  498. actionResult.Status = (int)Constant.PDAResult.Fail;
  499. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  500. }
  501. }
  502. catch (Exception ex)
  503. {
  504. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  505. OutputLog.TraceLog(LogPriority.Error,
  506. this.ToString(),
  507. System.Reflection.MethodBase.GetCurrentMethod().Name,
  508. ex.ToString(),
  509. LocalPath.LogExePath);
  510. actionResult.Status = (int)Constant.PDAResult.Exception;
  511. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  512. }
  513. return actionResult;
  514. }
  515. /// <summary>
  516. /// 校验产品条码是否可以进行干补
  517. /// </summary>
  518. /// <param name="accountCode">帐套code</param>
  519. /// <param name="userCode">用户code</param>
  520. /// <param name="userPassword">用户密码</param>
  521. /// <param name="sessionKey">本次登陆密钥</param>
  522. /// <param name="procedureID">工序ID</param>
  523. /// <param name="barcode">条码</param>
  524. /// <returns></returns>
  525. /// <remarks>
  526. /// 袁新成 2015.4.1 新建
  527. /// </remarks>
  528. public ActionResult CheckDryRepairBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  529. {
  530. ActionResult actionResult = new ActionResult();
  531. try
  532. {
  533. // 验证请求头信息
  534. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  535. // 验证失败
  536. if (actionResult.Status != (int)Constant.PDAResult.Success)
  537. {
  538. return actionResult;
  539. }
  540. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  541. () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
  542. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  543. {
  544. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  545. actionResult.Status = (int)Constant.PDAResult.Success;
  546. }
  547. else
  548. {
  549. actionResult.Status = (int)Constant.PDAResult.Fail;
  550. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  551. }
  552. }
  553. catch (Exception ex)
  554. {
  555. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  556. OutputLog.TraceLog(LogPriority.Error,
  557. this.ToString(),
  558. System.Reflection.MethodBase.GetCurrentMethod().Name,
  559. ex.ToString(),
  560. LocalPath.LogExePath);
  561. actionResult.Status = (int)Constant.PDAResult.Exception;
  562. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  563. }
  564. return actionResult;
  565. }
  566. /// <summary>
  567. /// 检验生产工号
  568. /// </summary>
  569. /// <param name="accountCode">帐套code</param>
  570. /// <param name="userCode">用户code</param>
  571. /// <param name="userPassword">用户密码</param>
  572. /// <param name="sessionKey">本次登陆密钥</param>
  573. /// <param name="procedureID">工序ID</param>
  574. /// <param name="procedureUserCode">生产工号</param>
  575. /// <remarks>
  576. /// 陈冰 2014.09.18 新建
  577. /// </remarks>
  578. public ActionResult CheckProcedureUser(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
  579. {
  580. ActionResult actionResult = new ActionResult();
  581. try
  582. {
  583. // 验证请求头信息
  584. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  585. // 验证失败
  586. if (actionResult.Status != (int)Constant.PDAResult.Success)
  587. {
  588. return actionResult;
  589. }
  590. CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
  591. () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
  592. actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
  593. actionResult.Status = (int)Constant.PDAResult.Success;
  594. }
  595. catch (Exception ex)
  596. {
  597. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  598. OutputLog.TraceLog(LogPriority.Error,
  599. this.ToString(),
  600. System.Reflection.MethodBase.GetCurrentMethod().Name,
  601. ex.ToString(),
  602. LocalPath.LogExePath);
  603. actionResult.Status = (int)Constant.PDAResult.Exception;
  604. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  605. }
  606. return actionResult;
  607. }
  608. /// <summary>
  609. /// 校验窑车是否可装车并返回窑车信息
  610. /// </summary>
  611. /// <param name="accountCode">帐套code</param>
  612. /// <param name="userCode">用户code</param>
  613. /// <param name="userPassword">用户密码</param>
  614. /// <param name="sessionKey">本次登陆密钥</param>
  615. /// <param name="kilnCarCode">窑车号</param>
  616. /// <param name="modelType">工序类别</param>
  617. /// <returns></returns>
  618. /// <remarks>
  619. /// 陈冰 2014.10.04 新建
  620. /// </remarks>
  621. public ActionResult CheckKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
  622. {
  623. ActionResult actionResult = new ActionResult();
  624. try
  625. {
  626. // 验证请求头信息
  627. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  628. // 验证失败
  629. if (actionResult.Status != (int)Constant.PDAResult.Success)
  630. {
  631. return actionResult;
  632. }
  633. CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
  634. () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
  635. actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
  636. actionResult.Status = (int)Constant.PDAResult.Success;
  637. }
  638. catch (Exception ex)
  639. {
  640. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  641. OutputLog.TraceLog(LogPriority.Error,
  642. this.ToString(),
  643. System.Reflection.MethodBase.GetCurrentMethod().Name,
  644. ex.ToString(),
  645. LocalPath.LogExePath);
  646. actionResult.Status = (int)Constant.PDAResult.Exception;
  647. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  648. }
  649. return actionResult;
  650. }
  651. #endregion
  652. #region 保存条码信息
  653. /// <summary>
  654. /// 保存条码信息
  655. /// </summary>
  656. /// <param name="accountCode">帐套code</param>
  657. /// <param name="userCode">用户code</param>
  658. /// <param name="userPassword">用户密码</param>
  659. /// <param name="sessionKey">本次登陆密钥</param>
  660. /// <param name="procedureID">工序ID</param>
  661. /// <param name="productionDataEntitys">条码信息</param>
  662. public ActionResult AddWorkPiece(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID,
  663. ProductionDataEntity[] productionDataEntitys)
  664. {
  665. ActionResult actionResult = new ActionResult();
  666. try
  667. {
  668. // 验证请求头信息
  669. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  670. // 验证失败
  671. if (actionResult.Status != (int)Constant.PDAResult.Success)
  672. {
  673. return actionResult;
  674. }
  675. DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
  676. if (!dtProductionData.Columns.Contains("IsPDA"))
  677. {
  678. dtProductionData.Columns.Add("IsPDA");
  679. }
  680. ProcedureEntity procedureInfo = null;
  681. DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
  682. () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
  683. actionResult.Result = JsonHelper.ToJson(resultDT);
  684. actionResult.Status = (int)Constant.PDAResult.Success;
  685. if (resultDT != null)
  686. {
  687. DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
  688. if (drs != null && drs.Length > 0)
  689. {
  690. return actionResult;
  691. }
  692. }
  693. #region PDA条码打印
  694. if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
  695. procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
  696. {
  697. try
  698. {
  699. if (procedureInfo.CollectType == 1)
  700. {
  701. //foreach (DataRow item in dtProductionData.Rows)
  702. //{
  703. // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
  704. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  705. // if (sre.Status != Constant.ServiceResultStatus.Success)
  706. // {
  707. // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  708. // actionResult.Message = sre.Message;
  709. // return actionResult;
  710. // }
  711. //}
  712. //裸瓷包装集中采集可以进行条码打印 add by qq 20250530
  713. if (procedureInfo.ProcedureID == 159)
  714. {
  715. ServiceResultEntity sre = BarcodePrintLogic.LCPrintBarcode_3C(dtProductionData,dtProductionData.Rows.Count, dtProductionData.Rows[0]["barcode"].ToString(),
  716. procedureInfo.BarCodePrintCopies, null, sUserInfo, 0);
  717. if (sre.Status != Constant.ServiceResultStatus.Success)
  718. {
  719. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  720. actionResult.Message = sre.Message;
  721. return actionResult;
  722. }
  723. }
  724. }
  725. else
  726. {
  727. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
  728. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  729. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(dtProductionData.Rows[0]["barcode"].ToString(),
  730. procedureInfo.BarCodePrintCopies, null, sUserInfo, 0);
  731. if (sre.Status != Constant.ServiceResultStatus.Success)
  732. {
  733. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  734. actionResult.Message = sre.Message;
  735. return actionResult;
  736. }
  737. }
  738. }
  739. catch (Exception ex)
  740. {
  741. OutputLog.TraceLog(LogPriority.Error,
  742. this.ToString(),
  743. System.Reflection.MethodBase.GetCurrentMethod().Name,
  744. ex.ToString(),
  745. LocalPath.LogExePath);
  746. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  747. actionResult.Message = "条码打印异常";
  748. return actionResult;
  749. }
  750. }
  751. #endregion PDA条码打印
  752. }
  753. catch (Exception ex)
  754. {
  755. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  756. OutputLog.TraceLog(LogPriority.Error,
  757. this.ToString(),
  758. System.Reflection.MethodBase.GetCurrentMethod().Name,
  759. ex.ToString(),
  760. LocalPath.LogExePath);
  761. try
  762. {
  763. string ss = JsonHelper.ToJson(productionDataEntitys);
  764. OutputLog.TraceLog(LogPriority.Error,
  765. this.ToString(),
  766. System.Reflection.MethodBase.GetCurrentMethod().Name,
  767. $" userCode:{userCode} procedureID:{procedureID} " + ss,
  768. LocalPath.LogExePath);
  769. }
  770. catch
  771. {
  772. }
  773. actionResult.Status = (int)Constant.PDAResult.Exception;
  774. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  775. }
  776. return actionResult;
  777. }
  778. #endregion
  779. #region 获得系统/基数数据
  780. /// <summary>
  781. /// 获得数据字典
  782. /// </summary>
  783. /// <param name="accountCode">帐套code</param>
  784. /// <param name="userCode">用户code</param>
  785. /// <param name="userPassword">用户密码</param>
  786. /// <param name="sessionKey">本次登陆密钥</param>
  787. /// <param name="dicType">字典类型</param>
  788. /// <returns></returns>
  789. public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  790. {
  791. ActionResult actionResult = new ActionResult();
  792. try
  793. {
  794. // 验证请求头信息
  795. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  796. // 验证失败
  797. if (actionResult.Status != (int)Constant.PDAResult.Success)
  798. {
  799. return actionResult;
  800. }
  801. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  802. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  803. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  804. actionResult.Status = (int)Constant.PDAResult.Success;
  805. }
  806. catch (Exception ex)
  807. {
  808. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  809. OutputLog.TraceLog(LogPriority.Error,
  810. this.ToString(),
  811. System.Reflection.MethodBase.GetCurrentMethod().Name,
  812. ex.ToString(),
  813. LocalPath.LogExePath);
  814. actionResult.Status = (int)Constant.PDAResult.Exception;
  815. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  816. }
  817. return actionResult;
  818. }
  819. #endregion
  820. #region 检验工序接口
  821. /// <summary>
  822. /// 获得检验标识
  823. /// </summary>
  824. /// <param name="accountCode">帐套code</param>
  825. /// <param name="userCode">用户code</param>
  826. /// <param name="userPassword">用户密码</param>
  827. /// <param name="sessionKey">本次登陆密钥</param>
  828. /// <returns></returns>
  829. /// <remarks>
  830. /// 陈冰 2014.10.04 新建
  831. /// </remarks>
  832. public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey)
  833. {
  834. ActionResult actionResult = new ActionResult();
  835. try
  836. {
  837. // 验证请求头信息
  838. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  839. // 验证失败
  840. if (actionResult.Status != (int)Constant.PDAResult.Success)
  841. {
  842. return actionResult;
  843. }
  844. #region 构造缺陷标识的数据源
  845. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  846. #endregion
  847. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  848. actionResult.Status = (int)Constant.PDAResult.Success;
  849. }
  850. catch (Exception ex)
  851. {
  852. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  853. OutputLog.TraceLog(LogPriority.Error,
  854. this.ToString(),
  855. System.Reflection.MethodBase.GetCurrentMethod().Name,
  856. ex.ToString(),
  857. LocalPath.LogExePath);
  858. actionResult.Status = (int)Constant.PDAResult.Exception;
  859. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  860. }
  861. return actionResult;
  862. }
  863. /// <summary>
  864. /// 由条码和当前检验工序获取返工工序
  865. /// </summary>
  866. /// <param name="accountCode">帐套code</param>
  867. /// <param name="userCode">用户code</param>
  868. /// <param name="userPassword">用户密码</param>
  869. /// <param name="sessionKey">本次登陆密钥</param>
  870. /// <param name="procedureID">当前检验工序ID</param>
  871. /// <param name="barcode">条码</param>
  872. /// <returns></returns>
  873. /// <remarks>
  874. /// 陈冰 2014.10.04 新建
  875. /// </remarks>
  876. public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  877. {
  878. ActionResult actionResult = new ActionResult();
  879. try
  880. {
  881. // 验证请求头信息
  882. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  883. // 验证失败
  884. if (actionResult.Status != (int)Constant.PDAResult.Success)
  885. {
  886. return actionResult;
  887. }
  888. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  889. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  890. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  891. {
  892. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  893. actionResult.Status = (int)Constant.PDAResult.Success;
  894. }
  895. else
  896. {
  897. actionResult.Status = (int)Constant.PDAResult.Fail;
  898. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  899. }
  900. }
  901. catch (Exception ex)
  902. {
  903. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  904. OutputLog.TraceLog(LogPriority.Error,
  905. this.ToString(),
  906. System.Reflection.MethodBase.GetCurrentMethod().Name,
  907. ex.ToString(),
  908. LocalPath.LogExePath);
  909. actionResult.Status = (int)Constant.PDAResult.Exception;
  910. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  911. }
  912. return actionResult;
  913. }
  914. /// <summary>
  915. /// 由当前检验工序获取缺陷列表
  916. /// </summary>
  917. /// <param name="accountCode">帐套code</param>
  918. /// <param name="userCode">用户code</param>
  919. /// <param name="userPassword">用户密码</param>
  920. /// <param name="sessionKey">本次登陆密钥</param>
  921. /// <param name="procedureID">当前检验工序ID</param>
  922. /// <param name="defectCode">缺陷编码</param>
  923. /// <returns></returns>
  924. /// <remarks>
  925. /// 陈冰 2014.10.04 新建
  926. /// </remarks>
  927. public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  928. {
  929. ActionResult actionResult = new ActionResult();
  930. try
  931. {
  932. // 验证请求头信息
  933. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  934. // 验证失败
  935. if (actionResult.Status != (int)Constant.PDAResult.Success)
  936. {
  937. return actionResult;
  938. }
  939. object defectDs = ServiceInvoker.Invoke<object>(this,
  940. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  941. if (defectDs != null)
  942. {
  943. actionResult.Result = JsonHelper.ToJson(defectDs);
  944. actionResult.Status = (int)Constant.PDAResult.Success;
  945. }
  946. else
  947. {
  948. actionResult.Status = (int)Constant.PDAResult.Fail;
  949. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  950. }
  951. }
  952. catch (Exception ex)
  953. {
  954. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  955. OutputLog.TraceLog(LogPriority.Error,
  956. this.ToString(),
  957. System.Reflection.MethodBase.GetCurrentMethod().Name,
  958. ex.ToString(),
  959. LocalPath.LogExePath);
  960. actionResult.Status = (int)Constant.PDAResult.Exception;
  961. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  962. }
  963. return actionResult;
  964. }
  965. /// <summary>
  966. /// 根据产品ID查出缺陷位置
  967. /// </summary>
  968. /// <param name="accountCode">帐套code</param>
  969. /// <param name="userCode">用户code</param>
  970. /// <param name="userPassword">用户密码</param>
  971. /// <param name="sessionKey">本次登陆密钥</param>
  972. /// <param name="goodsID">产品ID</param>
  973. /// <param name="positionCode">位置编码</param>
  974. /// <returns></returns>
  975. /// <remarks>
  976. /// 陈冰 2014.10.04 新建
  977. /// </remarks>
  978. public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  979. {
  980. ActionResult actionResult = new ActionResult();
  981. try
  982. {
  983. // 验证请求头信息
  984. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  985. // 验证失败
  986. if (actionResult.Status != (int)Constant.PDAResult.Success)
  987. {
  988. return actionResult;
  989. }
  990. // 缺陷位置已经不用在关联产品
  991. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  992. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  993. if (defectDs != null)
  994. {
  995. actionResult.Result = JsonHelper.ToJson(defectDs);
  996. actionResult.Status = (int)Constant.PDAResult.Success;
  997. }
  998. else
  999. {
  1000. actionResult.Status = (int)Constant.PDAResult.Fail;
  1001. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1002. }
  1003. }
  1004. catch (Exception ex)
  1005. {
  1006. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1007. OutputLog.TraceLog(LogPriority.Error,
  1008. this.ToString(),
  1009. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1010. ex.ToString(),
  1011. LocalPath.LogExePath);
  1012. actionResult.Status = (int)Constant.PDAResult.Exception;
  1013. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1014. }
  1015. return actionResult;
  1016. }
  1017. /// <summary>
  1018. /// 通过条码和缺陷查出责任工序
  1019. /// </summary>
  1020. /// <param name="accountCode">帐套code</param>
  1021. /// <param name="userCode">用户code</param>
  1022. /// <param name="userPassword">用户密码</param>
  1023. /// <param name="sessionKey">本次登陆密钥</param>
  1024. /// <param name="barcode">条码</param>
  1025. /// <param name="defectid">缺陷ID</param>
  1026. /// <returns></returns>
  1027. /// <remarks>
  1028. /// 陈冰 2014.10.04 新建
  1029. /// </remarks>
  1030. public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  1031. {
  1032. ActionResult actionResult = new ActionResult();
  1033. try
  1034. {
  1035. // 验证请求头信息
  1036. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1037. // 验证失败
  1038. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1039. {
  1040. return actionResult;
  1041. }
  1042. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1043. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  1044. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1045. {
  1046. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  1047. actionResult.Status = (int)Constant.PDAResult.Success;
  1048. }
  1049. else
  1050. {
  1051. actionResult.Status = (int)Constant.PDAResult.Fail;
  1052. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1053. }
  1054. }
  1055. catch (Exception ex)
  1056. {
  1057. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1058. OutputLog.TraceLog(LogPriority.Error,
  1059. this.ToString(),
  1060. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1061. ex.ToString(),
  1062. LocalPath.LogExePath);
  1063. actionResult.Status = (int)Constant.PDAResult.Exception;
  1064. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1065. }
  1066. return actionResult;
  1067. }
  1068. /// <summary>
  1069. /// 通过条码与工序查出责任工号(己废)
  1070. /// </summary>
  1071. /// <param name="accountCode">帐套code</param>
  1072. /// <param name="userCode">用户code</param>
  1073. /// <param name="userPassword">用户密码</param>
  1074. /// <param name="sessionKey">本次登陆密钥</param>
  1075. /// <param name="barcode">条码</param>
  1076. /// <param name="dutyProcedureID">责任工序</param>
  1077. /// <returns></returns>
  1078. /// <remarks>
  1079. /// 陈冰 2014.10.04 新建
  1080. /// </remarks>
  1081. public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  1082. {
  1083. ActionResult actionResult = new ActionResult();
  1084. try
  1085. {
  1086. // 验证请求头信息
  1087. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1088. // 验证失败
  1089. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1090. {
  1091. return actionResult;
  1092. }
  1093. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1094. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  1095. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1096. {
  1097. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1098. actionResult.Status = (int)Constant.PDAResult.Success;
  1099. }
  1100. else
  1101. {
  1102. actionResult.Status = (int)Constant.PDAResult.Fail;
  1103. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1104. }
  1105. }
  1106. catch (Exception ex)
  1107. {
  1108. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1109. OutputLog.TraceLog(LogPriority.Error,
  1110. this.ToString(),
  1111. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1112. ex.ToString(),
  1113. LocalPath.LogExePath);
  1114. actionResult.Status = (int)Constant.PDAResult.Exception;
  1115. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1116. }
  1117. return actionResult;
  1118. }
  1119. /// <summary>
  1120. /// 通过条码与工序查出责任工号
  1121. /// </summary>
  1122. /// <param name="accountCode"></param>
  1123. /// <param name="userCode"></param>
  1124. /// <param name="userPassword"></param>
  1125. /// <param name="sessionKey"></param>
  1126. /// <param name="ProductionDataID">生产数据ID</param>
  1127. /// <returns></returns>
  1128. public ActionResult GetDutyProcedureCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1129. {
  1130. ActionResult actionResult = new ActionResult();
  1131. try
  1132. {
  1133. // 验证请求头信息
  1134. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1135. // 验证失败
  1136. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1137. {
  1138. return actionResult;
  1139. }
  1140. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1141. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1142. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1143. {
  1144. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1145. actionResult.Status = (int)Constant.PDAResult.Success;
  1146. }
  1147. else
  1148. {
  1149. actionResult.Status = (int)Constant.PDAResult.Fail;
  1150. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1151. }
  1152. }
  1153. catch (Exception ex)
  1154. {
  1155. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1156. OutputLog.TraceLog(LogPriority.Error,
  1157. this.ToString(),
  1158. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1159. ex.ToString(),
  1160. LocalPath.LogExePath);
  1161. actionResult.Status = (int)Constant.PDAResult.Exception;
  1162. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1163. }
  1164. return actionResult;
  1165. }
  1166. /// <summary>
  1167. /// 通过生产数据与工号ID查询工种
  1168. /// </summary>
  1169. /// <param name="accountCode">帐套code</param>
  1170. /// <param name="userCode">用户code</param>
  1171. /// <param name="userPassword">用户密码</param>
  1172. /// <param name="sessionKey">本次登陆密钥</param>
  1173. /// <param name="productionDataID">生产数据ID</param>
  1174. /// <param name="userID">工号ID</param>
  1175. /// <returns></returns>
  1176. /// <remarks>
  1177. /// 陈冰 2014.10.08 新建
  1178. /// </remarks>
  1179. public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey,
  1180. //int productionDataID, int userID)
  1181. int classesSettingID, int defectid, int procedureID)
  1182. {
  1183. ActionResult actionResult = new ActionResult();
  1184. try
  1185. {
  1186. // 验证请求头信息
  1187. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1188. // 验证失败
  1189. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1190. {
  1191. return actionResult;
  1192. }
  1193. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1194. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1195. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  1196. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1197. {
  1198. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1199. actionResult.Status = (int)Constant.PDAResult.Success;
  1200. }
  1201. else
  1202. {
  1203. actionResult.Status = (int)Constant.PDAResult.Fail;
  1204. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1205. }
  1206. }
  1207. catch (Exception ex)
  1208. {
  1209. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1210. OutputLog.TraceLog(LogPriority.Error,
  1211. this.ToString(),
  1212. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1213. ex.ToString(),
  1214. LocalPath.LogExePath);
  1215. actionResult.Status = (int)Constant.PDAResult.Exception;
  1216. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1217. }
  1218. return actionResult;
  1219. }
  1220. /// <summary>
  1221. /// 根据生产数据ID,用户ID及工种选出责任员工
  1222. /// </summary>
  1223. /// <param name="accountCode">帐套code</param>
  1224. /// <param name="userCode">用户code</param>
  1225. /// <param name="userPassword">用户密码</param>
  1226. /// <param name="sessionKey">本次登陆密钥</param>
  1227. /// <param name="productionDataID">生产数据ID</param>
  1228. /// <param name="userID">工号ID</param>
  1229. /// <param name="jobsID">工种ID</param>
  1230. /// <returns></returns>
  1231. /// <remarks>
  1232. /// 陈冰 2014.10.08 新建
  1233. /// </remarks>
  1234. public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey,
  1235. //int productionDataID, int userID, int jobsID)
  1236. int classesSettingID, int jobsID)
  1237. {
  1238. ActionResult actionResult = new ActionResult();
  1239. try
  1240. {
  1241. // 验证请求头信息
  1242. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1243. // 验证失败
  1244. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1245. {
  1246. return actionResult;
  1247. }
  1248. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1249. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1250. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1251. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1252. {
  1253. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1254. actionResult.Status = (int)Constant.PDAResult.Success;
  1255. }
  1256. else
  1257. {
  1258. actionResult.Status = (int)Constant.PDAResult.Fail;
  1259. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1260. }
  1261. }
  1262. catch (Exception ex)
  1263. {
  1264. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1265. OutputLog.TraceLog(LogPriority.Error,
  1266. this.ToString(),
  1267. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1268. ex.ToString(),
  1269. LocalPath.LogExePath);
  1270. actionResult.Status = (int)Constant.PDAResult.Exception;
  1271. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1272. }
  1273. return actionResult;
  1274. }
  1275. /// <summary>
  1276. /// 获得产品分级
  1277. /// </summary>
  1278. /// <param name="accountCode">帐套code</param>
  1279. /// <param name="userCode">用户code</param>
  1280. /// <param name="userPassword">用户密码</param>
  1281. /// <param name="sessionKey">本次登陆密钥</param>
  1282. /// <returns></returns>
  1283. /// <remarks>
  1284. /// 陈冰 2014.10.08 新建
  1285. /// xuwei 2019-12-4 添加参数type 默认为2成检 为1时 半检
  1286. /// </remarks>
  1287. public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey, int type = 2)
  1288. {
  1289. ActionResult actionResult = new ActionResult();
  1290. try
  1291. {
  1292. // 验证请求头信息
  1293. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1294. // 验证失败
  1295. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1296. {
  1297. return actionResult;
  1298. }
  1299. #region 构造产品分级的数据源
  1300. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1301. //xuwei modify 2019-12-04 支持半检 没传参数 type=0
  1302. //DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2 , sUserInfo);
  1303. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(type == 0 ? 2 : type, sUserInfo);
  1304. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1305. {
  1306. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1307. actionResult.Status = (int)Constant.PDAResult.Success;
  1308. }
  1309. else
  1310. {
  1311. actionResult.Status = (int)Constant.PDAResult.Fail;
  1312. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1313. }
  1314. #endregion
  1315. }
  1316. catch (Exception ex)
  1317. {
  1318. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1319. OutputLog.TraceLog(LogPriority.Error,
  1320. this.ToString(),
  1321. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1322. ex.ToString(),
  1323. LocalPath.LogExePath);
  1324. OutputLog.TraceLog(LogPriority.Error,
  1325. this.ToString(),
  1326. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1327. ex.ToString(),
  1328. LocalPath.LogExePath);
  1329. actionResult.Status = (int)Constant.PDAResult.Exception;
  1330. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1331. }
  1332. return actionResult;
  1333. }
  1334. #endregion
  1335. #region 保存检验条码
  1336. /// <summary>
  1337. /// 保存检验条码
  1338. /// </summary>
  1339. /// <param name="accountCode">帐套code</param>
  1340. /// <param name="userCode">用户code</param>
  1341. /// <param name="userPassword">用户密码</param>
  1342. /// <param name="sessionKey">本次登陆密钥</param>
  1343. /// <param name="procedureID">工序ID</param>
  1344. /// <param name="productionDataEntitys">条码信息</param>
  1345. /// <returns></returns>
  1346. public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1347. {
  1348. ActionResult actionResult = new ActionResult();
  1349. if (productionDataEntitys == null || productionDataEntitys.Length == 0 ||
  1350. string.IsNullOrWhiteSpace(productionDataEntitys[0].Barcode))
  1351. {
  1352. actionResult.Status = (int)Constant.PDAResult.Fail;
  1353. actionResult.Message = "无效条码";
  1354. return actionResult;
  1355. }
  1356. try
  1357. {
  1358. // 验证请求头信息
  1359. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1360. // 验证失败
  1361. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1362. {
  1363. return actionResult;
  1364. }
  1365. //if(productionDataEntitys.Length>0)
  1366. //{
  1367. // if(productionDataEntitys[0].ProductionDataID>0)
  1368. // {
  1369. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1370. // }
  1371. //}
  1372. string err = ServiceInvoker.Invoke<string>(this,
  1373. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1374. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1375. if (err == null)
  1376. {
  1377. err = "";
  1378. }
  1379. if (err == "DataDouble")
  1380. {
  1381. actionResult.Result = string.Format(Messages.MSG_HR_W006, "成检", "保存");
  1382. actionResult.Status = 2;
  1383. return actionResult;
  1384. }
  1385. else if (!string.IsNullOrEmpty(err))
  1386. {
  1387. actionResult.Result = err;
  1388. actionResult.Message = err;
  1389. actionResult.Status = 666;
  1390. return actionResult;
  1391. }
  1392. //actionResult.Result = JsonHelper.ToJson(err);
  1393. actionResult.Result = err;// JsonHelper.ToJson(err);
  1394. actionResult.Status = (int)Constant.PDAResult.Success;
  1395. }
  1396. catch (Exception ex)
  1397. {
  1398. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1399. OutputLog.TraceLog(LogPriority.Error,
  1400. this.ToString(),
  1401. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1402. ex.ToString(),
  1403. LocalPath.LogExePath);
  1404. actionResult.Status = (int)Constant.PDAResult.Exception;
  1405. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1406. }
  1407. return actionResult;
  1408. }
  1409. /// <summary>
  1410. /// 保存检验条码
  1411. /// </summary>
  1412. /// <param name="accountCode">帐套code</param>
  1413. /// <param name="userCode">用户code</param>
  1414. /// <param name="userPassword">用户密码</param>
  1415. /// <param name="sessionKey">本次登陆密钥</param>
  1416. /// <param name="procedureID">工序ID</param>
  1417. /// <param name="productionDataEntitys">条码信息</param>
  1418. /// <returns></returns>
  1419. public ActionResult AddBarcodeIdnrkScrap(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1420. {
  1421. ActionResult actionResult = new ActionResult();
  1422. if (productionDataEntitys == null || productionDataEntitys.Length == 0 ||
  1423. string.IsNullOrWhiteSpace(productionDataEntitys[0].Barcode))
  1424. {
  1425. actionResult.Status = (int)Constant.PDAResult.Fail;
  1426. actionResult.Message = "无效条码";
  1427. return actionResult;
  1428. }
  1429. try
  1430. {
  1431. // 验证请求头信息
  1432. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1433. // 验证失败
  1434. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1435. {
  1436. return actionResult;
  1437. }
  1438. string err = ServiceInvoker.Invoke<string>(this,
  1439. () => PMModuleLogicDAL.AddBarcodeIdnrkScrapPDA(procedureID, productionDataEntitys, sUserInfo));
  1440. if (err == null)
  1441. {
  1442. err = "";
  1443. }
  1444. actionResult.Result = err;
  1445. actionResult.Status = (int)Constant.PDAResult.Success;
  1446. }
  1447. catch (Exception ex)
  1448. {
  1449. OutputLog.TraceLog(LogPriority.Error,
  1450. this.ToString(),
  1451. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1452. ex.ToString(),
  1453. LocalPath.LogExePath);
  1454. actionResult.Status = (int)Constant.PDAResult.Exception;
  1455. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1456. }
  1457. return actionResult;
  1458. }
  1459. #endregion
  1460. #region 文件上传下载
  1461. /// <summary>
  1462. /// 软件更新
  1463. /// </summary>
  1464. /// <param name="accountCode">帐套code</param>
  1465. /// <param name="userCode">用户code</param>
  1466. /// <param name="userPassword">用户密码</param>
  1467. /// <param name="sessionKey">本次登陆密钥</param>
  1468. /// <returns></returns>
  1469. public Stream AutoUpgradeNew(string accountCode, string userCode, string userPassword, string sessionKey,int sdk)
  1470. {
  1471. try
  1472. {
  1473. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade(sdk));
  1474. }
  1475. catch (Exception ex)
  1476. {
  1477. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1478. OutputLog.TraceLog(LogPriority.Error,
  1479. this.ToString(),
  1480. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1481. ex.ToString(),
  1482. LocalPath.LogExePath);
  1483. return null;
  1484. }
  1485. }
  1486. /// <summary>
  1487. /// 软件更新
  1488. /// </summary>
  1489. /// <param name="accountCode">帐套code</param>
  1490. /// <param name="userCode">用户code</param>
  1491. /// <param name="userPassword">用户密码</param>
  1492. /// <param name="sessionKey">本次登陆密钥</param>
  1493. /// <returns></returns>
  1494. public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey)
  1495. {
  1496. try
  1497. {
  1498. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1499. }
  1500. catch (Exception ex)
  1501. {
  1502. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1503. OutputLog.TraceLog(LogPriority.Error,
  1504. this.ToString(),
  1505. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1506. ex.ToString(),
  1507. LocalPath.LogExePath);
  1508. return null;
  1509. }
  1510. }
  1511. /// <summary>
  1512. /// 上传临时文件
  1513. /// </summary>
  1514. /// <param name="imgStream"></param>
  1515. /// <returns></returns>
  1516. public ActionResult SaveImg(Stream mageStream)
  1517. {
  1518. ActionResult actionResult = new ActionResult();
  1519. try
  1520. {
  1521. string err = PDAModuleLogic.SaveImg(mageStream);
  1522. if (err == null)
  1523. {
  1524. err = "";
  1525. }
  1526. actionResult.Result = err;
  1527. actionResult.Status = (int)Constant.PDAResult.Success;
  1528. }
  1529. catch (Exception ex)
  1530. {
  1531. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1532. OutputLog.TraceLog(LogPriority.Error,
  1533. this.ToString(),
  1534. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1535. ex.ToString(),
  1536. LocalPath.LogExePath);
  1537. actionResult.Status = (int)Constant.PDAResult.Exception;
  1538. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1539. }
  1540. return actionResult;
  1541. }
  1542. public Stream GetFileTest(string path)
  1543. {
  1544. return PDAModuleLogic.GetImg(path);
  1545. }
  1546. public Stream GetFileStream()
  1547. {
  1548. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1549. long l = fs.Length;
  1550. return fs;
  1551. }
  1552. public byte[] GetFileTestByte(string path)
  1553. {
  1554. FileStream stream = new FileInfo(path).OpenRead();
  1555. Byte[] buffer = new Byte[stream.Length];
  1556. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1557. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1558. return buffer;
  1559. }
  1560. public string GetFile(string path)
  1561. {
  1562. string imgFilePath = path;
  1563. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1564. int i = (int)fs.Length;
  1565. byte[] content = new byte[i];
  1566. fs.Read(content, 0, i);
  1567. string result = Convert.ToBase64String(content);
  1568. fs.Close();
  1569. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1570. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1571. sw.Write(result);
  1572. sw.Close();
  1573. fsTxt.Close();
  1574. return result;
  1575. }
  1576. #endregion
  1577. /// <summary>
  1578. /// 获得产品分级
  1579. /// </summary>
  1580. /// <param name="accountCode">帐套code</param>
  1581. /// <param name="userCode">用户code</param>
  1582. /// <param name="userPassword">用户密码</param>
  1583. /// <param name="sessionKey">本次登陆密钥</param>
  1584. /// <param name="procedureID">当前工序ID</param>
  1585. /// <returns></returns>
  1586. /// <remarks>
  1587. /// 陈冰 2014.10.22 新建
  1588. /// </remarks>
  1589. public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1590. {
  1591. ActionResult actionResult = new ActionResult();
  1592. try
  1593. {
  1594. // 验证请求头信息
  1595. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1596. // 验证失败
  1597. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1598. {
  1599. return actionResult;
  1600. }
  1601. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1602. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1603. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1604. {
  1605. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1606. actionResult.Status = (int)Constant.PDAResult.Success;
  1607. }
  1608. else
  1609. {
  1610. actionResult.Status = (int)Constant.PDAResult.Fail;
  1611. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1612. }
  1613. }
  1614. catch (Exception ex)
  1615. {
  1616. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1617. OutputLog.TraceLog(LogPriority.Error,
  1618. this.ToString(),
  1619. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1620. ex.ToString(),
  1621. LocalPath.LogExePath);
  1622. actionResult.Status = (int)Constant.PDAResult.Exception;
  1623. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1624. }
  1625. return actionResult;
  1626. }
  1627. /// <summary>
  1628. /// 获得产品分级
  1629. /// </summary>
  1630. /// <param name="accountCode">帐套code</param>
  1631. /// <param name="userCode">用户code</param>
  1632. /// <param name="userPassword">用户密码</param>
  1633. /// <param name="sessionKey">本次登陆密钥</param>
  1634. /// <param name="barcode">条码</param>
  1635. /// <returns></returns>
  1636. public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1637. {
  1638. ActionResult actionResult = new ActionResult();
  1639. try
  1640. {
  1641. // 验证请求头信息
  1642. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1643. // 验证失败
  1644. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1645. {
  1646. return actionResult;
  1647. }
  1648. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1649. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1650. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1651. {
  1652. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1653. actionResult.Status = (int)Constant.PDAResult.Success;
  1654. }
  1655. else
  1656. {
  1657. actionResult.Status = (int)Constant.PDAResult.Fail;
  1658. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1659. }
  1660. }
  1661. catch (Exception ex)
  1662. {
  1663. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1664. OutputLog.TraceLog(LogPriority.Error,
  1665. this.ToString(),
  1666. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1667. ex.ToString(),
  1668. LocalPath.LogExePath);
  1669. actionResult.Status = (int)Constant.PDAResult.Exception;
  1670. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1671. }
  1672. return actionResult;
  1673. }
  1674. #region 统计
  1675. /// <summary>
  1676. /// 统计当日计数数量
  1677. /// </summary>
  1678. /// <param name="accountCode">帐套code</param>
  1679. /// <param name="userCode">用户code</param>
  1680. /// <param name="userPassword">用户密码</param>
  1681. /// <param name="sessionKey">本次登陆密钥</param>
  1682. /// <param name="procedureID">工序ID</param>
  1683. /// <returns></returns>
  1684. public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1685. {
  1686. ActionResult actionResult = new ActionResult();
  1687. try
  1688. {
  1689. // 验证请求头信息
  1690. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1691. // 验证失败
  1692. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1693. {
  1694. return actionResult;
  1695. }
  1696. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1697. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1698. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1699. {
  1700. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1701. actionResult.Status = (int)Constant.PDAResult.Success;
  1702. }
  1703. else
  1704. {
  1705. actionResult.Status = (int)Constant.PDAResult.Fail;
  1706. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1707. }
  1708. }
  1709. catch (Exception ex)
  1710. {
  1711. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1712. OutputLog.TraceLog(LogPriority.Error,
  1713. this.ToString(),
  1714. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1715. ex.ToString(),
  1716. LocalPath.LogExePath);
  1717. actionResult.Status = (int)Constant.PDAResult.Exception;
  1718. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1719. }
  1720. return actionResult;
  1721. }
  1722. /// <summary>
  1723. /// 统计当日计数数量
  1724. /// </summary>
  1725. /// <param name="accountCode">帐套code</param>
  1726. /// <param name="userCode">用户code</param>
  1727. /// <param name="userPassword">用户密码</param>
  1728. /// <param name="sessionKey">本次登陆密钥</param>
  1729. /// <param name="procedureID">工序ID</param>
  1730. /// <returns></returns>
  1731. public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1732. {
  1733. ActionResult actionResult = new ActionResult();
  1734. try
  1735. {
  1736. // 验证请求头信息
  1737. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1738. // 验证失败
  1739. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1740. {
  1741. return actionResult;
  1742. }
  1743. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1744. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1745. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1746. {
  1747. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1748. actionResult.Status = (int)Constant.PDAResult.Success;
  1749. }
  1750. else
  1751. {
  1752. actionResult.Status = (int)Constant.PDAResult.Fail;
  1753. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1754. }
  1755. }
  1756. catch (Exception ex)
  1757. {
  1758. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1759. OutputLog.TraceLog(LogPriority.Error,
  1760. this.ToString(),
  1761. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1762. ex.ToString(),
  1763. LocalPath.LogExePath);
  1764. actionResult.Status = (int)Constant.PDAResult.Exception;
  1765. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1766. }
  1767. return actionResult;
  1768. }
  1769. /// <summary>
  1770. /// 统计产品跟踪
  1771. /// </summary>
  1772. /// <param name="accountCode">帐套code</param>
  1773. /// <param name="userCode">用户code</param>
  1774. /// <param name="userPassword">用户密码</param>
  1775. /// <param name="sessionKey">本次登陆密钥</param>
  1776. /// <param name="procedureID">工序ID</param>
  1777. /// <returns></returns>
  1778. public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1779. {
  1780. ActionResult actionResult = new ActionResult();
  1781. try
  1782. {
  1783. // 验证请求头信息
  1784. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1785. // 验证失败
  1786. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1787. {
  1788. return actionResult;
  1789. }
  1790. RPT020101_SE se = new RPT020101_SE();
  1791. se.Barcode = barcode;
  1792. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1793. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1794. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1795. {
  1796. actionResult.Status = (int)Constant.PDAResult.Fail;
  1797. actionResult.Message = Messages.MSG_CMN_I002;
  1798. }
  1799. else
  1800. {
  1801. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1802. actionResult.Status = (int)Constant.PDAResult.Success;
  1803. }
  1804. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1805. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1806. //if (productionDataEntity != null)
  1807. //{
  1808. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1809. // actionResult.Status = (int)Constant.PDAResult.Success;
  1810. //}
  1811. //else
  1812. //{
  1813. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1814. // actionResult.Message = Messages.MSG_CMN_I002;
  1815. //}
  1816. }
  1817. catch (Exception ex)
  1818. {
  1819. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1820. OutputLog.TraceLog(LogPriority.Error,
  1821. this.ToString(),
  1822. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1823. ex.ToString() + ex.HelpLink,
  1824. LocalPath.LogExePath);
  1825. actionResult.Status = (int)Constant.PDAResult.Exception;
  1826. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1827. }
  1828. return actionResult;
  1829. }
  1830. #endregion
  1831. #region 撤销装车及成检
  1832. /// <summary>
  1833. /// 检验条码是否可以撤销装车
  1834. /// </summary>
  1835. /// <param name="accountCode">帐套code</param>
  1836. /// <param name="userCode">用户code</param>
  1837. /// <param name="userPassword">用户密码</param>
  1838. /// <param name="sessionKey">本次登陆密钥</param>
  1839. /// <param name="procedureID">当前工序ID</param>
  1840. /// <param name="barcode">条码</param>
  1841. /// <returns></returns>
  1842. public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1843. {
  1844. ActionResult actionResult = new ActionResult();
  1845. try
  1846. {
  1847. // 验证请求头信息
  1848. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1849. // 验证失败
  1850. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1851. {
  1852. return actionResult;
  1853. }
  1854. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1855. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1856. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1857. actionResult.Status = (int)Constant.PDAResult.Success;
  1858. }
  1859. catch (Exception ex)
  1860. {
  1861. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1862. OutputLog.TraceLog(LogPriority.Error,
  1863. this.ToString(),
  1864. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1865. ex.ToString(),
  1866. LocalPath.LogExePath);
  1867. actionResult.Status = (int)Constant.PDAResult.Exception;
  1868. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1869. }
  1870. return actionResult;
  1871. }
  1872. /// <summary>
  1873. /// 保存撤销装车的条码
  1874. /// </summary>
  1875. /// <param name="accountCode">帐套code</param>
  1876. /// <param name="userCode">用户code</param>
  1877. /// <param name="userPassword">用户密码</param>
  1878. /// <param name="sessionKey">本次登陆密钥</param>
  1879. /// <param name="procedureID">当前工序ID</param>
  1880. /// <param name="barcode">条码</param>
  1881. /// <returns></returns>
  1882. public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1883. {
  1884. ActionResult actionResult = new ActionResult();
  1885. try
  1886. {
  1887. // 验证请求头信息
  1888. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1889. // 验证失败
  1890. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1891. {
  1892. return actionResult;
  1893. }
  1894. string err = ServiceInvoker.Invoke<string>(this,
  1895. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1896. if (err == null)
  1897. {
  1898. err = "";
  1899. }
  1900. actionResult.Result = JsonHelper.ToJson(err);
  1901. actionResult.Status = (int)Constant.PDAResult.Success;
  1902. }
  1903. catch (Exception ex)
  1904. {
  1905. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1906. OutputLog.TraceLog(LogPriority.Error,
  1907. this.ToString(),
  1908. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1909. ex.ToString(),
  1910. LocalPath.LogExePath);
  1911. actionResult.Status = (int)Constant.PDAResult.Exception;
  1912. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1913. }
  1914. return actionResult;
  1915. }
  1916. /// <summary>
  1917. /// 由产品条码获取注浆信息
  1918. /// </summary>
  1919. /// <param name="barcode"></param>
  1920. /// <returns></returns>
  1921. public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1922. {
  1923. ActionResult actionResult = new ActionResult();
  1924. try
  1925. {
  1926. // 验证请求头信息
  1927. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1928. // 验证失败
  1929. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1930. {
  1931. return actionResult;
  1932. }
  1933. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1934. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1935. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1936. {
  1937. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1938. actionResult.Status = (int)Constant.PDAResult.Success;
  1939. }
  1940. else
  1941. {
  1942. actionResult.Status = (int)Constant.PDAResult.Fail;
  1943. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1944. }
  1945. }
  1946. catch (Exception ex)
  1947. {
  1948. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1949. OutputLog.TraceLog(LogPriority.Error,
  1950. this.ToString(),
  1951. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1952. ex.ToString(),
  1953. LocalPath.LogExePath);
  1954. actionResult.Status = (int)Constant.PDAResult.Exception;
  1955. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1956. }
  1957. return actionResult;
  1958. }
  1959. /// <summary>
  1960. /// 获取工号下的所有工种信息
  1961. /// </summary>
  1962. /// <param name="UserID">工号ID</param>
  1963. /// <returns></returns>
  1964. public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1965. {
  1966. ActionResult actionResult = new ActionResult();
  1967. try
  1968. {
  1969. // 验证请求头信息
  1970. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1971. // 验证失败
  1972. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1973. {
  1974. return actionResult;
  1975. }
  1976. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1977. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1978. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1979. {
  1980. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1981. actionResult.Status = (int)Constant.PDAResult.Success;
  1982. }
  1983. else
  1984. {
  1985. actionResult.Status = (int)Constant.PDAResult.Fail;
  1986. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1987. }
  1988. }
  1989. catch (Exception ex)
  1990. {
  1991. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1992. OutputLog.TraceLog(LogPriority.Error,
  1993. this.ToString(),
  1994. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1995. ex.ToString(),
  1996. LocalPath.LogExePath);
  1997. actionResult.Status = (int)Constant.PDAResult.Exception;
  1998. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1999. }
  2000. return actionResult;
  2001. }
  2002. /// <summary>
  2003. /// 根据所选工号对应的工种,查出缺陷责任员工
  2004. /// </summary>
  2005. /// <param name="jobs">工种ID</param>
  2006. /// <returns></returns>
  2007. public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  2008. {
  2009. ActionResult actionResult = new ActionResult();
  2010. try
  2011. {
  2012. // 验证请求头信息
  2013. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2014. // 验证失败
  2015. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2016. {
  2017. return actionResult;
  2018. }
  2019. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2020. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  2021. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2022. {
  2023. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2024. actionResult.Status = (int)Constant.PDAResult.Success;
  2025. }
  2026. else
  2027. {
  2028. actionResult.Status = (int)Constant.PDAResult.Fail;
  2029. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2030. }
  2031. }
  2032. catch (Exception ex)
  2033. {
  2034. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2035. OutputLog.TraceLog(LogPriority.Error,
  2036. this.ToString(),
  2037. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2038. ex.ToString(),
  2039. LocalPath.LogExePath);
  2040. actionResult.Status = (int)Constant.PDAResult.Exception;
  2041. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2042. }
  2043. return actionResult;
  2044. }
  2045. /// <summary>
  2046. /// 根据所选工号,查出漏检责任员工
  2047. /// </summary>
  2048. /// <param name="userid">工号</param>
  2049. /// <returns></returns>
  2050. public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  2051. {
  2052. ActionResult actionResult = new ActionResult();
  2053. try
  2054. {
  2055. // 验证请求头信息
  2056. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2057. // 验证失败
  2058. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2059. {
  2060. return actionResult;
  2061. }
  2062. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2063. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  2064. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2065. {
  2066. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2067. actionResult.Status = (int)Constant.PDAResult.Success;
  2068. }
  2069. else
  2070. {
  2071. actionResult.Status = (int)Constant.PDAResult.Fail;
  2072. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2073. }
  2074. }
  2075. catch (Exception ex)
  2076. {
  2077. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2078. OutputLog.TraceLog(LogPriority.Error,
  2079. this.ToString(),
  2080. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2081. ex.ToString(),
  2082. LocalPath.LogExePath);
  2083. actionResult.Status = (int)Constant.PDAResult.Exception;
  2084. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2085. }
  2086. return actionResult;
  2087. }
  2088. /// <summary>
  2089. /// 获取用户列表
  2090. /// </summary>
  2091. /// <param name="requestEntity">用户实体</param>
  2092. /// <returns></returns>
  2093. public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  2094. {
  2095. ActionResult actionResult = new ActionResult();
  2096. try
  2097. {
  2098. // 验证请求头信息
  2099. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2100. // 验证失败
  2101. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2102. {
  2103. return actionResult;
  2104. }
  2105. SUserEntity requestEntity = new SUserEntity();
  2106. requestEntity.IsWorker = IsWorker;
  2107. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2108. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  2109. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2110. {
  2111. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2112. actionResult.Status = (int)Constant.PDAResult.Success;
  2113. }
  2114. else
  2115. {
  2116. actionResult.Status = (int)Constant.PDAResult.Fail;
  2117. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2118. }
  2119. }
  2120. catch (Exception ex)
  2121. {
  2122. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2123. OutputLog.TraceLog(LogPriority.Error,
  2124. this.ToString(),
  2125. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2126. ex.ToString(),
  2127. LocalPath.LogExePath);
  2128. actionResult.Status = (int)Constant.PDAResult.Exception;
  2129. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2130. }
  2131. return actionResult;
  2132. }
  2133. /// <summary>
  2134. /// 获取数据字典管理的数据
  2135. /// </summary>
  2136. /// <param name="Pvalue">显示停用标识</param>
  2137. /// <param name="dictionaryType">字典类别</param>
  2138. /// <returns></returns>
  2139. /// <remarks>
  2140. /// 2014.12.03 新建
  2141. /// </remarks>
  2142. public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  2143. {
  2144. ActionResult actionResult = new ActionResult();
  2145. try
  2146. {
  2147. // 验证请求头信息
  2148. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2149. // 验证失败
  2150. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2151. {
  2152. return actionResult;
  2153. }
  2154. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2155. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  2156. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2157. {
  2158. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2159. actionResult.Status = (int)Constant.PDAResult.Success;
  2160. }
  2161. else
  2162. {
  2163. actionResult.Status = (int)Constant.PDAResult.Fail;
  2164. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2165. }
  2166. }
  2167. catch (Exception ex)
  2168. {
  2169. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2170. OutputLog.TraceLog(LogPriority.Error,
  2171. this.ToString(),
  2172. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2173. ex.ToString(),
  2174. LocalPath.LogExePath);
  2175. actionResult.Status = (int)Constant.PDAResult.Exception;
  2176. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2177. }
  2178. return actionResult;
  2179. }
  2180. #endregion
  2181. #region 保存半检数据
  2182. /// <summary>
  2183. /// 保存半检数据
  2184. /// </summary>
  2185. /// <param name="accountCode">帐套code</param>
  2186. /// <param name="userCode">用户code</param>
  2187. /// <param name="userPassword">用户密码</param>
  2188. /// <param name="sessionKey">本次登陆密钥</param>
  2189. /// <param name="productionDataEntitys">半检信息</param>
  2190. /// <returns></returns>
  2191. public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  2192. {
  2193. ActionResult actionResult = new ActionResult();
  2194. try
  2195. {
  2196. // 验证请求头信息
  2197. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2198. // 验证失败
  2199. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2200. {
  2201. return actionResult;
  2202. }
  2203. string err = ServiceInvoker.Invoke<string>(this,
  2204. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2205. if (err == null)
  2206. {
  2207. err = "";
  2208. }
  2209. actionResult.Result = JsonHelper.ToJson(err);
  2210. actionResult.Status = (int)Constant.PDAResult.Success;
  2211. }
  2212. catch (Exception ex)
  2213. {
  2214. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2215. OutputLog.TraceLog(LogPriority.Error,
  2216. this.ToString(),
  2217. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2218. ex.ToString(),
  2219. LocalPath.LogExePath);
  2220. actionResult.Status = (int)Constant.PDAResult.Exception;
  2221. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2222. }
  2223. return actionResult;
  2224. }
  2225. #endregion
  2226. /// <summary>
  2227. /// 获取产品列表
  2228. /// </summary>
  2229. /// <returns></returns>
  2230. public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  2231. {
  2232. ActionResult actionResult = new ActionResult();
  2233. try
  2234. {
  2235. // 验证请求头信息
  2236. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2237. // 验证失败
  2238. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2239. {
  2240. return actionResult;
  2241. }
  2242. GoodsEntity goodsEntity = new GoodsEntity();
  2243. goodsEntity.ValueFlag = 1;//有效标记
  2244. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2245. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2246. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2247. {
  2248. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2249. actionResult.Status = (int)Constant.PDAResult.Success;
  2250. }
  2251. else
  2252. {
  2253. actionResult.Status = (int)Constant.PDAResult.Fail;
  2254. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2255. }
  2256. }
  2257. catch (Exception ex)
  2258. {
  2259. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2260. OutputLog.TraceLog(LogPriority.Error,
  2261. this.ToString(),
  2262. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2263. ex.ToString(),
  2264. LocalPath.LogExePath);
  2265. actionResult.Status = (int)Constant.PDAResult.Exception;
  2266. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2267. }
  2268. return actionResult;
  2269. }
  2270. /// <summary>
  2271. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2272. /// </summary>
  2273. /// <param name="searchEntity">生产数据实体类</param>
  2274. /// <returns>DataTable</returns>
  2275. public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2276. {
  2277. ActionResult actionResult = new ActionResult();
  2278. try
  2279. {
  2280. // 验证请求头信息
  2281. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2282. // 验证失败
  2283. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2284. {
  2285. return actionResult;
  2286. }
  2287. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2288. searchEntity.ProcedureID = ProcedureID;
  2289. searchEntity.BarCode = BarCode;
  2290. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2291. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2292. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2293. {
  2294. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2295. actionResult.Status = (int)Constant.PDAResult.Success;
  2296. }
  2297. else
  2298. {
  2299. actionResult.Status = (int)Constant.PDAResult.Fail;
  2300. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2301. }
  2302. }
  2303. catch (Exception ex)
  2304. {
  2305. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2306. OutputLog.TraceLog(LogPriority.Error,
  2307. this.ToString(),
  2308. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2309. ex.ToString(),
  2310. LocalPath.LogExePath);
  2311. actionResult.Status = (int)Constant.PDAResult.Exception;
  2312. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2313. }
  2314. return actionResult;
  2315. }
  2316. /// <summary>
  2317. /// xuwei add 2020-03-23 此方法用于成检后 回收 再次成检 获取正确ID
  2318. /// </summary>
  2319. /// <param name="searchEntity">生产数据实体类</param>
  2320. /// <returns>DataTable</returns>
  2321. public ActionResult GetProductionDataCheckID(string accountCode, string userCode, string userPassword, string sessionKey, string BarCode)
  2322. {
  2323. ActionResult actionResult = new ActionResult();
  2324. try
  2325. {
  2326. // 验证请求头信息
  2327. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2328. // 验证失败
  2329. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2330. {
  2331. return actionResult;
  2332. }
  2333. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2334. searchEntity.BarCode = BarCode;
  2335. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2336. () => PDAModuleLogic.GetProductionDataCheckID(searchEntity, sUserInfo));
  2337. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2338. {
  2339. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2340. actionResult.Status = (int)Constant.PDAResult.Success;
  2341. }
  2342. else
  2343. {
  2344. actionResult.Status = (int)Constant.PDAResult.Fail;
  2345. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2346. }
  2347. }
  2348. catch (Exception ex)
  2349. {
  2350. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2351. OutputLog.TraceLog(LogPriority.Error,
  2352. this.ToString(),
  2353. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2354. ex.ToString(),
  2355. LocalPath.LogExePath);
  2356. actionResult.Status = (int)Constant.PDAResult.Exception;
  2357. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2358. }
  2359. return actionResult;
  2360. }
  2361. /// <summary>
  2362. /// 根据所选生产数据ID,显示成检数据信息
  2363. /// </summary>
  2364. /// <param name="productionDataID">生产数据ID</param>
  2365. /// <returns>DataSet</returns>
  2366. public ActionResult GetProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2367. {
  2368. ActionResult actionResult = new ActionResult();
  2369. try
  2370. {
  2371. // 验证请求头信息
  2372. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2373. // 验证失败
  2374. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2375. {
  2376. return actionResult;
  2377. }
  2378. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2379. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2380. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2381. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2382. {
  2383. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2384. {
  2385. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2386. {
  2387. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2388. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2389. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2390. {
  2391. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2392. }
  2393. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2394. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2395. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2396. {
  2397. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2398. }
  2399. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2400. {
  2401. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2402. }
  2403. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2404. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2405. {
  2406. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2407. }
  2408. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2409. {
  2410. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2411. }
  2412. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2413. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2414. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2415. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2416. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2417. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2418. productionData.GlazeName = reworkDs.Tables[0].Rows[i]["GlazeName"].ToString();
  2419. productionData.LeakFlag1 = reworkDs.Tables[0].Rows[i]["LeakFlag1"].ToString();
  2420. productionData.LeakFlag2 = reworkDs.Tables[0].Rows[i]["LeakFlag2"].ToString();
  2421. productionData.LeakFlag3 = reworkDs.Tables[0].Rows[i]["LeakFlag3"].ToString();
  2422. productionData.SpecialRepairFlagName = reworkDs.Tables[0].Rows[i]["specialRepairFlagName"].ToString();
  2423. productionData.IsReFireName = reworkDs.Tables[0].Rows[i]["isReFireName"].ToString();
  2424. productionData.LeakFlag1Name = reworkDs.Tables[0].Rows[i]["LeakFlag1Name"].ToString();
  2425. productionData.LeakFlag2Name = reworkDs.Tables[0].Rows[i]["LeakFlag2Name"].ToString();
  2426. productionData.LeakFlag3Name = reworkDs.Tables[0].Rows[i]["LeakFlag3Name"].ToString();
  2427. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2428. {
  2429. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2430. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2431. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2432. }
  2433. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2434. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2435. {
  2436. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2437. }
  2438. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2439. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2440. DataTable dtDefect = dvDefect.ToTable();
  2441. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2442. {
  2443. // 产品缺陷
  2444. PDADefectResult defect = new PDADefectResult();
  2445. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2446. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2447. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2448. {
  2449. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2450. }
  2451. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2452. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2453. {
  2454. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2455. }
  2456. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2457. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2458. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2459. {
  2460. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2461. }
  2462. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2463. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2464. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2465. {
  2466. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2467. }
  2468. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2469. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2470. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2471. {
  2472. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2473. }
  2474. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2475. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2476. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2477. {
  2478. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2479. }
  2480. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2481. {
  2482. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2483. }
  2484. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2485. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2486. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2487. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2488. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2489. {
  2490. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2491. }
  2492. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2493. {
  2494. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2495. }
  2496. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2497. {
  2498. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2499. }
  2500. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2501. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2502. //--------责任员工-------------------
  2503. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2504. if (drRow.Length > Constant.INT_IS_ZERO)
  2505. {
  2506. foreach (DataRow r in drRow)
  2507. {
  2508. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2509. if (r["ProductionDefectID"].ToString() != "")
  2510. {
  2511. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2512. }
  2513. if (r["StaffID"].ToString() != "")
  2514. {
  2515. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2516. }
  2517. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2518. defectResponsible.StaffName = r["StaffName"].ToString();
  2519. if (r["StaffStatus"].ToString() != "")
  2520. {
  2521. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2522. }
  2523. if (r["UJobsID"].ToString() != "")
  2524. {
  2525. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2526. }
  2527. if (r["SJobsID"].ToString() != "")
  2528. {
  2529. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2530. }
  2531. defect.PDADefectResponsibles.Add(defectResponsible);
  2532. }
  2533. }
  2534. //------------------------------
  2535. //--------漏检员工-------------------
  2536. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2537. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2538. {
  2539. foreach (DataRow r in drMissedRow)
  2540. {
  2541. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2542. if (r["ProductionDefectID"].ToString() != "")
  2543. {
  2544. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2545. }
  2546. if (r["StaffID"].ToString() != "")
  2547. {
  2548. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2549. }
  2550. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2551. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2552. if (r["StaffStatus"].ToString() != "")
  2553. {
  2554. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2555. }
  2556. if (r["UJobsID"].ToString() != "")
  2557. {
  2558. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2559. }
  2560. if (r["SJobsID"].ToString() != "")
  2561. {
  2562. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2563. }
  2564. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2565. }
  2566. }
  2567. //------------------------------
  2568. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2569. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2570. {
  2571. foreach (DataRow r in drImageRow)
  2572. {
  2573. PDADefectImageResult defectImage = new PDADefectImageResult();
  2574. if (r["ProductionDefectID"].ToString() != "")
  2575. {
  2576. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2577. }
  2578. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2579. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2580. //{
  2581. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2582. //}
  2583. defect.PDADefectImageResults.Add(defectImage);
  2584. }
  2585. }
  2586. productionData.PDADefects.Add(defect);
  2587. }
  2588. if (productionDatas.PDAProductionData == null)
  2589. {
  2590. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2591. }
  2592. productionDatas.PDAProductionData.Add(productionData);
  2593. //---------------------------------------------------------------------------------
  2594. }
  2595. }
  2596. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2597. actionResult.Status = (int)Constant.PDAResult.Success;
  2598. }
  2599. else
  2600. {
  2601. actionResult.Status = (int)Constant.PDAResult.Fail;
  2602. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2603. }
  2604. }
  2605. catch (Exception ex)
  2606. {
  2607. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2608. OutputLog.TraceLog(LogPriority.Error,
  2609. this.ToString(),
  2610. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2611. ex.ToString(),
  2612. LocalPath.LogExePath);
  2613. actionResult.Status = (int)Constant.PDAResult.Exception;
  2614. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2615. }
  2616. return actionResult;
  2617. }
  2618. /// <summary>
  2619. /// 编辑后删除生产数据
  2620. /// </summary>
  2621. /// <param name="productionDataID">生产数据ID</param>
  2622. /// <returns>int</returns>
  2623. public ActionResult DeleteProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2624. {
  2625. ActionResult actionResult = new ActionResult();
  2626. try
  2627. {
  2628. // 验证请求头信息
  2629. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2630. // 验证失败
  2631. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2632. {
  2633. return actionResult;
  2634. }
  2635. int row = ServiceInvoker.Invoke<int>(this,
  2636. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2637. actionResult.Result = JsonHelper.ToJson(row);
  2638. actionResult.Status = (int)Constant.PDAResult.Success;
  2639. }
  2640. catch (Exception ex)
  2641. {
  2642. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2643. OutputLog.TraceLog(LogPriority.Error,
  2644. this.ToString(),
  2645. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2646. ex.ToString(),
  2647. LocalPath.LogExePath);
  2648. actionResult.Status = (int)Constant.PDAResult.Exception;
  2649. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2650. }
  2651. return actionResult;
  2652. }
  2653. /// <summary>
  2654. /// 获取产品完成工序的ID
  2655. /// </summary>
  2656. /// <param name="barcode">产品条码</param>
  2657. /// <returns>int</returns>
  2658. public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2659. {
  2660. ActionResult actionResult = new ActionResult();
  2661. try
  2662. {
  2663. // 验证请求头信息
  2664. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2665. // 验证失败
  2666. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2667. {
  2668. return actionResult;
  2669. }
  2670. int row = ServiceInvoker.Invoke<int>(this,
  2671. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2672. actionResult.Result = JsonHelper.ToJson(row);
  2673. actionResult.Status = (int)Constant.PDAResult.Success;
  2674. }
  2675. catch (Exception ex)
  2676. {
  2677. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2678. OutputLog.TraceLog(LogPriority.Error,
  2679. this.ToString(),
  2680. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2681. ex.ToString(),
  2682. LocalPath.LogExePath);
  2683. actionResult.Status = (int)Constant.PDAResult.Exception;
  2684. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2685. }
  2686. return actionResult;
  2687. }
  2688. /// <summary>
  2689. /// 绑定图片
  2690. /// </summary>
  2691. /// <param name="accountCode">帐套code</param>
  2692. /// <param name="userCode">用户code</param>
  2693. /// <param name="userPassword">用户密码</param>
  2694. /// <param name="sessionKey">本次登陆密钥</param>
  2695. /// <param name="imagePath">图片路径</param>
  2696. /// <returns></returns>
  2697. public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2698. {
  2699. try
  2700. {
  2701. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2702. }
  2703. catch (Exception ex)
  2704. {
  2705. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2706. OutputLog.TraceLog(LogPriority.Error,
  2707. this.ToString(),
  2708. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2709. ex.ToString(),
  2710. LocalPath.LogExePath);
  2711. return null;
  2712. }
  2713. }
  2714. /// <summary>
  2715. /// 根据所选工号对应的工种,查出缺陷责任员工
  2716. /// </summary>
  2717. /// <param name="jobs">工种ID</param>
  2718. /// <returns></returns>
  2719. public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2720. {
  2721. ActionResult actionResult = new ActionResult();
  2722. try
  2723. {
  2724. // 验证请求头信息
  2725. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2726. // 验证失败
  2727. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2728. {
  2729. return actionResult;
  2730. }
  2731. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2732. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2733. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2734. {
  2735. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2736. actionResult.Status = (int)Constant.PDAResult.Success;
  2737. }
  2738. else
  2739. {
  2740. actionResult.Status = (int)Constant.PDAResult.Fail;
  2741. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2742. }
  2743. }
  2744. catch (Exception ex)
  2745. {
  2746. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2747. OutputLog.TraceLog(LogPriority.Error,
  2748. this.ToString(),
  2749. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2750. ex.ToString(),
  2751. LocalPath.LogExePath);
  2752. actionResult.Status = (int)Constant.PDAResult.Exception;
  2753. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2754. }
  2755. return actionResult;
  2756. }
  2757. #region 产品报废
  2758. /// <summary>
  2759. /// 验证废弃产品唯一性
  2760. /// </summary>
  2761. /// <param name="barcode">产品条码</param>
  2762. /// <returns>int</returns>
  2763. public ActionResult ScrapProductChack(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2764. {
  2765. ActionResult actionResult = new ActionResult();
  2766. try
  2767. {
  2768. // 验证请求头信息
  2769. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2770. // 验证失败
  2771. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2772. {
  2773. return actionResult;
  2774. }
  2775. string row = ServiceInvoker.Invoke<string>(this,
  2776. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2777. string[] rm = row.Split(':');
  2778. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2779. if (rm.Length > 1)
  2780. {
  2781. actionResult.Message = rm[1];
  2782. }
  2783. actionResult.Status = (int)Constant.PDAResult.Success;
  2784. }
  2785. catch (Exception ex)
  2786. {
  2787. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2788. OutputLog.TraceLog(LogPriority.Error,
  2789. this.ToString(),
  2790. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2791. ex.ToString(),
  2792. LocalPath.LogExePath);
  2793. actionResult.Status = (int)Constant.PDAResult.Exception;
  2794. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2795. }
  2796. return actionResult;
  2797. }
  2798. /// <summary>
  2799. /// 根据条码获取该产品的在产信息以及生产数据
  2800. /// </summary>
  2801. /// <param name="Barcode">产品条码</param>
  2802. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2803. public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2804. {
  2805. ActionResult actionResult = new ActionResult();
  2806. try
  2807. {
  2808. // 验证请求头信息
  2809. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2810. // 验证失败
  2811. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2812. {
  2813. return actionResult;
  2814. }
  2815. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2816. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2817. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2818. {
  2819. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2820. actionResult.Status = (int)Constant.PDAResult.Success;
  2821. }
  2822. else
  2823. {
  2824. actionResult.Status = (int)Constant.PDAResult.Fail;
  2825. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2826. }
  2827. }
  2828. catch (Exception ex)
  2829. {
  2830. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2831. OutputLog.TraceLog(LogPriority.Error,
  2832. this.ToString(),
  2833. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2834. ex.ToString(),
  2835. LocalPath.LogExePath);
  2836. actionResult.Status = (int)Constant.PDAResult.Exception;
  2837. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2838. }
  2839. return actionResult;
  2840. }
  2841. /// <summary>
  2842. /// 根据工号查询员工档案信息
  2843. /// </summary>
  2844. /// <param name="accountCode"></param>
  2845. /// <param name="userCode"></param>
  2846. /// <param name="userPassword"></param>
  2847. /// <param name="sessionKey"></param>
  2848. /// <param name="userId"></param>
  2849. /// <returns></returns>
  2850. public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2851. {
  2852. ActionResult actionResult = new ActionResult();
  2853. try
  2854. {
  2855. // 验证请求头信息
  2856. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2857. // 验证失败
  2858. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2859. {
  2860. return actionResult;
  2861. }
  2862. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2863. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2864. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2865. {
  2866. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2867. actionResult.Status = (int)Constant.PDAResult.Success;
  2868. }
  2869. else
  2870. {
  2871. actionResult.Status = (int)Constant.PDAResult.Fail;
  2872. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2873. }
  2874. }
  2875. catch (Exception ex)
  2876. {
  2877. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2878. OutputLog.TraceLog(LogPriority.Error,
  2879. this.ToString(),
  2880. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2881. ex.ToString(),
  2882. LocalPath.LogExePath);
  2883. actionResult.Status = (int)Constant.PDAResult.Exception;
  2884. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2885. }
  2886. return actionResult;
  2887. }
  2888. /// <summary>
  2889. /// 添加废弃产品记录
  2890. /// </summary>
  2891. /// <param name="SProductEntity">废弃产品实体</param>
  2892. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2893. /// <param name="SResponsibleList">责任者集合</param>
  2894. /// <param name="userInfo">用户基本信息</param>
  2895. /// <returns>int结果返回值</returns>
  2896. /// <remarks>
  2897. /// 庄天威 2014.09.24 新建
  2898. /// </remarks>
  2899. public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey,
  2900. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2901. ScrapResponsibleEntity[] SResponsibleList)
  2902. {
  2903. ActionResult actionResult = new ActionResult();
  2904. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2905. {
  2906. actionResult.Status = (int)Constant.PDAResult.Fail;
  2907. actionResult.Message = "没有选择责任人";
  2908. }
  2909. try
  2910. {
  2911. // 验证请求头信息
  2912. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2913. // 验证失败
  2914. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2915. {
  2916. return actionResult;
  2917. }
  2918. int addRow = ServiceInvoker.Invoke<int>(this,
  2919. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  2920. actionResult.Result = JsonHelper.ToJson(addRow);
  2921. actionResult.Status = (int)Constant.PDAResult.Success;
  2922. }
  2923. catch (Exception ex)
  2924. {
  2925. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2926. OutputLog.TraceLog(LogPriority.Error,
  2927. this.ToString(),
  2928. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2929. ex.ToString(),
  2930. LocalPath.LogExePath);
  2931. actionResult.Status = (int)Constant.PDAResult.Exception;
  2932. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2933. // TODO 空指针异常问题检测
  2934. try
  2935. {
  2936. OutputLog.TraceLog(LogPriority.Error,
  2937. this.ToString(),
  2938. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2939. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  2940. LocalPath.LogExePath);
  2941. string json1 = JsonHelper.ToJson(SProductEntity);
  2942. OutputLog.TraceLog(LogPriority.Error,
  2943. this.ToString(),
  2944. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2945. "SProductEntity:" + json1,
  2946. LocalPath.LogExePath);
  2947. string json2 = JsonHelper.ToJson(RProcedureEntity);
  2948. OutputLog.TraceLog(LogPriority.Error,
  2949. this.ToString(),
  2950. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2951. "RProcedureEntity:" + json2,
  2952. LocalPath.LogExePath);
  2953. string json3 = JsonHelper.ToJson(SResponsibleList);
  2954. OutputLog.TraceLog(LogPriority.Error,
  2955. this.ToString(),
  2956. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2957. "SResponsibleList:" + json3,
  2958. LocalPath.LogExePath);
  2959. }
  2960. catch (Exception exc)
  2961. {
  2962. OutputLog.TraceLog(LogPriority.Error,
  2963. this.ToString(),
  2964. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2965. "参数输入异常:" + exc.Message,
  2966. LocalPath.LogExePath);
  2967. }
  2968. }
  2969. return actionResult;
  2970. }
  2971. /// <summary>
  2972. /// 获取产品分级的数据(根据ID)
  2973. /// </summary>
  2974. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  2975. /// <param name="GoodsLevelID">分类ID</param>
  2976. /// <param name="sUserInfo">用户基本信息</param>
  2977. /// <returns>DataSet</returns>
  2978. /// <remarks>
  2979. /// 2014.10.22 庄天威 新建
  2980. public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  2981. {
  2982. ActionResult actionResult = new ActionResult();
  2983. try
  2984. {
  2985. // 验证请求头信息
  2986. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2987. // 验证失败
  2988. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2989. {
  2990. return actionResult;
  2991. }
  2992. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2993. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  2994. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2995. {
  2996. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2997. actionResult.Status = (int)Constant.PDAResult.Success;
  2998. }
  2999. else
  3000. {
  3001. actionResult.Status = (int)Constant.PDAResult.Fail;
  3002. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3003. }
  3004. }
  3005. catch (Exception ex)
  3006. {
  3007. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3008. OutputLog.TraceLog(LogPriority.Error,
  3009. this.ToString(),
  3010. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3011. ex.ToString(),
  3012. LocalPath.LogExePath);
  3013. actionResult.Status = (int)Constant.PDAResult.Exception;
  3014. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3015. }
  3016. return actionResult;
  3017. }
  3018. /// <summary>
  3019. /// 获取账务日期
  3020. /// </summary>
  3021. /// <param name="accountCode"></param>
  3022. /// <param name="userCode"></param>
  3023. /// <param name="userPassword"></param>
  3024. /// <param name="sessionKey"></param>
  3025. /// <returns></returns>
  3026. public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey)
  3027. {
  3028. ActionResult actionResult = new ActionResult();
  3029. try
  3030. {
  3031. // 验证请求头信息
  3032. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3033. // 验证失败
  3034. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3035. {
  3036. return actionResult;
  3037. }
  3038. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  3039. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  3040. actionResult.Result = JsonHelper.ToJson(reworkDs);
  3041. actionResult.Status = (int)Constant.PDAResult.Success;
  3042. }
  3043. catch (Exception ex)
  3044. {
  3045. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3046. OutputLog.TraceLog(LogPriority.Error,
  3047. this.ToString(),
  3048. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3049. ex.ToString(),
  3050. LocalPath.LogExePath);
  3051. actionResult.Status = (int)Constant.PDAResult.Exception;
  3052. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3053. }
  3054. return actionResult;
  3055. }
  3056. /// <summary>
  3057. /// 获取登陆帐户有无报损权限
  3058. /// </summary>
  3059. /// <param name="accountCode"></param>
  3060. /// <param name="userCode"></param>
  3061. /// <param name="userPassword"></param>
  3062. /// <param name="sessionKey"></param>
  3063. /// <param name="usercode">工号编码</param>
  3064. /// <returns></returns>
  3065. public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3066. {
  3067. ActionResult actionResult = new ActionResult();
  3068. try
  3069. {
  3070. // 验证请求头信息
  3071. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3072. // 验证失败
  3073. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3074. {
  3075. return actionResult;
  3076. }
  3077. int returnValue = ServiceInvoker.Invoke<int>(this,
  3078. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  3079. actionResult.Result = JsonHelper.ToJson(returnValue);
  3080. actionResult.Status = (int)Constant.PDAResult.Success;
  3081. }
  3082. catch (Exception ex)
  3083. {
  3084. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3085. OutputLog.TraceLog(LogPriority.Error,
  3086. this.ToString(),
  3087. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3088. ex.ToString(),
  3089. LocalPath.LogExePath);
  3090. actionResult.Status = (int)Constant.PDAResult.Exception;
  3091. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3092. }
  3093. return actionResult;
  3094. }
  3095. #endregion
  3096. /// <summary>
  3097. /// 获取是否存在报损未审核产品
  3098. /// </summary>
  3099. /// <param name="barcode">产品条码</param>
  3100. /// <returns>int</returns>
  3101. public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  3102. {
  3103. ActionResult actionResult = new ActionResult();
  3104. try
  3105. {
  3106. // 验证请求头信息
  3107. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3108. // 验证失败
  3109. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3110. {
  3111. return actionResult;
  3112. }
  3113. int row = ServiceInvoker.Invoke<int>(this,
  3114. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  3115. actionResult.Result = JsonHelper.ToJson(row);
  3116. actionResult.Status = (int)Constant.PDAResult.Success;
  3117. }
  3118. catch (Exception ex)
  3119. {
  3120. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3121. OutputLog.TraceLog(LogPriority.Error,
  3122. this.ToString(),
  3123. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3124. ex.ToString(),
  3125. LocalPath.LogExePath);
  3126. actionResult.Status = (int)Constant.PDAResult.Exception;
  3127. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3128. }
  3129. return actionResult;
  3130. }
  3131. /// <summary>
  3132. /// 查询报废产品信息
  3133. /// </summary>
  3134. /// <param name="accountCode"></param>
  3135. /// <param name="userCode"></param>
  3136. /// <param name="userPassword"></param>
  3137. /// <param name="sessionKey"></param>
  3138. /// <param name="barCode">产品条码</param>
  3139. /// <param name="scrapProductID">报废产品ID</param>
  3140. /// <returns></returns>
  3141. public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  3142. {
  3143. ActionResult actionResult = new ActionResult();
  3144. try
  3145. {
  3146. // 验证请求头信息
  3147. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3148. // 验证失败
  3149. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3150. {
  3151. return actionResult;
  3152. }
  3153. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  3154. selectProEntity.BarCode = barCode;
  3155. selectProEntity.ScrapProductID = scrapProductID;
  3156. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3157. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  3158. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3159. {
  3160. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3161. actionResult.Status = (int)Constant.PDAResult.Success;
  3162. }
  3163. else
  3164. {
  3165. actionResult.Status = (int)Constant.PDAResult.Fail;
  3166. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3167. }
  3168. }
  3169. catch (Exception ex)
  3170. {
  3171. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3172. OutputLog.TraceLog(LogPriority.Error,
  3173. this.ToString(),
  3174. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3175. ex.ToString(),
  3176. LocalPath.LogExePath);
  3177. actionResult.Status = (int)Constant.PDAResult.Exception;
  3178. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3179. }
  3180. return actionResult;
  3181. }
  3182. /// <summary>
  3183. /// 根据废弃产品ID获取责任工序
  3184. /// </summary>
  3185. /// <param name="accountCode"></param>
  3186. /// <param name="userCode"></param>
  3187. /// <param name="userPassword"></param>
  3188. /// <param name="sessionKey"></param>
  3189. /// <param name="scrapProductID">报废产品ID</param>
  3190. /// <returns></returns>
  3191. public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3192. {
  3193. ActionResult actionResult = new ActionResult();
  3194. try
  3195. {
  3196. // 验证请求头信息
  3197. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3198. // 验证失败
  3199. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3200. {
  3201. return actionResult;
  3202. }
  3203. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3204. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  3205. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3206. {
  3207. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3208. actionResult.Status = (int)Constant.PDAResult.Success;
  3209. }
  3210. else
  3211. {
  3212. actionResult.Status = (int)Constant.PDAResult.Fail;
  3213. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3214. }
  3215. }
  3216. catch (Exception ex)
  3217. {
  3218. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3219. OutputLog.TraceLog(LogPriority.Error,
  3220. this.ToString(),
  3221. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3222. ex.ToString(),
  3223. LocalPath.LogExePath);
  3224. actionResult.Status = (int)Constant.PDAResult.Exception;
  3225. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3226. }
  3227. return actionResult;
  3228. }
  3229. /// <summary>
  3230. /// 根据废弃产品ID获取责任人列表
  3231. /// </summary>
  3232. /// <param name="accountCode"></param>
  3233. /// <param name="userCode"></param>
  3234. /// <param name="userPassword"></param>
  3235. /// <param name="sessionKey"></param>
  3236. /// <param name="scrapProductID">报废产品ID</param>
  3237. /// <returns></returns>
  3238. public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3239. {
  3240. ActionResult actionResult = new ActionResult();
  3241. try
  3242. {
  3243. // 验证请求头信息
  3244. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3245. // 验证失败
  3246. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3247. {
  3248. return actionResult;
  3249. }
  3250. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3251. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  3252. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3253. {
  3254. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3255. actionResult.Status = (int)Constant.PDAResult.Success;
  3256. }
  3257. else
  3258. {
  3259. actionResult.Status = (int)Constant.PDAResult.Fail;
  3260. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3261. }
  3262. }
  3263. catch (Exception ex)
  3264. {
  3265. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3266. OutputLog.TraceLog(LogPriority.Error,
  3267. this.ToString(),
  3268. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3269. ex.ToString(),
  3270. LocalPath.LogExePath);
  3271. actionResult.Status = (int)Constant.PDAResult.Exception;
  3272. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3273. }
  3274. return actionResult;
  3275. }
  3276. /// <summary>
  3277. /// 添加废弃产品记录
  3278. /// </summary>
  3279. /// <param name="SProductEntity">废弃产品实体</param>
  3280. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3281. /// <param name="SResponsibleList">责任者集合</param>
  3282. /// <param name="userInfo">用户基本信息</param>
  3283. /// <returns>int结果返回值</returns>
  3284. /// <remarks>
  3285. /// 庄天威 2014.09.24 新建
  3286. /// </remarks>
  3287. public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3288. ResponProcedureEntity UpdateRProcedureEntity,
  3289. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3290. {
  3291. ActionResult actionResult = new ActionResult();
  3292. try
  3293. {
  3294. // 验证请求头信息
  3295. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3296. // 验证失败
  3297. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3298. {
  3299. return actionResult;
  3300. }
  3301. int addRow = ServiceInvoker.Invoke<int>(this,
  3302. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3303. actionResult.Result = JsonHelper.ToJson(addRow);
  3304. actionResult.Status = (int)Constant.PDAResult.Success;
  3305. }
  3306. catch (Exception ex)
  3307. {
  3308. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3309. OutputLog.TraceLog(LogPriority.Error,
  3310. this.ToString(),
  3311. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3312. ex.ToString(),
  3313. LocalPath.LogExePath);
  3314. actionResult.Status = (int)Constant.PDAResult.Exception;
  3315. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3316. }
  3317. return actionResult;
  3318. }
  3319. /// <summary>
  3320. /// 获取产品窑炉
  3321. /// </summary>
  3322. /// <param name="accountCode"></param>
  3323. /// <param name="userCode"></param>
  3324. /// <param name="userPassword"></param>
  3325. /// <param name="sessionKey"></param>
  3326. /// <returns>Datase</returns>
  3327. public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  3328. {
  3329. ActionResult actionResult = new ActionResult();
  3330. try
  3331. {
  3332. // 验证请求头信息
  3333. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3334. // 验证失败
  3335. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3336. {
  3337. return actionResult;
  3338. }
  3339. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3340. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3341. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3342. {
  3343. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3344. actionResult.Status = (int)Constant.PDAResult.Success;
  3345. }
  3346. else
  3347. {
  3348. actionResult.Status = (int)Constant.PDAResult.Fail;
  3349. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3350. }
  3351. }
  3352. catch (Exception ex)
  3353. {
  3354. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3355. OutputLog.TraceLog(LogPriority.Error,
  3356. this.ToString(),
  3357. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3358. ex.ToString(),
  3359. LocalPath.LogExePath);
  3360. actionResult.Status = (int)Constant.PDAResult.Exception;
  3361. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3362. }
  3363. return actionResult;
  3364. }
  3365. /// <summary>
  3366. /// 获取次品产品条码允许编辑
  3367. /// </summary>
  3368. /// <param name="accountCode"></param>
  3369. /// <param name="userCode"></param>
  3370. /// <param name="userPassword"></param>
  3371. /// <param name="sessionKey"></param>
  3372. /// <param name="barcode">产品条码</param>
  3373. /// <returns>Datase</returns>
  3374. public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3375. {
  3376. ActionResult actionResult = new ActionResult();
  3377. try
  3378. {
  3379. // 验证请求头信息
  3380. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3381. // 验证失败
  3382. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3383. {
  3384. return actionResult;
  3385. }
  3386. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3387. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3388. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3389. {
  3390. actionResult.Result = JsonHelper.ToJson(1);
  3391. actionResult.Status = (int)Constant.PDAResult.Success;
  3392. }
  3393. else
  3394. {
  3395. actionResult.Result = JsonHelper.ToJson(0);
  3396. actionResult.Status = (int)Constant.PDAResult.Fail;
  3397. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3398. }
  3399. }
  3400. catch (Exception ex)
  3401. {
  3402. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3403. OutputLog.TraceLog(LogPriority.Error,
  3404. this.ToString(),
  3405. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3406. ex.ToString(),
  3407. LocalPath.LogExePath);
  3408. actionResult.Status = (int)Constant.PDAResult.Exception;
  3409. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3410. }
  3411. return actionResult;
  3412. }
  3413. /// <summary>
  3414. /// 获取产品条码是否重烧
  3415. /// </summary>
  3416. /// <param name="accountCode"></param>
  3417. /// <param name="userCode"></param>
  3418. /// <param name="userPassword"></param>
  3419. /// <param name="sessionKey"></param>
  3420. /// <param name="barcode">产品条码</param>
  3421. /// <returns>Datase</returns>
  3422. public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3423. {
  3424. ActionResult actionResult = new ActionResult();
  3425. try
  3426. {
  3427. // 验证请求头信息
  3428. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3429. // 验证失败
  3430. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3431. {
  3432. return actionResult;
  3433. }
  3434. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3435. () => PDAModuleLogic.GetReFine(barcode));
  3436. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3437. {
  3438. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3439. }
  3440. else
  3441. {
  3442. actionResult.Result = JsonHelper.ToJson(0);
  3443. }
  3444. actionResult.Status = (int)Constant.PDAResult.Success;
  3445. }
  3446. catch (Exception ex)
  3447. {
  3448. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3449. OutputLog.TraceLog(LogPriority.Error,
  3450. this.ToString(),
  3451. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3452. ex.ToString(),
  3453. LocalPath.LogExePath);
  3454. actionResult.Status = (int)Constant.PDAResult.Exception;
  3455. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3456. }
  3457. return actionResult;
  3458. }
  3459. /// <summary>
  3460. /// 获取登陆帐户有无成检编辑权限
  3461. /// </summary>
  3462. /// <param name="accountCode"></param>
  3463. /// <param name="userCode"></param>
  3464. /// <param name="userPassword"></param>
  3465. /// <param name="sessionKey"></param>
  3466. /// <param name="usercode">工号编码</param>
  3467. /// <returns></returns>
  3468. public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3469. {
  3470. ActionResult actionResult = new ActionResult();
  3471. try
  3472. {
  3473. // 验证请求头信息
  3474. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3475. // 验证失败
  3476. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3477. {
  3478. return actionResult;
  3479. }
  3480. int returnValue = ServiceInvoker.Invoke<int>(this,
  3481. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3482. actionResult.Result = JsonHelper.ToJson(returnValue);
  3483. actionResult.Status = (int)Constant.PDAResult.Success;
  3484. }
  3485. catch (Exception ex)
  3486. {
  3487. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3488. OutputLog.TraceLog(LogPriority.Error,
  3489. this.ToString(),
  3490. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3491. ex.ToString(),
  3492. LocalPath.LogExePath);
  3493. actionResult.Status = (int)Constant.PDAResult.Exception;
  3494. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3495. }
  3496. return actionResult;
  3497. }
  3498. /// <summary>
  3499. /// 根据条码及工序判断是否漏扫
  3500. /// </summary>
  3501. /// <param name="accountCode"></param>
  3502. /// <param name="userCode"></param>
  3503. /// <param name="userPassword"></param>
  3504. /// <param name="sessionKey"></param>
  3505. /// <param name="usercode">工号编码</param>
  3506. /// <param name="barcode">产品条码</param>
  3507. /// <param name="produceid">工序ID</param>
  3508. /// <returns></returns>
  3509. public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3510. {
  3511. ActionResult actionResult = new ActionResult();
  3512. try
  3513. {
  3514. // 验证请求头信息
  3515. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3516. // 验证失败
  3517. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3518. {
  3519. return actionResult;
  3520. }
  3521. int returnValue = 1;
  3522. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3523. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3524. actionResult.Result = JsonHelper.ToJson(returnValue);
  3525. actionResult.Status = (int)Constant.PDAResult.Success;
  3526. }
  3527. catch (Exception ex)
  3528. {
  3529. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3530. OutputLog.TraceLog(LogPriority.Error,
  3531. this.ToString(),
  3532. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3533. ex.ToString(),
  3534. LocalPath.LogExePath);
  3535. actionResult.Status = (int)Constant.PDAResult.Exception;
  3536. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3537. }
  3538. return actionResult;
  3539. }
  3540. /// <summary>
  3541. /// 获取登陆帐户有无报损审批权限
  3542. /// </summary>
  3543. /// <param name="accountCode"></param>
  3544. /// <param name="userCode"></param>
  3545. /// <param name="userPassword"></param>
  3546. /// <param name="sessionKey"></param>
  3547. /// <param name="usercode">工号编码</param>
  3548. /// <returns></returns>
  3549. public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3550. {
  3551. ActionResult actionResult = new ActionResult();
  3552. try
  3553. {
  3554. // 验证请求头信息
  3555. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3556. // 验证失败
  3557. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3558. {
  3559. return actionResult;
  3560. }
  3561. int returnValue = ServiceInvoker.Invoke<int>(this,
  3562. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3563. actionResult.Result = JsonHelper.ToJson(returnValue);
  3564. actionResult.Status = (int)Constant.PDAResult.Success;
  3565. }
  3566. catch (Exception ex)
  3567. {
  3568. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3569. OutputLog.TraceLog(LogPriority.Error,
  3570. this.ToString(),
  3571. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3572. ex.ToString(),
  3573. LocalPath.LogExePath);
  3574. actionResult.Status = (int)Constant.PDAResult.Exception;
  3575. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3576. }
  3577. return actionResult;
  3578. }
  3579. /// <summary>
  3580. /// 获取登陆帐户有无报损审批权限
  3581. /// </summary>
  3582. /// <param name="accountCode"></param>
  3583. /// <param name="userCode"></param>
  3584. /// <param name="userPassword"></param>
  3585. /// <param name="sessionKey"></param>
  3586. /// <param name="usercode">工号编码</param>
  3587. /// <returns></returns>
  3588. public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3589. {
  3590. ActionResult actionResult = new ActionResult();
  3591. try
  3592. {
  3593. // 验证请求头信息
  3594. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3595. // 验证失败
  3596. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3597. {
  3598. return actionResult;
  3599. }
  3600. int returnValue = ServiceInvoker.Invoke<int>(this,
  3601. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3602. actionResult.Result = JsonHelper.ToJson(returnValue);
  3603. actionResult.Status = (int)Constant.PDAResult.Success;
  3604. }
  3605. catch (Exception ex)
  3606. {
  3607. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3608. OutputLog.TraceLog(LogPriority.Error,
  3609. this.ToString(),
  3610. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3611. ex.ToString(),
  3612. LocalPath.LogExePath);
  3613. actionResult.Status = (int)Constant.PDAResult.Exception;
  3614. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3615. }
  3616. return actionResult;
  3617. }
  3618. /// <summary>
  3619. /// 获取窑车对应产品列表
  3620. /// </summary>
  3621. /// <param name="accountCode"></param>
  3622. /// <param name="userCode"></param>
  3623. /// <param name="userPassword"></param>
  3624. /// <param name="sessionKey"></param>
  3625. /// <param name="KilnCarID">窑车ID</param>
  3626. /// <returns>Dataset</returns>
  3627. public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  3628. {
  3629. ActionResult actionResult = new ActionResult();
  3630. try
  3631. {
  3632. // 验证请求头信息
  3633. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3634. // 验证失败
  3635. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3636. {
  3637. return actionResult;
  3638. }
  3639. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3640. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3641. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3642. {
  3643. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3644. actionResult.Status = (int)Constant.PDAResult.Success;
  3645. }
  3646. else
  3647. {
  3648. actionResult.Status = (int)Constant.PDAResult.Fail;
  3649. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3650. }
  3651. }
  3652. catch (Exception ex)
  3653. {
  3654. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3655. OutputLog.TraceLog(LogPriority.Error,
  3656. this.ToString(),
  3657. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3658. ex.ToString(),
  3659. LocalPath.LogExePath);
  3660. actionResult.Status = (int)Constant.PDAResult.Exception;
  3661. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3662. }
  3663. return actionResult;
  3664. }
  3665. /// <summary>
  3666. /// 更换条码
  3667. /// </summary>
  3668. /// <param name="accountCode"></param>
  3669. /// <param name="userCode"></param>
  3670. /// <param name="userPassword"></param>
  3671. /// <param name="sessionKey"></param>
  3672. ///<param name="barcode">原条码</param>
  3673. /// <param name="newBarcode">新条码</param>
  3674. /// <param name="remarks">备注</param>
  3675. /// <returns>操作结果</returns>
  3676. public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  3677. {
  3678. ActionResult actionResult = new ActionResult();
  3679. try
  3680. {
  3681. // 验证请求头信息
  3682. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3683. // 验证失败
  3684. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3685. {
  3686. return actionResult;
  3687. }
  3688. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3689. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3690. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3691. {
  3692. actionResult.Result = 1;
  3693. actionResult.Status = (int)Constant.PDAResult.Success;
  3694. }
  3695. else
  3696. {
  3697. actionResult.Status = (int)Constant.PDAResult.Fail;
  3698. actionResult.Message = serviceResultEntity.Message;
  3699. }
  3700. }
  3701. catch (Exception ex)
  3702. {
  3703. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3704. OutputLog.TraceLog(LogPriority.Error,
  3705. this.ToString(),
  3706. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3707. ex.ToString(),
  3708. LocalPath.LogExePath);
  3709. actionResult.Status = (int)Constant.PDAResult.Exception;
  3710. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3711. }
  3712. return actionResult;
  3713. }
  3714. /// <summary>
  3715. /// 获取(注浆登记)的查询数据
  3716. /// </summary>
  3717. /// <param name="accountCode"></param>
  3718. /// <param name="userCode"></param>
  3719. /// <param name="userPassword"></param>
  3720. /// <param name="sessionKey"></param>
  3721. /// <param name="se">查询条件</param>
  3722. /// <returns>Dataset</returns>
  3723. public ActionResult GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  3724. {
  3725. ActionResult actionResult = new ActionResult();
  3726. try
  3727. {
  3728. // 验证请求头信息
  3729. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3730. // 验证失败
  3731. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3732. {
  3733. return actionResult;
  3734. }
  3735. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3736. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3737. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3738. {
  3739. // PDA不显示的列删除掉
  3740. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3741. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3742. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3743. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3744. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3745. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3746. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3747. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3748. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3749. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3750. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3751. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3752. actionResult.Status = (int)Constant.PDAResult.Success;
  3753. }
  3754. else
  3755. {
  3756. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3757. actionResult.Message = "无查询数据";
  3758. }
  3759. }
  3760. catch (Exception ex)
  3761. {
  3762. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3763. OutputLog.TraceLog(LogPriority.Error,
  3764. this.ToString(),
  3765. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3766. ex.ToString(),
  3767. LocalPath.LogExePath);
  3768. actionResult.Status = (int)Constant.PDAResult.Exception;
  3769. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3770. }
  3771. return actionResult;
  3772. }
  3773. /// <summary>
  3774. /// 获取(注浆登记)的查询数据
  3775. /// </summary>
  3776. /// <param name="accountCode"></param>
  3777. /// <param name="userCode"></param>
  3778. /// <param name="userPassword"></param>
  3779. /// <param name="sessionKey"></param>
  3780. /// <param name="se">查询条件</param>
  3781. /// <returns>Dataset</returns>
  3782. public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3783. {
  3784. ActionResult actionResult = new ActionResult();
  3785. try
  3786. {
  3787. // 验证请求头信息
  3788. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3789. // 验证失败
  3790. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3791. {
  3792. return actionResult;
  3793. }
  3794. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3795. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3796. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3797. {
  3798. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3799. actionResult.Status = (int)Constant.PDAResult.Success;
  3800. }
  3801. else
  3802. {
  3803. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3804. actionResult.Message = "无查询数据";
  3805. }
  3806. }
  3807. catch (Exception ex)
  3808. {
  3809. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3810. OutputLog.TraceLog(LogPriority.Error,
  3811. this.ToString(),
  3812. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3813. ex.ToString(),
  3814. LocalPath.LogExePath);
  3815. actionResult.Status = (int)Constant.PDAResult.Exception;
  3816. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3817. }
  3818. return actionResult;
  3819. }
  3820. /// <summary>
  3821. ///获得成型线信息
  3822. /// </summary>
  3823. /// <param name="accountCode"></param>
  3824. /// <param name="userCode"></param>
  3825. /// <param name="userPassword"></param>
  3826. /// <param name="sessionKey"></param>
  3827. /// <param name="se">查询条件</param>
  3828. /// <returns>Dataset</returns>
  3829. public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3830. {
  3831. ActionResult actionResult = new ActionResult();
  3832. try
  3833. {
  3834. // 验证请求头信息
  3835. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3836. // 验证失败
  3837. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3838. {
  3839. return actionResult;
  3840. }
  3841. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3842. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3843. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3844. {
  3845. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3846. actionResult.Status = (int)Constant.PDAResult.Success;
  3847. }
  3848. else
  3849. {
  3850. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3851. actionResult.Message = "无查询数据";
  3852. }
  3853. }
  3854. catch (Exception ex)
  3855. {
  3856. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3857. OutputLog.TraceLog(LogPriority.Error,
  3858. this.ToString(),
  3859. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3860. ex.ToString(),
  3861. LocalPath.LogExePath);
  3862. actionResult.Status = (int)Constant.PDAResult.Exception;
  3863. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3864. }
  3865. return actionResult;
  3866. }
  3867. /// <summary>
  3868. ///获取在产产品的信息标识列表
  3869. /// </summary>
  3870. /// <param name="accountCode"></param>
  3871. /// <param name="userCode"></param>
  3872. /// <param name="userPassword"></param>
  3873. /// <param name="sessionKey"></param>
  3874. /// <param name="barcode">查询条件</param>
  3875. /// <returns>Dataset</returns>
  3876. public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3877. {
  3878. ActionResult actionResult = new ActionResult();
  3879. try
  3880. {
  3881. // 验证请求头信息
  3882. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3883. // 验证失败
  3884. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3885. {
  3886. return actionResult;
  3887. }
  3888. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3889. () => PMModuleLogic.GetInProductionDataList(barcode));
  3890. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3891. {
  3892. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3893. actionResult.Status = (int)Constant.PDAResult.Success;
  3894. }
  3895. else
  3896. {
  3897. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3898. actionResult.Message = "无查询数据";
  3899. }
  3900. }
  3901. catch (Exception ex)
  3902. {
  3903. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3904. OutputLog.TraceLog(LogPriority.Error,
  3905. this.ToString(),
  3906. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3907. ex.ToString(),
  3908. LocalPath.LogExePath);
  3909. actionResult.Status = (int)Constant.PDAResult.Exception;
  3910. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3911. }
  3912. return actionResult;
  3913. }
  3914. /// <summary>
  3915. ///获取条码是否注浆登记过,0行无效
  3916. /// </summary>
  3917. /// <param name="accountCode"></param>
  3918. /// <param name="userCode"></param>
  3919. /// <param name="userPassword"></param>
  3920. /// <param name="sessionKey"></param>
  3921. /// <param name="barcode">查询条件</param>
  3922. /// <returns>Dataset</returns>
  3923. public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3924. {
  3925. ActionResult actionResult = new ActionResult();
  3926. try
  3927. {
  3928. // 验证请求头信息
  3929. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3930. // 验证失败
  3931. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3932. {
  3933. return actionResult;
  3934. }
  3935. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3936. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  3937. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3938. {
  3939. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3940. actionResult.Status = (int)Constant.PDAResult.Success;
  3941. }
  3942. else
  3943. {
  3944. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3945. actionResult.Message = "该产品条码无效,无法报损!";
  3946. }
  3947. }
  3948. catch (Exception ex)
  3949. {
  3950. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3951. OutputLog.TraceLog(LogPriority.Error,
  3952. this.ToString(),
  3953. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3954. ex.ToString(),
  3955. LocalPath.LogExePath);
  3956. actionResult.Status = (int)Constant.PDAResult.Exception;
  3957. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3958. }
  3959. return actionResult;
  3960. }
  3961. /// <summary>
  3962. /// 获取登陆帐户有变更条码权限
  3963. /// </summary>
  3964. /// <param name="accountCode"></param>
  3965. /// <param name="userCode"></param>
  3966. /// <param name="userPassword"></param>
  3967. /// <param name="sessionKey"></param>
  3968. /// <returns></returns>
  3969. public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3970. {
  3971. ActionResult actionResult = new ActionResult();
  3972. try
  3973. {
  3974. // 验证请求头信息
  3975. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3976. // 验证失败
  3977. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3978. {
  3979. return actionResult;
  3980. }
  3981. int returnValue = ServiceInvoker.Invoke<int>(this,
  3982. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  3983. actionResult.Result = JsonHelper.ToJson(returnValue);
  3984. actionResult.Status = (int)Constant.PDAResult.Success;
  3985. }
  3986. catch (Exception ex)
  3987. {
  3988. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3989. OutputLog.TraceLog(LogPriority.Error,
  3990. this.ToString(),
  3991. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3992. ex.ToString(),
  3993. LocalPath.LogExePath);
  3994. actionResult.Status = (int)Constant.PDAResult.Exception;
  3995. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3996. }
  3997. return actionResult;
  3998. }
  3999. /// <summary>
  4000. /// 成检时获取此条码是否报损
  4001. /// </summary>
  4002. /// <param name="accountCode"></param>
  4003. /// <param name="userCode"></param>
  4004. /// <param name="userPassword"></param>
  4005. /// <param name="sessionKey"></param>
  4006. /// <param name="barcode">产品条码</param>
  4007. /// <returns></returns>
  4008. public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  4009. {
  4010. ActionResult actionResult = new ActionResult();
  4011. try
  4012. {
  4013. // 验证请求头信息
  4014. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4015. // 验证失败
  4016. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4017. {
  4018. return actionResult;
  4019. }
  4020. int returnValue = ServiceInvoker.Invoke<int>(this,
  4021. () => PMModuleLogic.CheckScrapProduct(barcode));
  4022. if (returnValue == -100)
  4023. {
  4024. actionResult.Result = JsonHelper.ToJson(returnValue);
  4025. actionResult.Status = (int)Constant.PDAResult.Success;
  4026. }
  4027. else
  4028. {
  4029. actionResult.Status = (int)Constant.PDAResult.Fail;
  4030. if (returnValue == 0)
  4031. {
  4032. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  4033. }
  4034. else
  4035. {
  4036. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  4037. }
  4038. }
  4039. }
  4040. catch (Exception ex)
  4041. {
  4042. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4043. OutputLog.TraceLog(LogPriority.Error,
  4044. this.ToString(),
  4045. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4046. ex.ToString(),
  4047. LocalPath.LogExePath);
  4048. actionResult.Status = (int)Constant.PDAResult.Exception;
  4049. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4050. }
  4051. return actionResult;
  4052. }
  4053. /// <summary>
  4054. /// 获取产品完成工序的ID(PDA)
  4055. /// </summary>
  4056. /// <param name="barcode">产品条码</param>
  4057. /// <returns>int</returns>
  4058. public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  4059. {
  4060. ActionResult actionResult = new ActionResult();
  4061. try
  4062. {
  4063. // 验证请求头信息
  4064. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4065. // 验证失败
  4066. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4067. {
  4068. return actionResult;
  4069. }
  4070. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4071. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  4072. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  4073. actionResult.Status = (int)Constant.PDAResult.Success;
  4074. }
  4075. catch (Exception ex)
  4076. {
  4077. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4078. OutputLog.TraceLog(LogPriority.Error,
  4079. this.ToString(),
  4080. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4081. ex.ToString(),
  4082. LocalPath.LogExePath);
  4083. actionResult.Status = (int)Constant.PDAResult.Exception;
  4084. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4085. }
  4086. return actionResult;
  4087. }
  4088. /// <summary>
  4089. /// 获取产品完成工序的ID(PDA)
  4090. /// </summary>
  4091. /// <param name="barcode">产品条码</param>
  4092. /// <returns>int</returns>
  4093. public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  4094. {
  4095. ActionResult actionResult = new ActionResult();
  4096. try
  4097. {
  4098. // 验证请求头信息
  4099. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4100. // 验证失败
  4101. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4102. {
  4103. return actionResult;
  4104. }
  4105. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4106. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  4107. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  4108. actionResult.Status = (int)Constant.PDAResult.Success;
  4109. }
  4110. catch (Exception ex)
  4111. {
  4112. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4113. OutputLog.TraceLog(LogPriority.Error,
  4114. this.ToString(),
  4115. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4116. ex.ToString(),
  4117. LocalPath.LogExePath);
  4118. actionResult.Status = (int)Constant.PDAResult.Exception;
  4119. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4120. }
  4121. return actionResult;
  4122. }
  4123. /// <summary>
  4124. /// 成检-校验生产工号
  4125. /// </summary>
  4126. /// <param name="usercode">生产工号</param>
  4127. /// <returns>int</returns>
  4128. public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode)
  4129. {
  4130. ActionResult actionResult = new ActionResult();
  4131. try
  4132. {
  4133. // 验证请求头信息
  4134. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4135. // 验证失败
  4136. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4137. {
  4138. return actionResult;
  4139. }
  4140. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4141. () => PDAModuleLogic.GetUserCode(usercode, sUserInfo));
  4142. actionResult.Result = JsonHelper.ToJson(ds);
  4143. actionResult.Status = (int)Constant.PDAResult.Success;
  4144. }
  4145. catch (Exception ex)
  4146. {
  4147. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4148. OutputLog.TraceLog(LogPriority.Error,
  4149. this.ToString(),
  4150. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4151. ex.ToString(),
  4152. LocalPath.LogExePath);
  4153. actionResult.Status = (int)Constant.PDAResult.Exception;
  4154. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4155. }
  4156. return actionResult;
  4157. }
  4158. /// <summary>
  4159. /// 更新漏扫的成型工号
  4160. /// </summary>
  4161. /// <param name="accountCode"></param>
  4162. /// <param name="userCode"></param>
  4163. /// <param name="userPassword"></param>
  4164. /// <param name="sessionKey"></param>
  4165. /// <param name="groutingUserCode">成型工号</param>
  4166. /// <param name="missingID">漏扫ID</param>
  4167. /// <returns></returns>
  4168. public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  4169. {
  4170. ActionResult actionResult = new ActionResult();
  4171. try
  4172. {
  4173. // 验证请求头信息
  4174. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4175. // 验证失败
  4176. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4177. {
  4178. return actionResult;
  4179. }
  4180. int returnValue = ServiceInvoker.Invoke<int>(this,
  4181. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  4182. if (returnValue != -1)
  4183. {
  4184. actionResult.Result = JsonHelper.ToJson(returnValue);
  4185. actionResult.Status = (int)Constant.PDAResult.Success;
  4186. }
  4187. else
  4188. {
  4189. actionResult.Status = (int)Constant.PDAResult.Fail;
  4190. actionResult.Message = "存在无效的漏扫工号";
  4191. }
  4192. }
  4193. catch (Exception ex)
  4194. {
  4195. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4196. OutputLog.TraceLog(LogPriority.Error,
  4197. this.ToString(),
  4198. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4199. ex.ToString(),
  4200. LocalPath.LogExePath);
  4201. actionResult.Status = (int)Constant.PDAResult.Exception;
  4202. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4203. }
  4204. return actionResult;
  4205. }
  4206. /// <summary>
  4207. /// 在入窑工序检验窑车号是否存在
  4208. /// </summary>
  4209. /// <param name="accountCode"></param>
  4210. /// <param name="userCode"></param>
  4211. /// <param name="userPassword"></param>
  4212. /// <param name="sessionKey"></param>
  4213. /// <param name="kilncarcode">窑车编码</param>
  4214. /// <param name="procedureid">工序ID</param>
  4215. /// <returns></returns>
  4216. public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4217. {
  4218. ActionResult actionResult = new ActionResult();
  4219. try
  4220. {
  4221. // 验证请求头信息
  4222. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4223. // 验证失败
  4224. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4225. {
  4226. return actionResult;
  4227. }
  4228. int returnValue = ServiceInvoker.Invoke<int>(this,
  4229. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  4230. if (returnValue == 1)
  4231. {
  4232. actionResult.Result = JsonHelper.ToJson(returnValue);
  4233. actionResult.Status = (int)Constant.PDAResult.Success;
  4234. }
  4235. else
  4236. {
  4237. actionResult.Status = (int)Constant.PDAResult.Fail;
  4238. if (returnValue == -99)
  4239. actionResult.Message = "窑炉车号无效";
  4240. else if (returnValue == -98)
  4241. actionResult.Message = "窑车己无产品";
  4242. else if (returnValue == -97)
  4243. actionResult.Message = "窑车没有入窑,不可以撤销";
  4244. else if (returnValue == -1)
  4245. actionResult.Message = "保存失败";
  4246. }
  4247. }
  4248. catch (Exception ex)
  4249. {
  4250. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4251. OutputLog.TraceLog(LogPriority.Error,
  4252. this.ToString(),
  4253. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4254. ex.ToString(),
  4255. LocalPath.LogExePath);
  4256. actionResult.Status = (int)Constant.PDAResult.Exception;
  4257. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4258. }
  4259. return actionResult;
  4260. }
  4261. /// <summary>
  4262. /// 获取盘点单列表
  4263. /// </summary>
  4264. /// <param name="sUserInfo"></param>
  4265. /// <returns></returns>
  4266. public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey)
  4267. {
  4268. ActionResult actionResult = new ActionResult();
  4269. try
  4270. {
  4271. // 验证请求头信息
  4272. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4273. // 验证失败
  4274. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4275. {
  4276. return actionResult;
  4277. }
  4278. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4279. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  4280. actionResult.Result = JsonHelper.ToJson(ds);
  4281. actionResult.Status = (int)Constant.PDAResult.Success;
  4282. }
  4283. catch (Exception ex)
  4284. {
  4285. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4286. OutputLog.TraceLog(LogPriority.Error,
  4287. this.ToString(),
  4288. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4289. ex.ToString(),
  4290. LocalPath.LogExePath);
  4291. actionResult.Status = (int)Constant.PDAResult.Exception;
  4292. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4293. }
  4294. return actionResult;
  4295. }
  4296. /// <summary>
  4297. /// 进行盘点操作
  4298. /// </summary>
  4299. /// <param name="accountCode"></param>
  4300. /// <param name="userCode"></param>
  4301. /// <param name="userPassword"></param>
  4302. /// <param name="sessionKey"></param>
  4303. /// <param name="InCheckedID">盘点单ID</param>
  4304. /// <param name="BarCode">产品条码</param>
  4305. /// <returns></returns>
  4306. public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4307. {
  4308. ActionResult actionResult = new ActionResult();
  4309. try
  4310. {
  4311. // 验证请求头信息
  4312. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4313. // 验证失败
  4314. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4315. {
  4316. return actionResult;
  4317. }
  4318. int returnValue = ServiceInvoker.Invoke<int>(this,
  4319. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4320. if (returnValue > 0)
  4321. {
  4322. actionResult.Result = JsonHelper.ToJson(returnValue);
  4323. actionResult.Status = (int)Constant.PDAResult.Success;
  4324. actionResult.Message = "产品" + BarCode + "盘点成功";
  4325. }
  4326. else if (returnValue == 10)
  4327. {
  4328. actionResult.Result = JsonHelper.ToJson(returnValue);
  4329. actionResult.Status = (int)Constant.PDAResult.Success;
  4330. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4331. }
  4332. else
  4333. {
  4334. actionResult.Status = (int)Constant.PDAResult.Fail;
  4335. if (returnValue == -2)
  4336. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4337. //if (returnValue == 10)
  4338. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4339. //if (returnValue > 0)
  4340. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4341. if (returnValue == -22)
  4342. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4343. if (returnValue == -23)
  4344. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4345. if (returnValue == -24)
  4346. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4347. if (returnValue == -25)
  4348. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4349. else if (returnValue == 0)
  4350. actionResult.Message = "盘点失败";
  4351. }
  4352. }
  4353. catch (Exception ex)
  4354. {
  4355. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4356. OutputLog.TraceLog(LogPriority.Error,
  4357. this.ToString(),
  4358. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4359. ex.ToString(),
  4360. LocalPath.LogExePath);
  4361. actionResult.Status = (int)Constant.PDAResult.Exception;
  4362. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4363. }
  4364. return actionResult;
  4365. }
  4366. #region 班次配置
  4367. /// <summary>
  4368. /// 班次配置-通过工号获取工种列表
  4369. /// </summary>
  4370. /// <param name="userId">工号ID</param>
  4371. /// <returns></returns>
  4372. public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4373. {
  4374. ActionResult actionResult = new ActionResult();
  4375. try
  4376. {
  4377. // 验证请求头信息
  4378. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4379. // 验证失败
  4380. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4381. {
  4382. return actionResult;
  4383. }
  4384. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4385. () => SystemModuleLogic.GetJobByUserId(userId));
  4386. actionResult.Result = JsonHelper.ToJson(ds);
  4387. actionResult.Status = (int)Constant.PDAResult.Success;
  4388. }
  4389. catch (Exception ex)
  4390. {
  4391. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4392. OutputLog.TraceLog(LogPriority.Error,
  4393. this.ToString(),
  4394. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4395. ex.ToString(),
  4396. LocalPath.LogExePath);
  4397. actionResult.Status = (int)Constant.PDAResult.Exception;
  4398. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4399. }
  4400. return actionResult;
  4401. }
  4402. ///// <summary>
  4403. ///// 班次配置-根据工号查询员工档案信息
  4404. ///// </summary>
  4405. ///// <param name="userId">工号ID</param>
  4406. ///// <returns></returns>
  4407. //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4408. //{
  4409. // ActionResult actionResult = new ActionResult();
  4410. // try
  4411. // {
  4412. // // 验证请求头信息
  4413. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4414. // // 验证失败
  4415. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4416. // {
  4417. // return actionResult;
  4418. // }
  4419. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4420. // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
  4421. // actionResult.Result = JsonHelper.ToJson(ds);
  4422. // actionResult.Status = (int)Constant.PDAResult.Success;
  4423. // }
  4424. // catch (Exception ex)
  4425. // {
  4426. // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4427. // OutputLog.TraceLog(LogPriority.Error,
  4428. // this.ToString(),
  4429. // System.Reflection.MethodBase.GetCurrentMethod().Name,
  4430. // ex.ToString(),
  4431. // LocalPath.LogExePath);
  4432. // actionResult.Status = (int)Constant.PDAResult.Exception;
  4433. // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4434. // }
  4435. // return actionResult;
  4436. //}
  4437. /// <summary>
  4438. /// 班次配置-根据员工姓名查员工信息
  4439. /// </summary>
  4440. /// <param name="searchStaffEntity"></param>
  4441. /// <returns></returns>
  4442. public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4443. {
  4444. ActionResult actionResult = new ActionResult();
  4445. try
  4446. {
  4447. // 验证请求头信息
  4448. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4449. // 验证失败
  4450. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4451. {
  4452. return actionResult;
  4453. }
  4454. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4455. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4456. actionResult.Result = JsonHelper.ToJson(ds);
  4457. actionResult.Status = (int)Constant.PDAResult.Success;
  4458. }
  4459. catch (Exception ex)
  4460. {
  4461. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4462. OutputLog.TraceLog(LogPriority.Error,
  4463. this.ToString(),
  4464. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4465. ex.ToString(),
  4466. LocalPath.LogExePath);
  4467. actionResult.Status = (int)Constant.PDAResult.Exception;
  4468. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4469. }
  4470. return actionResult;
  4471. }
  4472. /// <summary>
  4473. /// 获取班次配置信息
  4474. /// </summary>
  4475. /// <param name="searchEntity"></param>
  4476. /// <returns></returns>
  4477. public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  4478. {
  4479. ActionResult actionResult = new ActionResult();
  4480. try
  4481. {
  4482. // 验证请求头信息
  4483. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4484. // 验证失败
  4485. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4486. {
  4487. return actionResult;
  4488. }
  4489. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4490. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4491. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4492. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4493. actionResult.Result = JsonHelper.ToJson(ds);
  4494. actionResult.Status = (int)Constant.PDAResult.Success;
  4495. }
  4496. catch (Exception ex)
  4497. {
  4498. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4499. OutputLog.TraceLog(LogPriority.Error,
  4500. this.ToString(),
  4501. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4502. ex.ToString(),
  4503. LocalPath.LogExePath);
  4504. actionResult.Status = (int)Constant.PDAResult.Exception;
  4505. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4506. }
  4507. return actionResult;
  4508. }
  4509. public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4510. {
  4511. ActionResult actionResult = new ActionResult();
  4512. try
  4513. {
  4514. // 验证请求头信息
  4515. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4516. // 验证失败
  4517. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4518. {
  4519. return actionResult;
  4520. }
  4521. int returnValue = ServiceInvoker.Invoke<int>(this,
  4522. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4523. if (returnValue > 0)
  4524. {
  4525. actionResult.Result = JsonHelper.ToJson(returnValue);
  4526. actionResult.Status = (int)Constant.PDAResult.Success;
  4527. }
  4528. else
  4529. {
  4530. actionResult.Status = (int)Constant.PDAResult.Fail;
  4531. actionResult.Message = "保存失败";
  4532. }
  4533. }
  4534. catch (Exception ex)
  4535. {
  4536. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4537. OutputLog.TraceLog(LogPriority.Error,
  4538. this.ToString(),
  4539. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4540. ex.ToString(),
  4541. LocalPath.LogExePath);
  4542. actionResult.Status = (int)Constant.PDAResult.Exception;
  4543. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4544. }
  4545. return actionResult;
  4546. }
  4547. /// <summary>
  4548. /// 班次配置--获取详细信息
  4549. /// </summary>
  4550. /// <param name="searchEntity"></param>
  4551. /// <returns></returns>
  4552. public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4553. {
  4554. ActionResult actionResult = new ActionResult();
  4555. try
  4556. {
  4557. // 验证请求头信息
  4558. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4559. // 验证失败
  4560. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4561. {
  4562. return actionResult;
  4563. }
  4564. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4565. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4566. actionResult.Result = JsonHelper.ToJson(ds);
  4567. actionResult.Status = (int)Constant.PDAResult.Success;
  4568. }
  4569. catch (Exception ex)
  4570. {
  4571. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4572. OutputLog.TraceLog(LogPriority.Error,
  4573. this.ToString(),
  4574. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4575. ex.ToString(),
  4576. LocalPath.LogExePath);
  4577. actionResult.Status = (int)Constant.PDAResult.Exception;
  4578. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4579. }
  4580. return actionResult;
  4581. }
  4582. /// <summary>
  4583. /// 获取用户是否有班次配置权限
  4584. /// </summary>
  4585. /// <param name="accountCode"></param>
  4586. /// <param name="userCode"></param>
  4587. /// <param name="userPassword"></param>
  4588. /// <param name="sessionKey"></param>
  4589. /// <returns></returns>
  4590. public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4591. {
  4592. ActionResult actionResult = new ActionResult();
  4593. try
  4594. {
  4595. // 验证请求头信息
  4596. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4597. // 验证失败
  4598. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4599. {
  4600. return actionResult;
  4601. }
  4602. int returnValue = ServiceInvoker.Invoke<int>(this,
  4603. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4604. actionResult.Result = JsonHelper.ToJson(returnValue);
  4605. actionResult.Status = (int)Constant.PDAResult.Success;
  4606. }
  4607. catch (Exception ex)
  4608. {
  4609. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4610. OutputLog.TraceLog(LogPriority.Error,
  4611. this.ToString(),
  4612. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4613. ex.ToString(),
  4614. LocalPath.LogExePath);
  4615. actionResult.Status = (int)Constant.PDAResult.Exception;
  4616. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4617. }
  4618. return actionResult;
  4619. }
  4620. /// <summary>
  4621. /// 获取盘点单列表
  4622. /// </summary>
  4623. /// <param name="sUserInfo"></param>
  4624. /// <returns></returns>
  4625. public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  4626. {
  4627. ActionResult actionResult = new ActionResult();
  4628. try
  4629. {
  4630. // 验证请求头信息
  4631. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4632. // 验证失败
  4633. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4634. {
  4635. return actionResult;
  4636. }
  4637. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4638. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4639. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4640. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4641. actionResult.Result = JsonHelper.ToJson(ds);
  4642. actionResult.Status = (int)Constant.PDAResult.Success;
  4643. }
  4644. catch (Exception ex)
  4645. {
  4646. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4647. OutputLog.TraceLog(LogPriority.Error,
  4648. this.ToString(),
  4649. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4650. ex.ToString(),
  4651. LocalPath.LogExePath);
  4652. actionResult.Status = (int)Constant.PDAResult.Exception;
  4653. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4654. }
  4655. return actionResult;
  4656. }
  4657. #endregion
  4658. #region PDA报表
  4659. /// <summary>
  4660. /// 产品质量跟踪
  4661. /// </summary>
  4662. /// <param name="accountCode"></param>
  4663. /// <param name="userCode"></param>
  4664. /// <param name="userPassword"></param>
  4665. /// <param name="sessionKey"></param>
  4666. /// <param name="se"></param>
  4667. /// <returns></returns>
  4668. public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4669. {
  4670. ActionResult actionResult = new ActionResult();
  4671. try
  4672. {
  4673. // 验证请求头信息
  4674. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4675. // 验证失败
  4676. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4677. {
  4678. return actionResult;
  4679. }
  4680. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4681. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4682. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4683. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4684. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4685. {
  4686. actionResult.Status = (int)Constant.PDAResult.Fail;
  4687. actionResult.Message = Messages.MSG_CMN_I002;
  4688. }
  4689. else
  4690. {
  4691. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4692. actionResult.Status = (int)Constant.PDAResult.Success;
  4693. }
  4694. }
  4695. catch (Exception ex)
  4696. {
  4697. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4698. OutputLog.TraceLog(LogPriority.Error,
  4699. this.ToString(),
  4700. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4701. ex.ToString(),
  4702. LocalPath.LogExePath);
  4703. actionResult.Status = (int)Constant.PDAResult.Exception;
  4704. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4705. }
  4706. return actionResult;
  4707. }
  4708. /// <summary>
  4709. /// 工号产量质量分析表
  4710. /// </summary>
  4711. /// <param name="accountCode"></param>
  4712. /// <param name="userCode"></param>
  4713. /// <param name="userPassword"></param>
  4714. /// <param name="sessionKey"></param>
  4715. /// <param name="se"></param>
  4716. /// <returns></returns>
  4717. public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4718. int rptSProcedureID, string workcode, string date)
  4719. {
  4720. ActionResult actionResult = new ActionResult();
  4721. try
  4722. {
  4723. // 验证请求头信息
  4724. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4725. // 验证失败
  4726. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4727. {
  4728. return actionResult;
  4729. }
  4730. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4731. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4732. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4733. {
  4734. actionResult.Status = (int)Constant.PDAResult.Fail;
  4735. actionResult.Message = Messages.MSG_CMN_I002;
  4736. }
  4737. else
  4738. {
  4739. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4740. actionResult.Status = (int)Constant.PDAResult.Success;
  4741. }
  4742. }
  4743. catch (Exception ex)
  4744. {
  4745. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4746. OutputLog.TraceLog(LogPriority.Error,
  4747. this.ToString(),
  4748. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4749. ex.ToString(),
  4750. LocalPath.LogExePath);
  4751. actionResult.Status = (int)Constant.PDAResult.Exception;
  4752. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4753. }
  4754. return actionResult;
  4755. }
  4756. /// <summary>
  4757. /// 工号产量质量分析表(中陶)
  4758. /// </summary>
  4759. /// <param name="accountCode"></param>
  4760. /// <param name="userCode"></param>
  4761. /// <param name="userPassword"></param>
  4762. /// <param name="sessionKey"></param>
  4763. /// <param name="se"></param>
  4764. /// <returns></returns>
  4765. public ActionResult GetFP00002_1Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4766. int rptSProcedureID, string workcode, string date, string goodscode)
  4767. {
  4768. ActionResult actionResult = new ActionResult();
  4769. try
  4770. {
  4771. // 验证请求头信息
  4772. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4773. // 验证失败
  4774. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4775. {
  4776. return actionResult;
  4777. }
  4778. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4779. () => PDAModuleLogic.GetFP00002_1Data(sUserInfo, rptSProcedureID, workcode,
  4780. Convert.ToDateTime(date), goodscode));
  4781. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4782. {
  4783. actionResult.Status = (int)Constant.PDAResult.Fail;
  4784. actionResult.Message = Messages.MSG_CMN_I002;
  4785. }
  4786. else
  4787. {
  4788. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4789. actionResult.Status = (int)Constant.PDAResult.Success;
  4790. }
  4791. }
  4792. catch (Exception ex)
  4793. {
  4794. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4795. OutputLog.TraceLog(LogPriority.Error,
  4796. this.ToString(),
  4797. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4798. ex.ToString(),
  4799. LocalPath.LogExePath);
  4800. actionResult.Status = (int)Constant.PDAResult.Exception;
  4801. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4802. }
  4803. return actionResult;
  4804. }
  4805. /// <summary>
  4806. /// 半检数据统计表
  4807. /// </summary>
  4808. /// <param name="accountCode"></param>
  4809. /// <param name="userCode"></param>
  4810. /// <param name="userPassword"></param>
  4811. /// <param name="sessionKey"></param>
  4812. /// <param name="se"></param>
  4813. /// <returns></returns>
  4814. public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4815. string workcode, string datebegin, string dateend)
  4816. {
  4817. ActionResult actionResult = new ActionResult();
  4818. try
  4819. {
  4820. // 验证请求头信息
  4821. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4822. // 验证失败
  4823. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4824. {
  4825. return actionResult;
  4826. }
  4827. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4828. DateTime datetimeend = Convert.ToDateTime(dateend);
  4829. datetimebegin = datetimebegin.Date;
  4830. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4831. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4832. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4833. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4834. {
  4835. actionResult.Status = (int)Constant.PDAResult.Fail;
  4836. actionResult.Message = Messages.MSG_CMN_I002;
  4837. }
  4838. else
  4839. {
  4840. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4841. actionResult.Status = (int)Constant.PDAResult.Success;
  4842. }
  4843. }
  4844. catch (Exception ex)
  4845. {
  4846. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4847. OutputLog.TraceLog(LogPriority.Error,
  4848. this.ToString(),
  4849. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4850. ex.ToString(),
  4851. LocalPath.LogExePath);
  4852. actionResult.Status = (int)Constant.PDAResult.Exception;
  4853. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4854. }
  4855. return actionResult;
  4856. }
  4857. /// <summary>
  4858. /// 工号质量统计表
  4859. /// </summary>
  4860. /// <param name="accountCode"></param>
  4861. /// <param name="userCode"></param>
  4862. /// <param name="userPassword"></param>
  4863. /// <param name="sessionKey"></param>
  4864. /// <param name="se"></param>
  4865. /// <returns></returns>
  4866. public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4867. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4868. {
  4869. ActionResult actionResult = new ActionResult();
  4870. try
  4871. {
  4872. // 验证请求头信息
  4873. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4874. // 验证失败
  4875. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4876. {
  4877. return actionResult;
  4878. }
  4879. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4880. DateTime datetimeend = Convert.ToDateTime(dateend);
  4881. datetimebegin = datetimebegin.Date;
  4882. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4883. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4884. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4885. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4886. {
  4887. actionResult.Status = (int)Constant.PDAResult.Fail;
  4888. actionResult.Message = Messages.MSG_CMN_I002;
  4889. }
  4890. else
  4891. {
  4892. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4893. actionResult.Status = (int)Constant.PDAResult.Success;
  4894. }
  4895. }
  4896. catch (Exception ex)
  4897. {
  4898. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4899. OutputLog.TraceLog(LogPriority.Error,
  4900. this.ToString(),
  4901. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4902. ex.ToString(),
  4903. LocalPath.LogExePath);
  4904. actionResult.Status = (int)Constant.PDAResult.Exception;
  4905. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4906. }
  4907. return actionResult;
  4908. }
  4909. /// <summary>
  4910. /// 损坯数据统计表
  4911. /// </summary>
  4912. /// <param name="accountCode"></param>
  4913. /// <param name="userCode"></param>
  4914. /// <param name="userPassword"></param>
  4915. /// <param name="sessionKey"></param>
  4916. /// <param name="se"></param>
  4917. /// <returns></returns>
  4918. public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4919. string workcode, string datebegin, string dateend)
  4920. {
  4921. ActionResult actionResult = new ActionResult();
  4922. try
  4923. {
  4924. // 验证请求头信息
  4925. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4926. // 验证失败
  4927. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4928. {
  4929. return actionResult;
  4930. }
  4931. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4932. DateTime datetimeend = Convert.ToDateTime(dateend);
  4933. datetimebegin = datetimebegin.Date;
  4934. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4935. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4936. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4937. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4938. {
  4939. actionResult.Status = (int)Constant.PDAResult.Fail;
  4940. actionResult.Message = Messages.MSG_CMN_I002;
  4941. }
  4942. else
  4943. {
  4944. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4945. actionResult.Status = (int)Constant.PDAResult.Success;
  4946. }
  4947. }
  4948. catch (Exception ex)
  4949. {
  4950. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4951. OutputLog.TraceLog(LogPriority.Error,
  4952. this.ToString(),
  4953. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4954. ex.ToString(),
  4955. LocalPath.LogExePath);
  4956. actionResult.Status = (int)Constant.PDAResult.Exception;
  4957. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4958. }
  4959. return actionResult;
  4960. }
  4961. #endregion
  4962. /// <summary>
  4963. /// 取得报表数据源数据
  4964. /// </summary>
  4965. /// <param name="accountCode"></param>
  4966. /// <param name="userCode"></param>
  4967. /// <param name="userPassword"></param>
  4968. /// <param name="sessionKey"></param>
  4969. /// <returns></returns>
  4970. public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
  4971. {
  4972. ActionResult actionResult = new ActionResult();
  4973. try
  4974. {
  4975. // 验证请求头信息
  4976. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4977. // 验证失败
  4978. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4979. {
  4980. return actionResult;
  4981. }
  4982. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4983. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4984. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4985. {
  4986. actionResult.Status = (int)Constant.PDAResult.Fail;
  4987. actionResult.Message = Messages.MSG_CMN_I002;
  4988. }
  4989. else
  4990. {
  4991. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4992. actionResult.Status = (int)Constant.PDAResult.Success;
  4993. }
  4994. }
  4995. catch (Exception ex)
  4996. {
  4997. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4998. OutputLog.TraceLog(LogPriority.Error,
  4999. this.ToString(),
  5000. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5001. ex.ToString(),
  5002. LocalPath.LogExePath);
  5003. actionResult.Status = (int)Constant.PDAResult.Exception;
  5004. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5005. }
  5006. return actionResult;
  5007. }
  5008. /// <summary>
  5009. /// 取得报表的查询数据源统计工序数据
  5010. /// </summary>
  5011. /// <param name="accountCode"></param>
  5012. /// <param name="userCode"></param>
  5013. /// <param name="userPassword"></param>
  5014. /// <param name="sessionKey"></param>
  5015. /// <param name="RptProcedureID"></param>
  5016. /// <returns></returns>
  5017. public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  5018. {
  5019. ActionResult actionResult = new ActionResult();
  5020. try
  5021. {
  5022. // 验证请求头信息
  5023. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5024. // 验证失败
  5025. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5026. {
  5027. return actionResult;
  5028. }
  5029. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5030. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  5031. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5032. {
  5033. actionResult.Status = (int)Constant.PDAResult.Fail;
  5034. actionResult.Message = Messages.MSG_CMN_I002;
  5035. }
  5036. else
  5037. {
  5038. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5039. actionResult.Status = (int)Constant.PDAResult.Success;
  5040. }
  5041. }
  5042. catch (Exception ex)
  5043. {
  5044. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5045. OutputLog.TraceLog(LogPriority.Error,
  5046. this.ToString(),
  5047. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5048. ex.ToString(),
  5049. LocalPath.LogExePath);
  5050. actionResult.Status = (int)Constant.PDAResult.Exception;
  5051. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5052. }
  5053. return actionResult;
  5054. }
  5055. /// <summary>
  5056. /// 获取用户是否有统计产成品权限
  5057. /// </summary>
  5058. /// <param name="accountCode"></param>
  5059. /// <param name="userCode"></param>
  5060. /// <param name="userPassword"></param>
  5061. /// <param name="sessionKey"></param>
  5062. /// <returns></returns>
  5063. public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5064. {
  5065. ActionResult actionResult = new ActionResult();
  5066. try
  5067. {
  5068. // 验证请求头信息
  5069. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5070. // 验证失败
  5071. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5072. {
  5073. return actionResult;
  5074. }
  5075. int returnValue = ServiceInvoker.Invoke<int>(this,
  5076. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  5077. actionResult.Result = JsonHelper.ToJson(returnValue);
  5078. actionResult.Status = (int)Constant.PDAResult.Success;
  5079. }
  5080. catch (Exception ex)
  5081. {
  5082. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5083. OutputLog.TraceLog(LogPriority.Error,
  5084. this.ToString(),
  5085. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5086. ex.ToString(),
  5087. LocalPath.LogExePath);
  5088. actionResult.Status = (int)Constant.PDAResult.Exception;
  5089. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5090. }
  5091. return actionResult;
  5092. }
  5093. /// <summary>
  5094. /// 获取用户是否有盘点权限
  5095. /// </summary>
  5096. /// <param name="accountCode"></param>
  5097. /// <param name="userCode"></param>
  5098. /// <param name="userPassword"></param>
  5099. /// <param name="sessionKey"></param>
  5100. /// <returns></returns>
  5101. public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5102. {
  5103. ActionResult actionResult = new ActionResult();
  5104. try
  5105. {
  5106. // 验证请求头信息
  5107. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5108. // 验证失败
  5109. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5110. {
  5111. return actionResult;
  5112. }
  5113. int returnValue = ServiceInvoker.Invoke<int>(this,
  5114. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  5115. actionResult.Result = JsonHelper.ToJson(returnValue);
  5116. actionResult.Status = (int)Constant.PDAResult.Success;
  5117. }
  5118. catch (Exception ex)
  5119. {
  5120. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5121. OutputLog.TraceLog(LogPriority.Error,
  5122. this.ToString(),
  5123. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5124. ex.ToString(),
  5125. LocalPath.LogExePath);
  5126. actionResult.Status = (int)Constant.PDAResult.Exception;
  5127. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5128. }
  5129. return actionResult;
  5130. }
  5131. /// <summary>
  5132. /// 根据条件查询是否存在班次配置
  5133. /// </summary>
  5134. /// <param name="accountCode"></param>
  5135. /// <param name="userCode"></param>
  5136. /// <param name="userPassword"></param>
  5137. /// <param name="sessionKey"></param>
  5138. /// <param name="userCode">工号编码</param>
  5139. /// <returns></returns>
  5140. public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  5141. {
  5142. ActionResult actionResult = new ActionResult();
  5143. try
  5144. {
  5145. // 验证请求头信息
  5146. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5147. // 验证失败
  5148. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5149. {
  5150. return actionResult;
  5151. }
  5152. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5153. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  5154. actionResult.Result = JsonHelper.ToJson(ds);
  5155. actionResult.Status = (int)Constant.PDAResult.Success;
  5156. }
  5157. catch (Exception ex)
  5158. {
  5159. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5160. OutputLog.TraceLog(LogPriority.Error,
  5161. this.ToString(),
  5162. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5163. ex.ToString(),
  5164. LocalPath.LogExePath);
  5165. actionResult.Status = (int)Constant.PDAResult.Exception;
  5166. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5167. }
  5168. return actionResult;
  5169. }
  5170. /// <summary>
  5171. /// 报损工序查出工号根据生产数据ID
  5172. /// </summary>
  5173. /// <param name="accountCode"></param>
  5174. /// <param name="userCode"></param>
  5175. /// <param name="userPassword"></param>
  5176. /// <param name="sessionKey"></param>
  5177. /// <param name="ProductionDataID">生产数据ID</param>
  5178. /// <returns></returns>
  5179. public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  5180. {
  5181. ActionResult actionResult = new ActionResult();
  5182. try
  5183. {
  5184. // 验证请求头信息
  5185. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5186. // 验证失败
  5187. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5188. {
  5189. return actionResult;
  5190. }
  5191. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5192. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  5193. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5194. {
  5195. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5196. actionResult.Status = (int)Constant.PDAResult.Success;
  5197. }
  5198. else
  5199. {
  5200. actionResult.Status = (int)Constant.PDAResult.Fail;
  5201. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5202. }
  5203. }
  5204. catch (Exception ex)
  5205. {
  5206. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5207. OutputLog.TraceLog(LogPriority.Error,
  5208. this.ToString(),
  5209. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5210. ex.ToString(),
  5211. LocalPath.LogExePath);
  5212. actionResult.Status = (int)Constant.PDAResult.Exception;
  5213. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5214. }
  5215. return actionResult;
  5216. }
  5217. /// <summary>
  5218. /// 在入窑工序检验窑车号是否存在
  5219. /// </summary>
  5220. /// <param name="accountCode"></param>
  5221. /// <param name="userCode"></param>
  5222. /// <param name="userPassword"></param>
  5223. /// <param name="sessionKey"></param>
  5224. /// <param name="kilncarcode">窑车编码</param>
  5225. /// <param name="procedureid">工序ID</param>
  5226. /// <returns></returns>
  5227. public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  5228. {
  5229. ActionResult actionResult = new ActionResult();
  5230. try
  5231. {
  5232. // 验证请求头信息
  5233. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5234. // 验证失败
  5235. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5236. {
  5237. return actionResult;
  5238. }
  5239. int returnValue = ServiceInvoker.Invoke<int>(this,
  5240. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  5241. if (returnValue == 1)
  5242. {
  5243. actionResult.Result = JsonHelper.ToJson(returnValue);
  5244. actionResult.Status = (int)Constant.PDAResult.Success;
  5245. }
  5246. else
  5247. {
  5248. actionResult.Status = (int)Constant.PDAResult.Fail;
  5249. if (returnValue == -99)
  5250. actionResult.Message = "窑炉车号无效";
  5251. else if (returnValue == -98)
  5252. actionResult.Message = "窑车己无产品";
  5253. else if (returnValue == -97)
  5254. actionResult.Message = "窑车没有入窑,不可以撤销";
  5255. else if (returnValue == -1)
  5256. actionResult.Message = "保存失败";
  5257. }
  5258. }
  5259. catch (Exception ex)
  5260. {
  5261. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5262. OutputLog.TraceLog(LogPriority.Error,
  5263. this.ToString(),
  5264. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5265. ex.ToString(),
  5266. LocalPath.LogExePath);
  5267. actionResult.Status = (int)Constant.PDAResult.Exception;
  5268. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5269. }
  5270. return actionResult;
  5271. }
  5272. /// <summary>
  5273. /// 撤销包装
  5274. /// </summary>
  5275. /// <param name="accountCode"></param>
  5276. /// <param name="userCode"></param>
  5277. /// <param name="userPassword"></param>
  5278. /// <param name="sessionKey"></param>
  5279. /// <param name="barcode"></param>
  5280. /// <returns></returns>
  5281. public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5282. {
  5283. ActionResult actionResult = new ActionResult();
  5284. try
  5285. {
  5286. // 验证请求头信息
  5287. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5288. // 验证失败
  5289. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5290. {
  5291. return actionResult;
  5292. }
  5293. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5294. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  5295. if (Convert.ToInt32(returnValue.Result) > 0)
  5296. {
  5297. actionResult.Result = JsonHelper.ToJson(returnValue);
  5298. actionResult.Status = (int)Constant.PDAResult.Success;
  5299. }
  5300. else
  5301. {
  5302. actionResult.Status = (int)Constant.PDAResult.Fail;
  5303. if (Convert.ToInt32(returnValue.Result) == -1)
  5304. actionResult.Message = "产品条码不存在包装记录";
  5305. else if (Convert.ToInt32(returnValue.Result) == -200)
  5306. actionResult.Message = returnValue.Message;
  5307. else
  5308. actionResult.Message = "成品撤销失败";
  5309. }
  5310. }
  5311. catch (Exception ex)
  5312. {
  5313. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5314. OutputLog.TraceLog(LogPriority.Error,
  5315. this.ToString(),
  5316. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5317. ex.ToString(),
  5318. LocalPath.LogExePath);
  5319. actionResult.Status = (int)Constant.PDAResult.Exception;
  5320. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5321. }
  5322. return actionResult;
  5323. }
  5324. /*
  5325. /// <summary>
  5326. /// 获取用户是否有撤销包装权限
  5327. /// </summary>
  5328. /// <param name="accountCode"></param>
  5329. /// <param name="userCode"></param>
  5330. /// <param name="userPassword"></param>
  5331. /// <param name="sessionKey"></param>
  5332. /// <returns></returns>
  5333. public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5334. {
  5335. ActionResult actionResult = new ActionResult();
  5336. try
  5337. {
  5338. // 验证请求头信息
  5339. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5340. // 验证失败
  5341. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5342. {
  5343. return actionResult;
  5344. }
  5345. int returnValue = ServiceInvoker.Invoke<int>(this,
  5346. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5347. actionResult.Result = JsonHelper.ToJson(returnValue);
  5348. actionResult.Status = (int)Constant.PDAResult.Success;
  5349. }
  5350. catch (Exception ex)
  5351. {
  5352. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5353. OutputLog.TraceLog(LogPriority.Error,
  5354. this.ToString(),
  5355. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5356. ex.ToString(),
  5357. LocalPath.LogExePath);
  5358. actionResult.Status = (int)Constant.PDAResult.Exception;
  5359. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5360. }
  5361. return actionResult;
  5362. }
  5363. */
  5364. /// <summary>
  5365. /// 窑车状态明细表查询
  5366. /// </summary>
  5367. /// <param name="accountCode"></param>
  5368. /// <param name="userCode"></param>
  5369. /// <param name="userPassword"></param>
  5370. /// <param name="sessionKey"></param>
  5371. /// <param name="kilnCarCode"></param>
  5372. /// <returns></returns>
  5373. public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5374. {
  5375. ActionResult actionResult = new ActionResult();
  5376. try
  5377. {
  5378. // 验证请求头信息
  5379. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5380. // 验证失败
  5381. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5382. {
  5383. return actionResult;
  5384. }
  5385. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5386. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5387. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5388. {
  5389. actionResult.Status = (int)Constant.PDAResult.Fail;
  5390. actionResult.Message = Messages.MSG_CMN_I002;
  5391. }
  5392. else
  5393. {
  5394. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5395. actionResult.Status = (int)Constant.PDAResult.Success;
  5396. }
  5397. }
  5398. catch (Exception ex)
  5399. {
  5400. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5401. OutputLog.TraceLog(LogPriority.Error,
  5402. this.ToString(),
  5403. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5404. ex.ToString(),
  5405. LocalPath.LogExePath);
  5406. actionResult.Status = (int)Constant.PDAResult.Exception;
  5407. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5408. }
  5409. return actionResult;
  5410. }
  5411. /// <summary>
  5412. /// 损坯撤销
  5413. /// </summary>
  5414. /// <param name="accountCode"></param>
  5415. /// <param name="userCode"></param>
  5416. /// <param name="userPassword"></param>
  5417. /// <param name="sessionKey"></param>
  5418. /// <param name="barcode"></param>
  5419. /// <returns></returns>
  5420. public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5421. {
  5422. ActionResult actionResult = new ActionResult();
  5423. try
  5424. {
  5425. // 验证请求头信息
  5426. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5427. // 验证失败
  5428. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5429. {
  5430. return actionResult;
  5431. }
  5432. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5433. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5434. if (Convert.ToInt32(returnValue.Result) > 0)
  5435. {
  5436. actionResult.Result = JsonHelper.ToJson(returnValue);
  5437. actionResult.Status = (int)Constant.PDAResult.Success;
  5438. }
  5439. else
  5440. {
  5441. actionResult.Status = (int)Constant.PDAResult.Fail;
  5442. if (Convert.ToInt32(returnValue.Result) == -1)
  5443. actionResult.Message = "此产品没有损坯,不能撤销";
  5444. else if (Convert.ToInt32(returnValue.Result) == -200)
  5445. actionResult.Message = returnValue.Message;
  5446. else
  5447. actionResult.Message = "损坯撤销失败";
  5448. }
  5449. }
  5450. catch (Exception ex)
  5451. {
  5452. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5453. OutputLog.TraceLog(LogPriority.Error,
  5454. this.ToString(),
  5455. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5456. ex.ToString(),
  5457. LocalPath.LogExePath);
  5458. actionResult.Status = (int)Constant.PDAResult.Exception;
  5459. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5460. }
  5461. return actionResult;
  5462. }
  5463. /*
  5464. /// <summary>
  5465. /// 获取用户是否有损坯撤销权限
  5466. /// </summary>
  5467. /// <param name="accountCode"></param>
  5468. /// <param name="userCode"></param>
  5469. /// <param name="userPassword"></param>
  5470. /// <param name="sessionKey"></param>
  5471. /// <returns></returns>
  5472. public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5473. {
  5474. ActionResult actionResult = new ActionResult();
  5475. try
  5476. {
  5477. // 验证请求头信息
  5478. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5479. // 验证失败
  5480. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5481. {
  5482. return actionResult;
  5483. }
  5484. int returnValue = ServiceInvoker.Invoke<int>(this,
  5485. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5486. actionResult.Result = JsonHelper.ToJson(returnValue);
  5487. actionResult.Status = (int)Constant.PDAResult.Success;
  5488. }
  5489. catch (Exception ex)
  5490. {
  5491. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5492. OutputLog.TraceLog(LogPriority.Error,
  5493. this.ToString(),
  5494. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5495. ex.ToString(),
  5496. LocalPath.LogExePath);
  5497. actionResult.Status = (int)Constant.PDAResult.Exception;
  5498. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5499. }
  5500. return actionResult;
  5501. }
  5502. */
  5503. /// <summary>
  5504. /// 获取条码注浆信息
  5505. /// </summary>
  5506. /// <param name="accountCode"></param>
  5507. /// <param name="userCode"></param>
  5508. /// <param name="userPassword"></param>
  5509. /// <param name="sessionKey"></param>
  5510. /// <returns></returns>
  5511. public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5512. {
  5513. ActionResult actionResult = new ActionResult();
  5514. try
  5515. {
  5516. // 验证请求头信息
  5517. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5518. // 验证失败
  5519. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5520. {
  5521. return actionResult;
  5522. }
  5523. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5524. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5525. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5526. {
  5527. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5528. actionResult.Status = (int)Constant.PDAResult.Success;
  5529. }
  5530. else
  5531. {
  5532. actionResult.Status = (int)Constant.PDAResult.Fail;
  5533. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5534. }
  5535. }
  5536. catch (Exception ex)
  5537. {
  5538. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5539. OutputLog.TraceLog(LogPriority.Error,
  5540. this.ToString(),
  5541. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5542. ex.ToString(),
  5543. LocalPath.LogExePath);
  5544. actionResult.Status = (int)Constant.PDAResult.Exception;
  5545. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5546. }
  5547. return actionResult;
  5548. }
  5549. /// <summary>
  5550. /// 获取条码注浆信息
  5551. /// </summary>
  5552. /// <param name="accountCode"></param>
  5553. /// <param name="userCode"></param>
  5554. /// <param name="userPassword"></param>
  5555. /// <param name="sessionKey"></param>
  5556. /// <returns></returns>
  5557. public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5558. {
  5559. ActionResult actionResult = new ActionResult();
  5560. try
  5561. {
  5562. // 验证请求头信息
  5563. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5564. // 验证失败
  5565. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5566. {
  5567. return actionResult;
  5568. }
  5569. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5570. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5571. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5572. {
  5573. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5574. actionResult.Status = (int)Constant.PDAResult.Success;
  5575. }
  5576. else
  5577. {
  5578. actionResult.Status = (int)Constant.PDAResult.Fail;
  5579. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5580. }
  5581. }
  5582. catch (Exception ex)
  5583. {
  5584. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5585. OutputLog.TraceLog(LogPriority.Error,
  5586. this.ToString(),
  5587. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5588. ex.ToString(),
  5589. LocalPath.LogExePath);
  5590. actionResult.Status = (int)Constant.PDAResult.Exception;
  5591. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5592. }
  5593. return actionResult;
  5594. }
  5595. /// <summary>
  5596. /// 公坯设定
  5597. /// </summary>
  5598. /// <param name="accountCode"></param>
  5599. /// <param name="userCode"></param>
  5600. /// <param name="userPassword"></param>
  5601. /// <param name="sessionKey"></param>
  5602. /// <param name="barcode"></param>
  5603. /// <returns></returns>
  5604. public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5605. {
  5606. ActionResult actionResult = new ActionResult();
  5607. try
  5608. {
  5609. // 验证请求头信息
  5610. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5611. // 验证失败
  5612. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5613. {
  5614. return actionResult;
  5615. }
  5616. int returnValue = ServiceInvoker.Invoke<int>(this,
  5617. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5618. if (returnValue > 0)
  5619. {
  5620. actionResult.Result = JsonHelper.ToJson(returnValue);
  5621. actionResult.Status = (int)Constant.PDAResult.Success;
  5622. }
  5623. else
  5624. {
  5625. actionResult.Status = (int)Constant.PDAResult.Fail;
  5626. if (returnValue == -1)
  5627. actionResult.Message = "此产品不在生产线上";
  5628. else if (returnValue == -2)
  5629. actionResult.Message = "该产品已经标识为公坯";
  5630. else
  5631. actionResult.Message = "公坯设定失败";
  5632. }
  5633. }
  5634. catch (Exception ex)
  5635. {
  5636. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5637. OutputLog.TraceLog(LogPriority.Error,
  5638. this.ToString(),
  5639. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5640. ex.ToString(),
  5641. LocalPath.LogExePath);
  5642. actionResult.Status = (int)Constant.PDAResult.Exception;
  5643. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5644. }
  5645. return actionResult;
  5646. }
  5647. /*
  5648. /// <summary>
  5649. /// 获取用户是否有公坯设定
  5650. /// </summary>
  5651. /// <param name="accountCode"></param>
  5652. /// <param name="userCode"></param>
  5653. /// <param name="userPassword"></param>
  5654. /// <param name="sessionKey"></param>
  5655. /// <returns></returns>
  5656. public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5657. {
  5658. ActionResult actionResult = new ActionResult();
  5659. try
  5660. {
  5661. // 验证请求头信息
  5662. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5663. // 验证失败
  5664. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5665. {
  5666. return actionResult;
  5667. }
  5668. int returnValue = ServiceInvoker.Invoke<int>(this,
  5669. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5670. actionResult.Result = JsonHelper.ToJson(returnValue);
  5671. actionResult.Status = (int)Constant.PDAResult.Success;
  5672. }
  5673. catch (Exception ex)
  5674. {
  5675. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5676. OutputLog.TraceLog(LogPriority.Error,
  5677. this.ToString(),
  5678. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5679. ex.ToString(),
  5680. LocalPath.LogExePath);
  5681. actionResult.Status = (int)Constant.PDAResult.Exception;
  5682. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5683. }
  5684. return actionResult;
  5685. }
  5686. */
  5687. /// <summary>
  5688. /// 校验产品条码是否可以走到该工序
  5689. /// </summary>
  5690. /// <param name="accountCode">帐套code</param>
  5691. /// <param name="userCode">用户code</param>
  5692. /// <param name="userPassword">用户密码</param>
  5693. /// <param name="sessionKey">本次登陆密钥</param>
  5694. /// <param name="procedureID">工序ID</param>
  5695. /// <param name="barcode">条码</param>
  5696. /// <returns></returns>
  5697. /// <remarks>
  5698. /// 陈冰 2014.09.18 新建
  5699. /// </remarks>
  5700. public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5701. {
  5702. ActionResult actionResult = new ActionResult();
  5703. try
  5704. {
  5705. // 验证请求头信息
  5706. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5707. // 验证失败
  5708. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5709. {
  5710. return actionResult;
  5711. }
  5712. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5713. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5714. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5715. {
  5716. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5717. actionResult.Status = (int)Constant.PDAResult.Success;
  5718. }
  5719. else
  5720. {
  5721. actionResult.Status = (int)Constant.PDAResult.Fail;
  5722. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5723. }
  5724. }
  5725. catch (Exception ex)
  5726. {
  5727. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5728. OutputLog.TraceLog(LogPriority.Error,
  5729. this.ToString(),
  5730. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5731. ex.ToString(),
  5732. LocalPath.LogExePath);
  5733. actionResult.Status = (int)Constant.PDAResult.Exception;
  5734. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5735. }
  5736. return actionResult;
  5737. }
  5738. /// <summary>
  5739. /// 获取用户所有菜单权限
  5740. /// </summary>
  5741. /// <param name="accountCode"></param>
  5742. /// <param name="userCode"></param>
  5743. /// <param name="userPassword"></param>
  5744. /// <param name="sessionKey"></param>
  5745. /// <returns></returns>
  5746. public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
  5747. {
  5748. ActionResult actionResult = new ActionResult();
  5749. try
  5750. {
  5751. // 验证请求头信息
  5752. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5753. // 验证失败
  5754. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5755. {
  5756. return actionResult;
  5757. }
  5758. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5759. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5760. actionResult.Result = JsonHelper.ToJson(returnValue);
  5761. actionResult.Status = (int)Constant.PDAResult.Success;
  5762. }
  5763. catch (Exception ex)
  5764. {
  5765. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5766. OutputLog.TraceLog(LogPriority.Error,
  5767. this.ToString(),
  5768. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5769. ex.ToString(),
  5770. LocalPath.LogExePath);
  5771. actionResult.Status = (int)Constant.PDAResult.Exception;
  5772. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5773. }
  5774. return actionResult;
  5775. }
  5776. public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5777. {
  5778. ActionResult actionResult = new ActionResult();
  5779. try
  5780. {
  5781. // 验证请求头信息
  5782. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5783. // 验证失败
  5784. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5785. {
  5786. return actionResult;
  5787. }
  5788. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5789. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5790. if (Convert.ToInt32(returnValue.Result) > 0)
  5791. {
  5792. actionResult.Result = JsonHelper.ToJson(returnValue);
  5793. actionResult.Status = (int)Constant.PDAResult.Success;
  5794. }
  5795. else
  5796. {
  5797. actionResult.Status = (int)Constant.PDAResult.Fail;
  5798. if (Convert.ToInt32(returnValue.Result) == -1)
  5799. actionResult.Message = "无效条码";
  5800. else if (Convert.ToInt32(returnValue.Result) == -2)
  5801. actionResult.Message = "已经生产完成";
  5802. else if (Convert.ToInt32(returnValue.Result) == -3)
  5803. actionResult.Message = "条码已经申请报废";
  5804. else if (Convert.ToInt32(returnValue.Result) == -4)
  5805. actionResult.Message = "此条码当前工序不允许进行撤销";
  5806. else if (Convert.ToInt32(returnValue.Result) == -5)
  5807. actionResult.Message = "此条码没有生产数据";
  5808. else if (Convert.ToInt32(returnValue.Result) == -6)
  5809. actionResult.Message = "没有当前工序权限";
  5810. else if (Convert.ToInt32(returnValue.Result) == -7)
  5811. actionResult.Message = "条码不在生产线上";
  5812. else if (Convert.ToInt32(returnValue.Result) == -8)
  5813. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5814. else if (Convert.ToInt32(returnValue.Result) == -9)
  5815. actionResult.Message = "条码已经是返工状态";
  5816. else if (Convert.ToInt32(returnValue.Result) == -200)
  5817. actionResult.Message = returnValue.Message;
  5818. }
  5819. }
  5820. catch (Exception ex)
  5821. {
  5822. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5823. OutputLog.TraceLog(LogPriority.Error,
  5824. this.ToString(),
  5825. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5826. ex.ToString(),
  5827. LocalPath.LogExePath);
  5828. actionResult.Status = (int)Constant.PDAResult.Exception;
  5829. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5830. }
  5831. return actionResult;
  5832. }
  5833. public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5834. {
  5835. ActionResult actionResult = new ActionResult();
  5836. try
  5837. {
  5838. // 验证请求头信息
  5839. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5840. // 验证失败
  5841. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5842. {
  5843. return actionResult;
  5844. }
  5845. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5846. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5847. if (Convert.ToInt32(returnValue.Result) > 0)
  5848. {
  5849. actionResult.Result = JsonHelper.ToJson(returnValue);
  5850. actionResult.Status = (int)Constant.PDAResult.Success;
  5851. }
  5852. else
  5853. {
  5854. actionResult.Status = (int)Constant.PDAResult.Fail;
  5855. if (Convert.ToInt32(returnValue.Result) == -1)
  5856. actionResult.Message = "无效条码";
  5857. else if (Convert.ToInt32(returnValue.Result) == -2)
  5858. actionResult.Message = "已经生产完成";
  5859. else if (Convert.ToInt32(returnValue.Result) == -3)
  5860. actionResult.Message = "条码已经申请报废";
  5861. else if (Convert.ToInt32(returnValue.Result) == -4)
  5862. actionResult.Message = "此条码当前工序不允许进行撤销";
  5863. else if (Convert.ToInt32(returnValue.Result) == -5)
  5864. actionResult.Message = "此条码没有生产数据";
  5865. else if (Convert.ToInt32(returnValue.Result) == -55)
  5866. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5867. else if (Convert.ToInt32(returnValue.Result) == -6)
  5868. actionResult.Message = "没有任何影响行";
  5869. else if (Convert.ToInt32(returnValue.Result) == -7)
  5870. actionResult.Message = "条码不在生产线上";
  5871. else if (Convert.ToInt32(returnValue.Result) == -8)
  5872. actionResult.Message = "条码已经是返工状态";
  5873. else if (Convert.ToInt32(returnValue.Result) == -200)
  5874. actionResult.Message = returnValue.Message;
  5875. }
  5876. }
  5877. catch (Exception ex)
  5878. {
  5879. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5880. OutputLog.TraceLog(LogPriority.Error,
  5881. this.ToString(),
  5882. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5883. ex.ToString(),
  5884. LocalPath.LogExePath);
  5885. actionResult.Status = (int)Constant.PDAResult.Exception;
  5886. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5887. }
  5888. return actionResult;
  5889. }
  5890. public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  5891. {
  5892. ActionResult actionResult = new ActionResult();
  5893. try
  5894. {
  5895. // 验证请求头信息
  5896. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5897. // 验证失败
  5898. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5899. {
  5900. return actionResult;
  5901. }
  5902. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5903. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5904. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5905. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5906. {
  5907. //DataView dv = returnValue.Tables[0].DefaultView;
  5908. //dv.RowFilter = "ValueFlag=1";
  5909. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5910. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5911. actionResult.Status = (int)Constant.PDAResult.Success;
  5912. }
  5913. }
  5914. catch (Exception ex)
  5915. {
  5916. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5917. OutputLog.TraceLog(LogPriority.Error,
  5918. this.ToString(),
  5919. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5920. ex.ToString(),
  5921. LocalPath.LogExePath);
  5922. actionResult.Status = (int)Constant.PDAResult.Exception;
  5923. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5924. }
  5925. return actionResult;
  5926. }
  5927. /// <summary>
  5928. /// 变更产品商标用
  5929. /// </summary>
  5930. /// <param name="accountCode"></param>
  5931. /// <param name="userCode"></param>
  5932. /// <param name="userPassword"></param>
  5933. /// <param name="sessionKey"></param>
  5934. /// <param name="goodsid"></param>
  5935. /// <returns></returns>
  5936. public ActionResult GetLogoInfoForChange(string accountCode, string userCode, string userPassword, string sessionKey
  5937. , int goodsid)
  5938. {
  5939. ActionResult actionResult = new ActionResult();
  5940. try
  5941. {
  5942. // 验证请求头信息
  5943. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5944. // 验证失败
  5945. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5946. {
  5947. return actionResult;
  5948. }
  5949. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5950. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5951. //() => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5952. () => SystemModuleLogic.GetLogoInfoForChange(sUserInfo, goodsid));
  5953. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5954. {
  5955. //DataView dv = returnValue.Tables[0].DefaultView;
  5956. //dv.RowFilter = "ValueFlag=1";
  5957. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5958. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5959. actionResult.Status = (int)Constant.PDAResult.Success;
  5960. }
  5961. }
  5962. catch (Exception ex)
  5963. {
  5964. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5965. OutputLog.TraceLog(LogPriority.Error,
  5966. this.ToString(),
  5967. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5968. ex.ToString(),
  5969. LocalPath.LogExePath);
  5970. actionResult.Status = (int)Constant.PDAResult.Exception;
  5971. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5972. }
  5973. return actionResult;
  5974. }
  5975. public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5976. {
  5977. ActionResult actionResult = new ActionResult();
  5978. try
  5979. {
  5980. // 验证请求头信息
  5981. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5982. // 验证失败
  5983. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5984. {
  5985. return actionResult;
  5986. }
  5987. int returnValue = ServiceInvoker.Invoke<int>(this,
  5988. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5989. actionResult.Result = JsonHelper.ToJson(returnValue);
  5990. actionResult.Status = (int)Constant.PDAResult.Success;
  5991. }
  5992. catch (Exception ex)
  5993. {
  5994. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5995. OutputLog.TraceLog(LogPriority.Error,
  5996. this.ToString(),
  5997. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5998. ex.ToString(),
  5999. LocalPath.LogExePath);
  6000. actionResult.Status = (int)Constant.PDAResult.Exception;
  6001. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6002. }
  6003. return actionResult;
  6004. }
  6005. public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  6006. {
  6007. ActionResult actionResult = new ActionResult();
  6008. try
  6009. {
  6010. // 验证请求头信息
  6011. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6012. // 验证失败
  6013. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6014. {
  6015. return actionResult;
  6016. }
  6017. string returnMessage = "";
  6018. int returnValue = ServiceInvoker.Invoke<int>(this,
  6019. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo, out returnMessage));
  6020. actionResult.Result = JsonHelper.ToJson(returnValue);
  6021. if (returnValue > 0)
  6022. {
  6023. actionResult.Status = (int)Constant.PDAResult.Success;
  6024. }
  6025. else if (returnValue == -2)
  6026. {
  6027. //lsq 20210723 已注浆非产成品没有商标可以变更商标
  6028. //begin
  6029. //actionResult.Message = "条码不存在";
  6030. actionResult.Message = "该条码未注浆";
  6031. //end
  6032. actionResult.Status = (int)Constant.PDAResult.Fail;
  6033. }
  6034. else if (returnValue == -3)
  6035. {
  6036. actionResult.Message = "产成品不能变更商标";
  6037. actionResult.Status = (int)Constant.PDAResult.Fail;
  6038. }
  6039. else if (returnValue == -5)
  6040. {
  6041. actionResult.Message = "该商标已超过生产计划允许变更数量,不能变更商标";
  6042. actionResult.Status = (int)Constant.PDAResult.Fail;
  6043. }
  6044. else if (returnValue == -6)
  6045. {
  6046. actionResult.Message = "该商标无计划,不允许变更商标";
  6047. actionResult.Status = (int)Constant.PDAResult.Fail;
  6048. }
  6049. else
  6050. {
  6051. actionResult.Message = returnMessage;
  6052. actionResult.Status = (int)Constant.PDAResult.Fail;
  6053. }
  6054. }
  6055. catch (Exception ex)
  6056. {
  6057. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6058. OutputLog.TraceLog(LogPriority.Error,
  6059. this.ToString(),
  6060. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6061. ex.ToString(),
  6062. LocalPath.LogExePath);
  6063. actionResult.Status = (int)Constant.PDAResult.Exception;
  6064. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6065. }
  6066. return actionResult;
  6067. }
  6068. /// <summary>
  6069. /// 乾润成瓷库出库专用
  6070. /// </summary>
  6071. /// <param name="accountCode"></param>
  6072. /// <param name="userCode"></param>
  6073. /// <param name="userPassword"></param>
  6074. /// <param name="sessionKey"></param>
  6075. /// <param name="barcode"></param>
  6076. /// <param name="logoid"></param>
  6077. /// <returns></returns>
  6078. public ActionResult SaveBarCodeLogoQRCCK(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  6079. {
  6080. ActionResult actionResult = new ActionResult();
  6081. try
  6082. {
  6083. // 验证请求头信息
  6084. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6085. // 验证失败
  6086. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6087. {
  6088. return actionResult;
  6089. }
  6090. string returnMessage = "";
  6091. int returnValue = ServiceInvoker.Invoke<int>(this,
  6092. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo, out returnMessage,1));
  6093. actionResult.Result = JsonHelper.ToJson(returnValue);
  6094. if (returnValue > 0)
  6095. {
  6096. actionResult.Status = (int)Constant.PDAResult.Success;
  6097. }
  6098. else if (returnValue == -2)
  6099. {
  6100. //lsq 20210723 已注浆非产成品没有商标可以变更商标
  6101. //begin
  6102. //actionResult.Message = "条码不存在";
  6103. actionResult.Message = "该条码未注浆";
  6104. //end
  6105. actionResult.Status = (int)Constant.PDAResult.Fail;
  6106. }
  6107. else if (returnValue == -3)
  6108. {
  6109. actionResult.Message = "已交接的产品不能变更商标";
  6110. actionResult.Status = (int)Constant.PDAResult.Fail;
  6111. }
  6112. else if (returnValue == -5)
  6113. {
  6114. actionResult.Message = "该商标已超过生产计划允许变更数量,不能变更商标";
  6115. actionResult.Status = (int)Constant.PDAResult.Fail;
  6116. }
  6117. else if (returnValue == -6)
  6118. {
  6119. actionResult.Message = "该商标无计划,不允许变更商标";
  6120. actionResult.Status = (int)Constant.PDAResult.Fail;
  6121. }
  6122. else
  6123. {
  6124. actionResult.Message = returnMessage;
  6125. actionResult.Status = (int)Constant.PDAResult.Fail;
  6126. }
  6127. }
  6128. catch (Exception ex)
  6129. {
  6130. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6131. OutputLog.TraceLog(LogPriority.Error,
  6132. this.ToString(),
  6133. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6134. ex.ToString(),
  6135. LocalPath.LogExePath);
  6136. actionResult.Status = (int)Constant.PDAResult.Exception;
  6137. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6138. }
  6139. return actionResult;
  6140. }
  6141. public ActionResult SaveBarCodeLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  6142. string barcode, int logoid, int glazetypeid)
  6143. {
  6144. ActionResult actionResult = new ActionResult();
  6145. try
  6146. {
  6147. // 验证请求头信息
  6148. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6149. // 验证失败
  6150. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6151. {
  6152. return actionResult;
  6153. }
  6154. string returnMessage = "";
  6155. int returnValue = ServiceInvoker.Invoke<int>(this,
  6156. () => PMModuleLogicDAL.SaveBarCodeLogoAndGlazetype(barcode, logoid, glazetypeid, sUserInfo, out returnMessage));
  6157. actionResult.Result = JsonHelper.ToJson(returnValue);
  6158. if (returnValue > 0)
  6159. {
  6160. actionResult.Status = (int)Constant.PDAResult.Success;
  6161. }
  6162. else
  6163. {
  6164. actionResult.Status = (int)Constant.PDAResult.Fail;
  6165. actionResult.Message = returnMessage;
  6166. }
  6167. }
  6168. catch (Exception ex)
  6169. {
  6170. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6171. OutputLog.TraceLog(LogPriority.Error,
  6172. this.ToString(),
  6173. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6174. ex.ToString(),
  6175. LocalPath.LogExePath);
  6176. actionResult.Status = (int)Constant.PDAResult.Exception;
  6177. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6178. }
  6179. return actionResult;
  6180. }
  6181. public ActionResult SaveBarCodesLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  6182. string barcodes, int logoid, int glazetypeid, int procedureID)
  6183. {
  6184. ActionResult actionResult = new ActionResult();
  6185. try
  6186. {
  6187. // 验证请求头信息
  6188. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6189. // 验证失败
  6190. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6191. {
  6192. return actionResult;
  6193. }
  6194. string returnMessage = "";
  6195. int returnValue = ServiceInvoker.Invoke<int>(this,
  6196. () => PMModuleLogicDAL.SaveBarCodesLogoAndGlazetype(barcodes, logoid, glazetypeid, procedureID, sUserInfo, out returnMessage));
  6197. actionResult.Result = JsonHelper.ToJson(returnValue);
  6198. if (returnValue > 0)
  6199. {
  6200. actionResult.Status = (int)Constant.PDAResult.Success;
  6201. }
  6202. else
  6203. {
  6204. actionResult.Status = (int)Constant.PDAResult.Fail;
  6205. actionResult.Message = returnMessage;
  6206. }
  6207. }
  6208. catch (Exception ex)
  6209. {
  6210. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6211. OutputLog.TraceLog(LogPriority.Error,
  6212. this.ToString(),
  6213. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6214. ex.ToString(),
  6215. LocalPath.LogExePath);
  6216. actionResult.Status = (int)Constant.PDAResult.Exception;
  6217. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6218. }
  6219. return actionResult;
  6220. }
  6221. public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6222. {
  6223. ActionResult actionResult = new ActionResult();
  6224. try
  6225. {
  6226. // 验证请求头信息
  6227. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6228. // 验证失败
  6229. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6230. {
  6231. return actionResult;
  6232. }
  6233. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  6234. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  6235. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  6236. {
  6237. string err_msg = returnValue.Tables[0].Rows[0]["err_msg"] + "";
  6238. if (!string.IsNullOrWhiteSpace(err_msg))
  6239. {
  6240. actionResult.Status = (int)Constant.PDAResult.Fail;
  6241. actionResult.Message = err_msg;
  6242. }
  6243. else
  6244. {
  6245. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  6246. actionResult.Status = (int)Constant.PDAResult.Success;
  6247. }
  6248. }
  6249. else
  6250. {
  6251. actionResult.Status = (int)Constant.PDAResult.Fail;
  6252. }
  6253. }
  6254. catch (Exception ex)
  6255. {
  6256. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6257. OutputLog.TraceLog(LogPriority.Error,
  6258. this.ToString(),
  6259. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6260. ex.ToString(),
  6261. LocalPath.LogExePath);
  6262. actionResult.Status = (int)Constant.PDAResult.Exception;
  6263. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6264. }
  6265. return actionResult;
  6266. }
  6267. /// <summary>
  6268. /// 半检时,入窑前检验获取此条码是否报损为废品
  6269. /// </summary>
  6270. /// <param name="accountCode"></param>
  6271. /// <param name="userCode"></param>
  6272. /// <param name="userPassword"></param>
  6273. /// <param name="sessionKey"></param>
  6274. /// <param name="barcode">产品条码</param>
  6275. /// <returns></returns>
  6276. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6277. {
  6278. ActionResult actionResult = new ActionResult();
  6279. try
  6280. {
  6281. // 验证请求头信息
  6282. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6283. // 验证失败
  6284. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6285. {
  6286. return actionResult;
  6287. }
  6288. int returnValue = ServiceInvoker.Invoke<int>(this,
  6289. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  6290. if (returnValue != -100)
  6291. {
  6292. actionResult.Result = JsonHelper.ToJson(returnValue);
  6293. actionResult.Status = (int)Constant.PDAResult.Success;
  6294. }
  6295. else
  6296. {
  6297. actionResult.Status = (int)Constant.PDAResult.Fail;
  6298. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  6299. }
  6300. }
  6301. catch (Exception ex)
  6302. {
  6303. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6304. OutputLog.TraceLog(LogPriority.Error,
  6305. this.ToString(),
  6306. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6307. ex.ToString(),
  6308. LocalPath.LogExePath);
  6309. actionResult.Status = (int)Constant.PDAResult.Exception;
  6310. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6311. }
  6312. return actionResult;
  6313. }
  6314. /// <summary>
  6315. /// 获取登陆帐户有无入窑前检验数据编辑权限
  6316. /// </summary>
  6317. /// <param name="accountCode"></param>
  6318. /// <param name="userCode"></param>
  6319. /// <param name="userPassword"></param>
  6320. /// <param name="sessionKey"></param>
  6321. /// <param name="usercode">工号编码</param>
  6322. /// <returns></returns>
  6323. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6324. {
  6325. ActionResult actionResult = new ActionResult();
  6326. try
  6327. {
  6328. // 验证请求头信息
  6329. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6330. // 验证失败
  6331. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6332. {
  6333. return actionResult;
  6334. }
  6335. int returnValue = ServiceInvoker.Invoke<int>(this,
  6336. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  6337. actionResult.Result = JsonHelper.ToJson(returnValue);
  6338. actionResult.Status = (int)Constant.PDAResult.Success;
  6339. }
  6340. catch (Exception ex)
  6341. {
  6342. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6343. OutputLog.TraceLog(LogPriority.Error,
  6344. this.ToString(),
  6345. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6346. ex.ToString(),
  6347. LocalPath.LogExePath);
  6348. actionResult.Status = (int)Constant.PDAResult.Exception;
  6349. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6350. }
  6351. return actionResult;
  6352. }
  6353. /// <summary>
  6354. /// 获取登陆帐户有无半检验数据编辑权限
  6355. /// </summary>
  6356. /// <param name="accountCode"></param>
  6357. /// <param name="userCode"></param>
  6358. /// <param name="userPassword"></param>
  6359. /// <param name="sessionKey"></param>
  6360. /// <param name="usercode">工号编码</param>
  6361. /// <returns></returns>
  6362. public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6363. {
  6364. ActionResult actionResult = new ActionResult();
  6365. try
  6366. {
  6367. // 验证请求头信息
  6368. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6369. // 验证失败
  6370. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6371. {
  6372. return actionResult;
  6373. }
  6374. int returnValue = ServiceInvoker.Invoke<int>(this,
  6375. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  6376. actionResult.Result = JsonHelper.ToJson(returnValue);
  6377. actionResult.Status = (int)Constant.PDAResult.Success;
  6378. }
  6379. catch (Exception ex)
  6380. {
  6381. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6382. OutputLog.TraceLog(LogPriority.Error,
  6383. this.ToString(),
  6384. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6385. ex.ToString(),
  6386. LocalPath.LogExePath);
  6387. actionResult.Status = (int)Constant.PDAResult.Exception;
  6388. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6389. }
  6390. return actionResult;
  6391. }
  6392. /// <summary>
  6393. /// 获取缺陷扣罚管理的全部数据
  6394. /// </summary>
  6395. /// <param name="accountCode"></param>
  6396. /// <param name="userCode"></param>
  6397. /// <param name="userPassword"></param>
  6398. /// <param name="sessionKey"></param>
  6399. /// <returns></returns>
  6400. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  6401. {
  6402. ActionResult actionResult = new ActionResult();
  6403. try
  6404. {
  6405. // 验证请求头信息
  6406. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6407. // 验证失败
  6408. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6409. {
  6410. return actionResult;
  6411. }
  6412. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6413. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  6414. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6415. {
  6416. DataView dv = ds.Tables[0].DefaultView;
  6417. dv.RowFilter = "valueflag=1";
  6418. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6419. actionResult.Status = (int)Constant.PDAResult.Success;
  6420. }
  6421. else
  6422. {
  6423. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6424. actionResult.Status = (int)Constant.PDAResult.Success;
  6425. }
  6426. }
  6427. catch (Exception ex)
  6428. {
  6429. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6430. OutputLog.TraceLog(LogPriority.Error,
  6431. this.ToString(),
  6432. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6433. ex.ToString(),
  6434. LocalPath.LogExePath);
  6435. actionResult.Status = (int)Constant.PDAResult.Exception;
  6436. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6437. }
  6438. return actionResult;
  6439. }
  6440. /// <summary>
  6441. /// 获取缺陷扣除数管理的全部数据
  6442. /// </summary>
  6443. /// <param name="accountCode"></param>
  6444. /// <param name="userCode"></param>
  6445. /// <param name="userPassword"></param>
  6446. /// <param name="sessionKey"></param>
  6447. /// <returns></returns>
  6448. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  6449. {
  6450. ActionResult actionResult = new ActionResult();
  6451. try
  6452. {
  6453. // 验证请求头信息
  6454. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6455. // 验证失败
  6456. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6457. {
  6458. return actionResult;
  6459. }
  6460. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6461. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  6462. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6463. {
  6464. DataView dv = ds.Tables[0].DefaultView;
  6465. dv.RowFilter = "valueflag=1";
  6466. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6467. actionResult.Status = (int)Constant.PDAResult.Success;
  6468. }
  6469. else
  6470. {
  6471. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6472. actionResult.Status = (int)Constant.PDAResult.Success;
  6473. }
  6474. }
  6475. catch (Exception ex)
  6476. {
  6477. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6478. OutputLog.TraceLog(LogPriority.Error,
  6479. this.ToString(),
  6480. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6481. ex.ToString(),
  6482. LocalPath.LogExePath);
  6483. actionResult.Status = (int)Constant.PDAResult.Exception;
  6484. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6485. }
  6486. return actionResult;
  6487. }
  6488. /// <summary>
  6489. /// 获取缺陷扣罚关系管理的全部数据
  6490. /// </summary>
  6491. /// <param name="accountCode"></param>
  6492. /// <param name="userCode"></param>
  6493. /// <param name="userPassword"></param>
  6494. /// <param name="sessionKey"></param>
  6495. /// <returns></returns>
  6496. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6497. {
  6498. ActionResult actionResult = new ActionResult();
  6499. try
  6500. {
  6501. // 验证请求头信息
  6502. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6503. // 验证失败
  6504. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6505. {
  6506. return actionResult;
  6507. }
  6508. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6509. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  6510. DataTable dt = new DataTable();
  6511. dt.Columns.Add("DefectID");
  6512. dt.Columns.Add("DefectFineID");
  6513. DataView dv = ds.Tables[0].DefaultView;
  6514. DataTable dtFor = dv.ToTable("defectid", true);
  6515. for (int i = 0; i < dtFor.Rows.Count; i++)
  6516. {
  6517. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6518. string substring = "";
  6519. foreach (DataRow r1 in r)
  6520. {
  6521. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  6522. }
  6523. if (substring != "")
  6524. {
  6525. DataRow drnew = dt.NewRow();
  6526. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6527. drnew["DefectFineID"] = substring.TrimEnd(',');
  6528. dt.Rows.Add(drnew);
  6529. }
  6530. }
  6531. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6532. actionResult.Status = (int)Constant.PDAResult.Success;
  6533. }
  6534. catch (Exception ex)
  6535. {
  6536. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6537. OutputLog.TraceLog(LogPriority.Error,
  6538. this.ToString(),
  6539. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6540. ex.ToString(),
  6541. LocalPath.LogExePath);
  6542. actionResult.Status = (int)Constant.PDAResult.Exception;
  6543. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6544. }
  6545. return actionResult;
  6546. }
  6547. /// <summary>
  6548. /// 获取缺陷扣除数关系管理的全部数据
  6549. /// </summary>
  6550. /// <param name="accountCode"></param>
  6551. /// <param name="userCode"></param>
  6552. /// <param name="userPassword"></param>
  6553. /// <param name="sessionKey"></param>
  6554. /// <returns></returns>
  6555. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6556. {
  6557. ActionResult actionResult = new ActionResult();
  6558. try
  6559. {
  6560. // 验证请求头信息
  6561. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6562. // 验证失败
  6563. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6564. {
  6565. return actionResult;
  6566. }
  6567. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6568. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6569. DataTable dt = new DataTable();
  6570. dt.Columns.Add("DefectID");
  6571. dt.Columns.Add("DefectDeductionNum");
  6572. DataView dv = ds.Tables[0].DefaultView;
  6573. DataTable dtFor = dv.ToTable("defectid", true);
  6574. for (int i = 0; i < dtFor.Rows.Count; i++)
  6575. {
  6576. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6577. string substring = "";
  6578. foreach (DataRow r1 in r)
  6579. {
  6580. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6581. }
  6582. if (substring != "")
  6583. {
  6584. DataRow drnew = dt.NewRow();
  6585. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6586. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6587. dt.Rows.Add(drnew);
  6588. }
  6589. }
  6590. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6591. actionResult.Status = (int)Constant.PDAResult.Success;
  6592. }
  6593. catch (Exception ex)
  6594. {
  6595. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6596. OutputLog.TraceLog(LogPriority.Error,
  6597. this.ToString(),
  6598. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6599. ex.ToString(),
  6600. LocalPath.LogExePath);
  6601. actionResult.Status = (int)Constant.PDAResult.Exception;
  6602. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6603. }
  6604. return actionResult;
  6605. }
  6606. /// <summary>
  6607. /// 获取盘点单明细
  6608. /// </summary>
  6609. /// <param name="sUserInfo"></param>
  6610. /// <returns></returns>
  6611. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6612. {
  6613. ActionResult actionResult = new ActionResult();
  6614. try
  6615. {
  6616. // 验证请求头信息
  6617. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6618. // 验证失败
  6619. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6620. {
  6621. return actionResult;
  6622. }
  6623. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6624. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6625. actionResult.Result = JsonHelper.ToJson(ds);
  6626. actionResult.Status = (int)Constant.PDAResult.Success;
  6627. }
  6628. catch (Exception ex)
  6629. {
  6630. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6631. OutputLog.TraceLog(LogPriority.Error,
  6632. this.ToString(),
  6633. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6634. ex.ToString(),
  6635. LocalPath.LogExePath);
  6636. actionResult.Status = (int)Constant.PDAResult.Exception;
  6637. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6638. }
  6639. return actionResult;
  6640. }
  6641. /// <summary>
  6642. /// 半检检验条码
  6643. /// </summary>
  6644. /// <param name="sUserInfo"></param>
  6645. /// <returns></returns>
  6646. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6647. {
  6648. ActionResult actionResult = new ActionResult();
  6649. try
  6650. {
  6651. // 验证请求头信息
  6652. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6653. // 验证失败
  6654. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6655. {
  6656. return actionResult;
  6657. }
  6658. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6659. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6660. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6661. if (Convert.ToInt32(resultEntity.Result) < 0)
  6662. {
  6663. actionResult.Status = (int)Constant.PDAResult.Fail;
  6664. }
  6665. else
  6666. {
  6667. actionResult.Status = (int)Constant.PDAResult.Success;
  6668. }
  6669. actionResult.Message = resultEntity.Message;
  6670. }
  6671. catch (Exception ex)
  6672. {
  6673. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6674. OutputLog.TraceLog(LogPriority.Error,
  6675. this.ToString(),
  6676. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6677. ex.ToString(),
  6678. LocalPath.LogExePath);
  6679. actionResult.Status = (int)Constant.PDAResult.Exception;
  6680. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6681. }
  6682. return actionResult;
  6683. }
  6684. /// <summary>
  6685. /// 根据条码获取经过的工序,用于绑定返工工序
  6686. /// </summary>
  6687. /// <param name="sUserInfo"></param>
  6688. /// <returns></returns>
  6689. public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6690. {
  6691. ActionResult actionResult = new ActionResult();
  6692. try
  6693. {
  6694. // 验证请求头信息
  6695. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6696. // 验证失败
  6697. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6698. {
  6699. return actionResult;
  6700. }
  6701. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6702. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6703. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6704. actionResult.Status = (int)Constant.PDAResult.Success;
  6705. }
  6706. catch (Exception ex)
  6707. {
  6708. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6709. OutputLog.TraceLog(LogPriority.Error,
  6710. this.ToString(),
  6711. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6712. ex.ToString(),
  6713. LocalPath.LogExePath);
  6714. actionResult.Status = (int)Constant.PDAResult.Exception;
  6715. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6716. }
  6717. return actionResult;
  6718. }
  6719. /// <summary>
  6720. /// 获取登陆帐户有无半检状态权限
  6721. /// </summary>
  6722. /// <param name="sUserInfo"></param>
  6723. /// <returns></returns>
  6724. public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6725. {
  6726. ActionResult actionResult = new ActionResult();
  6727. try
  6728. {
  6729. // 验证请求头信息
  6730. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6731. // 验证失败
  6732. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6733. {
  6734. return actionResult;
  6735. }
  6736. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6737. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6738. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6739. actionResult.Status = (int)Constant.PDAResult.Success;
  6740. }
  6741. catch (Exception ex)
  6742. {
  6743. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6744. OutputLog.TraceLog(LogPriority.Error,
  6745. this.ToString(),
  6746. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6747. ex.ToString(),
  6748. LocalPath.LogExePath);
  6749. actionResult.Status = (int)Constant.PDAResult.Exception;
  6750. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6751. }
  6752. return actionResult;
  6753. }
  6754. /// <summary>
  6755. /// 复检状态数据源
  6756. /// </summary>
  6757. /// <param name="sUserInfo"></param>
  6758. /// <returns></returns>
  6759. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6760. {
  6761. ActionResult actionResult = new ActionResult();
  6762. try
  6763. {
  6764. // 验证请求头信息
  6765. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6766. // 验证失败
  6767. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6768. {
  6769. return actionResult;
  6770. }
  6771. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6772. () => SystemModuleLogic.GetSemiCheckType());
  6773. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6774. actionResult.Status = (int)Constant.PDAResult.Success;
  6775. }
  6776. catch (Exception ex)
  6777. {
  6778. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6779. OutputLog.TraceLog(LogPriority.Error,
  6780. this.ToString(),
  6781. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6782. ex.ToString(),
  6783. LocalPath.LogExePath);
  6784. actionResult.Status = (int)Constant.PDAResult.Exception;
  6785. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6786. }
  6787. return actionResult;
  6788. }
  6789. /// <summary>
  6790. /// 根据半成品检验数据ID,显示半成品数据信息
  6791. /// </summary>
  6792. /// <param name="sUserInfo"></param>
  6793. /// <returns></returns>
  6794. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6795. {
  6796. ActionResult actionResult = new ActionResult();
  6797. try
  6798. {
  6799. // 验证请求头信息
  6800. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6801. // 验证失败
  6802. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6803. {
  6804. return actionResult;
  6805. }
  6806. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6807. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6808. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6809. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6810. {
  6811. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6812. {
  6813. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6814. {
  6815. SemiCheckEntity productionData = new SemiCheckEntity();
  6816. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6817. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6818. {
  6819. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6820. }
  6821. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6822. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6823. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6824. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6825. productionData.ReFine = 0;
  6826. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6827. {
  6828. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6829. }
  6830. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6831. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6832. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6833. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6834. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6835. {
  6836. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6837. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6838. }
  6839. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6840. {
  6841. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6842. }
  6843. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6844. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6845. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6846. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6847. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6848. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6849. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6850. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6851. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6852. {
  6853. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6854. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6855. }
  6856. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6857. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6858. {
  6859. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6860. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6861. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6862. }
  6863. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6864. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6865. {
  6866. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6867. }
  6868. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6869. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6870. DataTable dtDefect = dvDefect.ToTable();
  6871. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6872. {
  6873. // 产品缺陷
  6874. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6875. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6876. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6877. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6878. //{
  6879. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6880. //}
  6881. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6882. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6883. {
  6884. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6885. }
  6886. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6887. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6888. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6889. {
  6890. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6891. }
  6892. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6893. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6894. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6895. {
  6896. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6897. }
  6898. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6899. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6900. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6901. {
  6902. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6903. }
  6904. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6905. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6906. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6907. //{
  6908. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6909. //}
  6910. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6911. //{
  6912. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6913. //}
  6914. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6915. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6916. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6917. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6918. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6919. {
  6920. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6921. }
  6922. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6923. {
  6924. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6925. }
  6926. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6927. //{
  6928. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6929. //}
  6930. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6931. //--------责任员工-------------------
  6932. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6933. if (drRow.Length > Constant.INT_IS_ZERO)
  6934. {
  6935. if (defect.DefectResponsibles == null)
  6936. {
  6937. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6938. }
  6939. foreach (DataRow r in drRow)
  6940. {
  6941. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6942. if (r["SemiCheckDefectID"].ToString() != "")
  6943. {
  6944. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6945. }
  6946. if (r["StaffID"].ToString() != "")
  6947. {
  6948. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6949. }
  6950. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6951. defectResponsible.StaffName = r["StaffName"].ToString();
  6952. if (r["StaffStatus"].ToString() != "")
  6953. {
  6954. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6955. }
  6956. if (r["UJobsID"].ToString() != "")
  6957. {
  6958. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6959. }
  6960. if (r["SJobsID"].ToString() != "")
  6961. {
  6962. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6963. }
  6964. defect.DefectResponsibles.Add(defectResponsible);
  6965. }
  6966. }
  6967. //------------------------------
  6968. if (productionData.SemiCheckDefects == null)
  6969. {
  6970. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6971. }
  6972. productionData.SemiCheckDefects.Add(defect);
  6973. }
  6974. //if (productionDatas.PDAProductionData == null)
  6975. //{
  6976. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6977. //}
  6978. productionDatas[0] = productionData;
  6979. //---------------------------------------------------------------------------------
  6980. }
  6981. }
  6982. }
  6983. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6984. actionResult.Status = (int)Constant.PDAResult.Success;
  6985. }
  6986. catch (Exception ex)
  6987. {
  6988. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6989. OutputLog.TraceLog(LogPriority.Error,
  6990. this.ToString(),
  6991. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6992. ex.ToString(),
  6993. LocalPath.LogExePath);
  6994. actionResult.Status = (int)Constant.PDAResult.Exception;
  6995. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6996. }
  6997. return actionResult;
  6998. }
  6999. /// <summary>
  7000. /// 保存半检登记
  7001. /// </summary>
  7002. /// <param name="accountCode">帐套code</param>
  7003. /// <param name="userCode">用户code</param>
  7004. /// <param name="userPassword">用户密码</param>
  7005. /// <param name="sessionKey">本次登陆密钥</param>
  7006. /// <param name="entity">半检实体类</param>
  7007. /// <param name="sUserInfo">用户基本信息</param>
  7008. /// <returns></returns>
  7009. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  7010. {
  7011. ActionResult actionResult = new ActionResult();
  7012. try
  7013. {
  7014. // 验证请求头信息
  7015. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7016. // 验证失败
  7017. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7018. {
  7019. return actionResult;
  7020. }
  7021. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7022. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  7023. string err = string.Empty;
  7024. err = resultEntity.Message;
  7025. if (err == null)
  7026. {
  7027. err = "";
  7028. }
  7029. SemiCheckEntity entity = entityobj[0];
  7030. if (entity.SemiCheckCategory == 1) // 半检登记
  7031. {
  7032. }
  7033. else if (entity.SemiCheckCategory == 2)// 复检登记
  7034. {
  7035. err = JsonHelper.ToJson(err);
  7036. }
  7037. else if (entity.SemiCheckCategory == 3)// 撤销复检
  7038. {
  7039. err = JsonHelper.ToJson(err);
  7040. }
  7041. //actionResult.Result = JsonHelper.ToJson(err);
  7042. actionResult.Result = err;//JsonHelper.ToJson(err);
  7043. actionResult.Status = (int)Constant.PDAResult.Success;
  7044. }
  7045. catch (Exception ex)
  7046. {
  7047. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7048. OutputLog.TraceLog(LogPriority.Error,
  7049. this.ToString(),
  7050. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7051. ex.ToString(),
  7052. LocalPath.LogExePath);
  7053. actionResult.Status = (int)Constant.PDAResult.Exception;
  7054. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7055. }
  7056. return actionResult;
  7057. }
  7058. /// <summary>
  7059. /// 根据所选工号,查出缺陷责任员工
  7060. /// </summary>
  7061. /// <param name="sUserInfo"></param>
  7062. /// <returns></returns>
  7063. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  7064. {
  7065. ActionResult actionResult = new ActionResult();
  7066. try
  7067. {
  7068. // 验证请求头信息
  7069. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7070. // 验证失败
  7071. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7072. {
  7073. return actionResult;
  7074. }
  7075. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7076. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  7077. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7078. actionResult.Status = (int)Constant.PDAResult.Success;
  7079. }
  7080. catch (Exception ex)
  7081. {
  7082. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7083. OutputLog.TraceLog(LogPriority.Error,
  7084. this.ToString(),
  7085. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7086. ex.ToString(),
  7087. LocalPath.LogExePath);
  7088. actionResult.Status = (int)Constant.PDAResult.Exception;
  7089. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7090. }
  7091. return actionResult;
  7092. }
  7093. /// <summary>
  7094. /// 获取半成品缺陷管理的全部数据
  7095. /// </summary>
  7096. /// <param name="sUserInfo"></param>
  7097. /// <returns></returns>
  7098. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  7099. {
  7100. ActionResult actionResult = new ActionResult();
  7101. try
  7102. {
  7103. // 验证请求头信息
  7104. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7105. // 验证失败
  7106. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7107. {
  7108. return actionResult;
  7109. }
  7110. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7111. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  7112. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7113. actionResult.Status = (int)Constant.PDAResult.Success;
  7114. }
  7115. catch (Exception ex)
  7116. {
  7117. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7118. OutputLog.TraceLog(LogPriority.Error,
  7119. this.ToString(),
  7120. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7121. ex.ToString(),
  7122. LocalPath.LogExePath);
  7123. actionResult.Status = (int)Constant.PDAResult.Exception;
  7124. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7125. }
  7126. return actionResult;
  7127. }
  7128. /// <summary>
  7129. /// 获取PLC参数
  7130. /// </summary>
  7131. /// <param name="sUserInfo"></param>
  7132. /// <returns></returns>
  7133. public ActionResult GetPLCParameter(string accountCode, string userCode, string userPassword, string sessionKey, string PlcName)
  7134. {
  7135. ActionResult actionResult = new ActionResult();
  7136. try
  7137. {
  7138. // 验证请求头信息
  7139. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7140. // 验证失败
  7141. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7142. {
  7143. return actionResult;
  7144. }
  7145. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7146. () => SystemModuleLogic.GetPLCParameter(PlcName));
  7147. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7148. actionResult.Status = (int)Constant.PDAResult.Success;
  7149. }
  7150. catch (Exception ex)
  7151. {
  7152. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7153. OutputLog.TraceLog(LogPriority.Error,
  7154. this.ToString(),
  7155. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7156. ex.ToString(),
  7157. LocalPath.LogExePath);
  7158. actionResult.Status = (int)Constant.PDAResult.Exception;
  7159. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7160. }
  7161. return actionResult;
  7162. }
  7163. /// <summary>
  7164. /// 获取产品信息
  7165. /// </summary>
  7166. /// <param name="sUserInfo"></param>
  7167. /// <returns></returns>
  7168. public ActionResult GetGodsParameter(string accountCode, string userCode, string userPassword, string sessionKey, string BarCode)
  7169. {
  7170. ActionResult actionResult = new ActionResult();
  7171. try
  7172. {
  7173. // 验证请求头信息
  7174. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7175. // 验证失败
  7176. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7177. {
  7178. return actionResult;
  7179. }
  7180. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7181. () => SystemModuleLogic.GetGodsParameter(BarCode));
  7182. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7183. actionResult.Status = (int)Constant.PDAResult.Success;
  7184. }
  7185. catch (Exception ex)
  7186. {
  7187. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7188. OutputLog.TraceLog(LogPriority.Error,
  7189. this.ToString(),
  7190. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7191. ex.ToString(),
  7192. LocalPath.LogExePath);
  7193. actionResult.Status = (int)Constant.PDAResult.Exception;
  7194. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7195. }
  7196. return actionResult;
  7197. }
  7198. /// <summary>
  7199. /// 传输PLC产品信息
  7200. /// </summary>
  7201. /// <param name="sUserInfo"></param>
  7202. /// <returns></returns>
  7203. public ActionResult AddPlcGood(string accountCode, string userCode, string userPassword, string sessionKey, string Plcid, string BarCode, string GROUTINGLINECODE, string GOODSMODEL, string GOODSTYPENAME, string GOODSSPECIFICATION)
  7204. {
  7205. ActionResult actionResult = new ActionResult();
  7206. try
  7207. {
  7208. // 验证请求头信息
  7209. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7210. // 验证失败
  7211. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7212. {
  7213. return actionResult;
  7214. }
  7215. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7216. () => SystemModuleLogic.AddPlcGood(Plcid, BarCode, GROUTINGLINECODE, GOODSMODEL, GOODSTYPENAME, GOODSSPECIFICATION));
  7217. actionResult.Result = JsonHelper.ToJson(resultEntity);
  7218. actionResult.Status = (int)Constant.PDAResult.Success;
  7219. }
  7220. catch (Exception ex)
  7221. {
  7222. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7223. OutputLog.TraceLog(LogPriority.Error,
  7224. this.ToString(),
  7225. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7226. ex.ToString(),
  7227. LocalPath.LogExePath);
  7228. actionResult.Status = (int)Constant.PDAResult.Exception;
  7229. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7230. }
  7231. return actionResult;
  7232. }
  7233. /// <summary>
  7234. /// 获取半成品缺陷位置管理的全部数据
  7235. /// </summary>
  7236. /// <param name="sUserInfo"></param>
  7237. /// <returns></returns>
  7238. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  7239. {
  7240. ActionResult actionResult = new ActionResult();
  7241. try
  7242. {
  7243. // 验证请求头信息
  7244. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7245. // 验证失败
  7246. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7247. {
  7248. return actionResult;
  7249. }
  7250. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7251. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  7252. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7253. actionResult.Status = (int)Constant.PDAResult.Success;
  7254. }
  7255. catch (Exception ex)
  7256. {
  7257. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7258. OutputLog.TraceLog(LogPriority.Error,
  7259. this.ToString(),
  7260. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7261. ex.ToString(),
  7262. LocalPath.LogExePath);
  7263. actionResult.Status = (int)Constant.PDAResult.Exception;
  7264. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7265. }
  7266. return actionResult;
  7267. }
  7268. /// <summary>
  7269. /// 复检验条码
  7270. /// </summary>
  7271. /// <param name="sUserInfo"></param>
  7272. /// <returns></returns>
  7273. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7274. {
  7275. ActionResult actionResult = new ActionResult();
  7276. try
  7277. {
  7278. // 验证请求头信息
  7279. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7280. // 验证失败
  7281. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7282. {
  7283. return actionResult;
  7284. }
  7285. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7286. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  7287. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7288. if (Convert.ToInt32(resultEntity.Result) < 0)
  7289. {
  7290. actionResult.Status = (int)Constant.PDAResult.Fail;
  7291. }
  7292. else
  7293. {
  7294. actionResult.Status = (int)Constant.PDAResult.Success;
  7295. }
  7296. actionResult.Message = resultEntity.Message;
  7297. }
  7298. catch (Exception ex)
  7299. {
  7300. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7301. OutputLog.TraceLog(LogPriority.Error,
  7302. this.ToString(),
  7303. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7304. ex.ToString(),
  7305. LocalPath.LogExePath);
  7306. actionResult.Status = (int)Constant.PDAResult.Exception;
  7307. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7308. }
  7309. return actionResult;
  7310. }
  7311. /// <summary>
  7312. /// 撤销复检验条码
  7313. /// </summary>
  7314. /// <param name="sUserInfo"></param>
  7315. /// <returns></returns>
  7316. public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7317. {
  7318. ActionResult actionResult = new ActionResult();
  7319. try
  7320. {
  7321. // 验证请求头信息
  7322. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7323. // 验证失败
  7324. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7325. {
  7326. return actionResult;
  7327. }
  7328. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7329. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  7330. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7331. if (Convert.ToInt32(resultEntity.Result) < 0)
  7332. {
  7333. actionResult.Status = (int)Constant.PDAResult.Fail;
  7334. }
  7335. else
  7336. {
  7337. actionResult.Status = (int)Constant.PDAResult.Success;
  7338. }
  7339. actionResult.Message = resultEntity.Message;
  7340. }
  7341. catch (Exception ex)
  7342. {
  7343. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7344. OutputLog.TraceLog(LogPriority.Error,
  7345. this.ToString(),
  7346. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7347. ex.ToString(),
  7348. LocalPath.LogExePath);
  7349. actionResult.Status = (int)Constant.PDAResult.Exception;
  7350. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7351. }
  7352. return actionResult;
  7353. }
  7354. /// <summary>
  7355. /// 恢复数据
  7356. /// </summary>
  7357. /// <param name="sUserInfo"></param>
  7358. /// <returns></returns>
  7359. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7360. {
  7361. ActionResult actionResult = new ActionResult();
  7362. try
  7363. {
  7364. // 验证请求头信息
  7365. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7366. // 验证失败
  7367. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7368. {
  7369. return actionResult;
  7370. }
  7371. int resultEntity = ServiceInvoker.Invoke<int>(this,
  7372. () => PMModuleLogicDAL.ResetBarCode(barcode));
  7373. if (resultEntity > 0)
  7374. {
  7375. actionResult.Status = (int)Constant.PDAResult.Success;
  7376. actionResult.Message = "恢复数据成功";
  7377. }
  7378. else
  7379. {
  7380. actionResult.Status = (int)Constant.PDAResult.Fail;
  7381. if (resultEntity == -1)
  7382. {
  7383. actionResult.Message = "此条码没有清除,不能恢复";
  7384. }
  7385. else if (resultEntity == 0)
  7386. {
  7387. actionResult.Message = "没有可恢复的数据";
  7388. }
  7389. }
  7390. }
  7391. catch (Exception ex)
  7392. {
  7393. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7394. OutputLog.TraceLog(LogPriority.Error,
  7395. this.ToString(),
  7396. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7397. ex.ToString(),
  7398. LocalPath.LogExePath);
  7399. actionResult.Status = (int)Constant.PDAResult.Exception;
  7400. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7401. }
  7402. return actionResult;
  7403. }
  7404. /// <summary>
  7405. /// 通过SettingCode获取系统参数管理的数据
  7406. /// </summary>
  7407. /// <param name="accountCode"></param>
  7408. /// <param name="userCode"></param>
  7409. /// <param name="userPassword"></param>
  7410. /// <param name="sessionKey"></param>
  7411. /// <param name="settingcode">设置编码</param>
  7412. /// <returns></returns>
  7413. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  7414. {
  7415. ActionResult actionResult = new ActionResult();
  7416. try
  7417. {
  7418. // 验证请求头信息
  7419. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7420. // 验证失败
  7421. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7422. {
  7423. return actionResult;
  7424. }
  7425. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7426. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  7427. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7428. actionResult.Status = (int)Constant.PDAResult.Success;
  7429. }
  7430. catch (Exception ex)
  7431. {
  7432. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7433. OutputLog.TraceLog(LogPriority.Error,
  7434. this.ToString(),
  7435. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7436. ex.ToString(),
  7437. LocalPath.LogExePath);
  7438. actionResult.Status = (int)Constant.PDAResult.Exception;
  7439. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7440. }
  7441. return actionResult;
  7442. }
  7443. /// <summary>
  7444. /// 校验条码是否允许撤销,如果不允许提示错误消息
  7445. /// </summary>
  7446. /// <param name="accountCode"></param>
  7447. /// <param name="userCode"></param>
  7448. /// <param name="userPassword"></param>
  7449. /// <param name="sessionKey"></param>
  7450. /// <param name="orgTime">原时间</param>
  7451. /// <param name="days">允许撤销天数</param>
  7452. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  7453. /// <returns></returns>
  7454. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  7455. {
  7456. ActionResult actionResult = new ActionResult();
  7457. try
  7458. {
  7459. // 验证请求头信息
  7460. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7461. // 验证失败
  7462. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7463. {
  7464. return actionResult;
  7465. }
  7466. string[] subOrgTime = orgTime.Split('-');
  7467. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  7468. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7469. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  7470. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7471. if (Convert.ToInt32(resultEntity.Result) < 0)
  7472. {
  7473. actionResult.Status = (int)Constant.PDAResult.Fail;
  7474. }
  7475. else
  7476. {
  7477. actionResult.Status = (int)Constant.PDAResult.Success;
  7478. }
  7479. actionResult.Message = resultEntity.Message;
  7480. }
  7481. catch (Exception ex)
  7482. {
  7483. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7484. OutputLog.TraceLog(LogPriority.Error,
  7485. this.ToString(),
  7486. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7487. ex.ToString(),
  7488. LocalPath.LogExePath);
  7489. actionResult.Status = (int)Constant.PDAResult.Exception;
  7490. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7491. }
  7492. return actionResult;
  7493. }
  7494. /// <summary>
  7495. /// 获取生产订单管理的全部数据
  7496. /// </summary>
  7497. /// <param name="sUserInfo"></param>
  7498. /// <returns></returns>
  7499. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  7500. {
  7501. ActionResult actionResult = new ActionResult();
  7502. try
  7503. {
  7504. // 验证请求头信息
  7505. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7506. // 验证失败
  7507. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7508. {
  7509. return actionResult;
  7510. }
  7511. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7512. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  7513. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7514. actionResult.Status = (int)Constant.PDAResult.Success;
  7515. }
  7516. catch (Exception ex)
  7517. {
  7518. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7519. OutputLog.TraceLog(LogPriority.Error,
  7520. this.ToString(),
  7521. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7522. ex.ToString(),
  7523. LocalPath.LogExePath);
  7524. actionResult.Status = (int)Constant.PDAResult.Exception;
  7525. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7526. }
  7527. return actionResult;
  7528. }
  7529. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7530. {
  7531. ActionResult actionResult = new ActionResult();
  7532. try
  7533. {
  7534. // 验证请求头信息
  7535. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7536. // 验证失败
  7537. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7538. {
  7539. return actionResult;
  7540. }
  7541. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7542. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  7543. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7544. if (Convert.ToInt32(resultEntity.Result) < 0)
  7545. {
  7546. actionResult.Status = (int)Constant.PDAResult.Fail;
  7547. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  7548. }
  7549. else
  7550. {
  7551. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  7552. actionResult.Status = (int)Constant.PDAResult.Success;
  7553. }
  7554. actionResult.Message = resultEntity.Message;
  7555. }
  7556. catch (Exception ex)
  7557. {
  7558. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7559. OutputLog.TraceLog(LogPriority.Error,
  7560. this.ToString(),
  7561. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7562. ex.ToString(),
  7563. LocalPath.LogExePath);
  7564. actionResult.Status = (int)Constant.PDAResult.Exception;
  7565. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7566. }
  7567. return actionResult;
  7568. }
  7569. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  7570. {
  7571. ActionResult actionResult = new ActionResult();
  7572. try
  7573. {
  7574. // 验证请求头信息
  7575. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7576. // 验证失败
  7577. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7578. {
  7579. return actionResult;
  7580. }
  7581. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7582. () => SystemModuleLogic.GetSystemData(sUserInfo));
  7583. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7584. actionResult.Status = (int)Constant.PDAResult.Success;
  7585. }
  7586. catch (Exception ex)
  7587. {
  7588. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7589. OutputLog.TraceLog(LogPriority.Error,
  7590. this.ToString(),
  7591. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7592. ex.ToString(),
  7593. LocalPath.LogExePath);
  7594. actionResult.Status = (int)Constant.PDAResult.Exception;
  7595. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7596. }
  7597. return actionResult;
  7598. }
  7599. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  7600. {
  7601. ActionResult actionResult = new ActionResult();
  7602. try
  7603. {
  7604. // 验证请求头信息
  7605. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7606. // 验证失败
  7607. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7608. {
  7609. return actionResult;
  7610. }
  7611. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  7612. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7613. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  7614. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7615. if (Convert.ToInt32(resultEntity.Result) < 0)
  7616. {
  7617. actionResult.Status = (int)Constant.PDAResult.Fail;
  7618. }
  7619. else
  7620. {
  7621. actionResult.Status = (int)Constant.PDAResult.Success;
  7622. }
  7623. actionResult.Message = resultEntity.Message;
  7624. }
  7625. catch (Exception ex)
  7626. {
  7627. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7628. OutputLog.TraceLog(LogPriority.Error,
  7629. this.ToString(),
  7630. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7631. ex.ToString(),
  7632. LocalPath.LogExePath);
  7633. actionResult.Status = (int)Constant.PDAResult.Exception;
  7634. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7635. }
  7636. return actionResult;
  7637. }
  7638. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7639. {
  7640. ActionResult actionResult = new ActionResult();
  7641. try
  7642. {
  7643. // 验证请求头信息
  7644. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7645. // 验证失败
  7646. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7647. {
  7648. return actionResult;
  7649. }
  7650. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7651. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7652. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7653. if (Convert.ToInt32(resultEntity.Result) < 0)
  7654. {
  7655. actionResult.Status = (int)Constant.PDAResult.Fail;
  7656. }
  7657. else
  7658. {
  7659. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7660. actionResult.Status = (int)Constant.PDAResult.Success;
  7661. }
  7662. actionResult.Message = resultEntity.Message;
  7663. }
  7664. catch (Exception ex)
  7665. {
  7666. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7667. OutputLog.TraceLog(LogPriority.Error,
  7668. this.ToString(),
  7669. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7670. ex.ToString(),
  7671. LocalPath.LogExePath);
  7672. actionResult.Status = (int)Constant.PDAResult.Exception;
  7673. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7674. }
  7675. return actionResult;
  7676. }
  7677. public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7678. {
  7679. ActionResult actionResult = new ActionResult();
  7680. try
  7681. {
  7682. // 验证请求头信息
  7683. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7684. // 验证失败
  7685. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7686. {
  7687. return actionResult;
  7688. }
  7689. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7690. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7691. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7692. if (Convert.ToInt32(resultEntity.Result) < 0)
  7693. {
  7694. actionResult.Status = (int)Constant.PDAResult.Fail;
  7695. }
  7696. else
  7697. {
  7698. actionResult.Status = (int)Constant.PDAResult.Success;
  7699. }
  7700. actionResult.Message = resultEntity.Message;
  7701. }
  7702. catch (Exception ex)
  7703. {
  7704. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7705. OutputLog.TraceLog(LogPriority.Error,
  7706. this.ToString(),
  7707. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7708. ex.ToString(),
  7709. LocalPath.LogExePath);
  7710. actionResult.Status = (int)Constant.PDAResult.Exception;
  7711. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7712. }
  7713. return actionResult;
  7714. }
  7715. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7716. {
  7717. ActionResult actionResult = new ActionResult();
  7718. try
  7719. {
  7720. // 验证请求头信息
  7721. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7722. // 验证失败
  7723. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7724. {
  7725. return actionResult;
  7726. }
  7727. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7728. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7729. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7730. if (Convert.ToInt32(resultEntity.Result) < 0)
  7731. {
  7732. actionResult.Status = (int)Constant.PDAResult.Fail;
  7733. }
  7734. else
  7735. {
  7736. actionResult.Status = (int)Constant.PDAResult.Success;
  7737. }
  7738. actionResult.Message = resultEntity.Message;
  7739. }
  7740. catch (Exception ex)
  7741. {
  7742. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7743. OutputLog.TraceLog(LogPriority.Error,
  7744. this.ToString(),
  7745. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7746. ex.ToString(),
  7747. LocalPath.LogExePath);
  7748. actionResult.Status = (int)Constant.PDAResult.Exception;
  7749. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7750. }
  7751. return actionResult;
  7752. }
  7753. #region PDA条码打印
  7754. /// <summary>
  7755. /// 获取条码打印机
  7756. /// </summary>
  7757. /// <param name="accountCode"></param>
  7758. /// <param name="userCode"></param>
  7759. /// <param name="userPassword"></param>
  7760. /// <param name="sessionKey"></param>
  7761. /// <returns></returns>
  7762. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printType = 0)
  7763. {
  7764. ActionResult actionResult = new ActionResult();
  7765. try
  7766. {
  7767. // 验证请求头信息
  7768. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7769. // 验证失败
  7770. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7771. {
  7772. return actionResult;
  7773. }
  7774. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType);
  7775. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7776. actionResult.Status = (int)Constant.PDAResult.Success;
  7777. }
  7778. catch (Exception ex)
  7779. {
  7780. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7781. OutputLog.TraceLog(LogPriority.Error,
  7782. this.ToString(),
  7783. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7784. ex.ToString(),
  7785. LocalPath.LogExePath);
  7786. actionResult.Status = (int)Constant.PDAResult.Exception;
  7787. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7788. }
  7789. return actionResult;
  7790. }
  7791. /// <summary>
  7792. /// 打印条码样式(补打)
  7793. /// </summary>
  7794. /// <param name="accountCode"></param>
  7795. /// <param name="userCode"></param>
  7796. /// <param name="userPassword"></param>
  7797. /// <param name="sessionKey"></param>
  7798. /// <returns></returns>
  7799. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey,
  7800. string barcode, int copies, int printerID, int printWay = 2)
  7801. {
  7802. ActionResult actionResult = new ActionResult();
  7803. try
  7804. {
  7805. // 验证请求头信息
  7806. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7807. // 验证失败
  7808. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7809. {
  7810. return actionResult;
  7811. }
  7812. /*if (printWay == 0)
  7813. {
  7814. printWay = 2;
  7815. }*/
  7816. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7817. // copies, printerID, sUserInfo);
  7818. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(barcode,
  7819. copies, printerID, sUserInfo, printWay);
  7820. if (sre.Status != Constant.ServiceResultStatus.Success)
  7821. {
  7822. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7823. actionResult.Message = sre.Message;
  7824. return actionResult;
  7825. }
  7826. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7827. actionResult.Status = (int)Constant.PDAResult.Success;
  7828. }
  7829. catch (Exception ex)
  7830. {
  7831. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7832. OutputLog.TraceLog(LogPriority.Error,
  7833. this.ToString(),
  7834. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7835. ex.ToString(),
  7836. LocalPath.LogExePath);
  7837. actionResult.Status = (int)Constant.PDAResult.Exception;
  7838. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7839. }
  7840. return actionResult;
  7841. }
  7842. #endregion PDA条码打印
  7843. #region 统计报表
  7844. /// <summary>
  7845. /// 成型结算报表
  7846. /// </summary>
  7847. /// <param name="accountCode"></param>
  7848. /// <param name="userCode"></param>
  7849. /// <param name="userPassword"></param>
  7850. /// <param name="sessionKey"></param>
  7851. /// <returns></returns>
  7852. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7853. int currentMonth)
  7854. {
  7855. ActionResult actionResult = new ActionResult();
  7856. try
  7857. {
  7858. // 验证请求头信息
  7859. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7860. // 验证失败
  7861. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7862. {
  7863. return actionResult;
  7864. }
  7865. DateTime date = DateTime.Now;
  7866. if (currentMonth != 1)
  7867. {
  7868. date = date.AddMonths(-1);
  7869. }
  7870. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7871. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7872. if (resultEntity == null || resultEntity.Data == null)
  7873. {
  7874. actionResult.Status = (int)Constant.PDAResult.Fail;
  7875. actionResult.Message = "查询失败";
  7876. return actionResult;
  7877. }
  7878. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7879. {
  7880. actionResult.Status = (int)Constant.PDAResult.Fail;
  7881. actionResult.Message = resultEntity.Message;
  7882. return actionResult;
  7883. }
  7884. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  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. /// 设置当期用户默认打印机配置
  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="printerID"></param>
  7910. /// <returns></returns>
  7911. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7912. int printerID)
  7913. {
  7914. ActionResult actionResult = new ActionResult();
  7915. try
  7916. {
  7917. // 验证请求头信息
  7918. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7919. // 验证失败
  7920. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7921. {
  7922. return actionResult;
  7923. }
  7924. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7925. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7926. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7927. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7928. {
  7929. actionResult.Status = (int)Constant.PDAResult.Fail;
  7930. }
  7931. else
  7932. {
  7933. actionResult.Status = (int)Constant.PDAResult.Success;
  7934. }
  7935. actionResult.Message = resultEntity.Message;
  7936. }
  7937. catch (Exception ex)
  7938. {
  7939. OutputLog.TraceLog(LogPriority.Error,
  7940. this.ToString(),
  7941. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7942. ex.ToString(),
  7943. LocalPath.LogExePath);
  7944. actionResult.Status = (int)Constant.PDAResult.Exception;
  7945. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7946. }
  7947. return actionResult;
  7948. }
  7949. /// <summary>
  7950. /// 校验产品条码是否可以进行回收
  7951. /// </summary>
  7952. /// <param name="accountCode">帐套code</param>
  7953. /// <param name="userCode">用户code</param>
  7954. /// <param name="userPassword">用户密码</param>
  7955. /// <param name="sessionKey">本次登陆密钥</param>
  7956. /// <param name="procedureID">工序ID</param>
  7957. /// <param name="barcode">条码</param>
  7958. /// <returns></returns>
  7959. /// <remarks>
  7960. /// 王鑫 2017.7.21 新建
  7961. /// </remarks>
  7962. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7963. {
  7964. ActionResult actionResult = new ActionResult();
  7965. try
  7966. {
  7967. // 验证请求头信息
  7968. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7969. // 验证失败
  7970. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7971. {
  7972. return actionResult;
  7973. }
  7974. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7975. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7976. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7977. {
  7978. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7979. actionResult.Status = (int)Constant.PDAResult.Success;
  7980. }
  7981. else
  7982. {
  7983. actionResult.Status = (int)Constant.PDAResult.Fail;
  7984. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7985. }
  7986. }
  7987. catch (Exception ex)
  7988. {
  7989. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7990. OutputLog.TraceLog(LogPriority.Error,
  7991. this.ToString(),
  7992. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7993. ex.ToString(),
  7994. LocalPath.LogExePath);
  7995. actionResult.Status = (int)Constant.PDAResult.Exception;
  7996. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7997. }
  7998. return actionResult;
  7999. }
  8000. /// <summary>
  8001. /// 获取回收标识
  8002. /// </summary>
  8003. /// <param name="accountCode"></param>
  8004. /// <param name="userCode"></param>
  8005. /// <param name="userPassword"></param>
  8006. /// <param name="sessionKey"></param>
  8007. /// <param name="usercode">工号编码</param>
  8008. /// <returns></returns>
  8009. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  8010. {
  8011. ActionResult actionResult = new ActionResult();
  8012. try
  8013. {
  8014. // 验证请求头信息
  8015. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8016. // 验证失败
  8017. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8018. {
  8019. return actionResult;
  8020. }
  8021. int returnValue = ServiceInvoker.Invoke<int>(this,
  8022. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  8023. actionResult.Result = JsonHelper.ToJson(returnValue);
  8024. actionResult.Status = (int)Constant.PDAResult.Success;
  8025. }
  8026. catch (Exception ex)
  8027. {
  8028. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8029. OutputLog.TraceLog(LogPriority.Error,
  8030. this.ToString(),
  8031. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8032. ex.ToString(),
  8033. LocalPath.LogExePath);
  8034. actionResult.Status = (int)Constant.PDAResult.Exception;
  8035. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8036. }
  8037. return actionResult;
  8038. }
  8039. #endregion
  8040. #region 注浆盘点
  8041. /// <summary>
  8042. /// 获取注浆盘点单列表
  8043. /// </summary>
  8044. /// <param name="sUserInfo"></param>
  8045. /// <returns></returns>
  8046. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  8047. {
  8048. ActionResult actionResult = new ActionResult();
  8049. try
  8050. {
  8051. // 验证请求头信息
  8052. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8053. // 验证失败
  8054. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8055. {
  8056. return actionResult;
  8057. }
  8058. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  8059. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  8060. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8061. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  8062. actionResult.Result = JsonHelper.ToJson(ds);
  8063. actionResult.Status = (int)Constant.PDAResult.Success;
  8064. }
  8065. catch (Exception ex)
  8066. {
  8067. string json = JsonHelper.ToJson(entity);
  8068. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8069. OutputLog.TraceLog(LogPriority.Error,
  8070. this.ToString(),
  8071. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  8072. ex.ToString(),
  8073. LocalPath.LogExePath);
  8074. actionResult.Status = (int)Constant.PDAResult.Exception;
  8075. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8076. }
  8077. return actionResult;
  8078. }
  8079. /// <summary>
  8080. /// 进行盘点操作
  8081. /// </summary>
  8082. /// <param name="accountCode"></param>
  8083. /// <param name="userCode"></param>
  8084. /// <param name="userPassword"></param>
  8085. /// <param name="sessionKey"></param>
  8086. /// <param name="InCheckedID">盘点单ID</param>
  8087. /// <param name="BarCode">产品条码</param>
  8088. /// <returns></returns>
  8089. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  8090. {
  8091. ActionResult actionResult = new ActionResult();
  8092. try
  8093. {
  8094. // 验证请求头信息
  8095. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8096. // 验证失败
  8097. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8098. {
  8099. return actionResult;
  8100. }
  8101. ClientRequestEntity cre = new ClientRequestEntity();
  8102. cre.Properties["CheckedID"] = CheckedID;
  8103. cre.Properties["Barcode"] = BarCode;
  8104. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  8105. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  8106. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  8107. {
  8108. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8109. actionResult.Status = (int)Constant.PDAResult.Success;
  8110. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  8111. }
  8112. else
  8113. {
  8114. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8115. actionResult.Status = (int)Constant.PDAResult.Fail;
  8116. actionResult.Message = returnValue.Message;
  8117. }
  8118. }
  8119. catch (Exception ex)
  8120. {
  8121. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8122. OutputLog.TraceLog(LogPriority.Error,
  8123. this.ToString(),
  8124. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8125. ex.ToString(),
  8126. LocalPath.LogExePath);
  8127. actionResult.Status = (int)Constant.PDAResult.Exception;
  8128. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8129. }
  8130. return actionResult;
  8131. }
  8132. /// <summary>
  8133. /// 获取盘点单明细
  8134. /// </summary>
  8135. /// <param name="sUserInfo"></param>
  8136. /// <returns></returns>
  8137. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  8138. {
  8139. ActionResult actionResult = new ActionResult();
  8140. try
  8141. {
  8142. // 验证请求头信息
  8143. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8144. // 验证失败
  8145. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8146. {
  8147. return actionResult;
  8148. }
  8149. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8150. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  8151. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  8152. actionResult.Result = JsonHelper.ToJson(ds);
  8153. actionResult.Status = (int)Constant.PDAResult.Success;
  8154. }
  8155. catch (Exception ex)
  8156. {
  8157. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8158. OutputLog.TraceLog(LogPriority.Error,
  8159. this.ToString(),
  8160. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8161. ex.ToString(),
  8162. LocalPath.LogExePath);
  8163. actionResult.Status = (int)Constant.PDAResult.Exception;
  8164. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8165. }
  8166. return actionResult;
  8167. }
  8168. #endregion
  8169. #region 模具盘点
  8170. /// <summary>
  8171. /// 获取模具盘点单列表
  8172. /// </summary>
  8173. /// <param name="sUserInfo"></param>
  8174. /// <returns></returns>
  8175. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  8176. {
  8177. ActionResult actionResult = new ActionResult();
  8178. try
  8179. {
  8180. // 验证请求头信息
  8181. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8182. // 验证失败
  8183. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8184. {
  8185. return actionResult;
  8186. }
  8187. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  8188. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  8189. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8190. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  8191. actionResult.Result = JsonHelper.ToJson(ds);
  8192. actionResult.Status = (int)Constant.PDAResult.Success;
  8193. }
  8194. catch (Exception ex)
  8195. {
  8196. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8197. OutputLog.TraceLog(LogPriority.Error,
  8198. this.ToString(),
  8199. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8200. ex.ToString(),
  8201. LocalPath.LogExePath);
  8202. actionResult.Status = (int)Constant.PDAResult.Exception;
  8203. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8204. }
  8205. return actionResult;
  8206. }
  8207. /// <summary>
  8208. /// 进行盘点操作
  8209. /// </summary>
  8210. /// <param name="accountCode"></param>
  8211. /// <param name="userCode"></param>
  8212. /// <param name="userPassword"></param>
  8213. /// <param name="sessionKey"></param>
  8214. /// <param name="InCheckedID">盘点单ID</param>
  8215. /// <param name="BarCode">产品条码</param>
  8216. /// <returns></returns>
  8217. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  8218. {
  8219. ActionResult actionResult = new ActionResult();
  8220. try
  8221. {
  8222. // 验证请求头信息
  8223. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8224. // 验证失败
  8225. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8226. {
  8227. return actionResult;
  8228. }
  8229. ClientRequestEntity cre = new ClientRequestEntity();
  8230. cre.Properties["CheckedID"] = CheckedID;
  8231. cre.Properties["Barcode"] = BarCode;
  8232. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  8233. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  8234. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  8235. {
  8236. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8237. actionResult.Status = (int)Constant.PDAResult.Success;
  8238. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  8239. }
  8240. else
  8241. {
  8242. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8243. actionResult.Status = (int)Constant.PDAResult.Fail;
  8244. actionResult.Message = returnValue.Message;
  8245. }
  8246. }
  8247. catch (Exception ex)
  8248. {
  8249. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8250. OutputLog.TraceLog(LogPriority.Error,
  8251. this.ToString(),
  8252. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8253. ex.ToString(),
  8254. LocalPath.LogExePath);
  8255. actionResult.Status = (int)Constant.PDAResult.Exception;
  8256. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8257. }
  8258. return actionResult;
  8259. }
  8260. /// <summary>
  8261. /// 获取盘点单明细
  8262. /// </summary>
  8263. /// <param name="sUserInfo"></param>
  8264. /// <returns></returns>
  8265. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  8266. {
  8267. ActionResult actionResult = new ActionResult();
  8268. try
  8269. {
  8270. // 验证请求头信息
  8271. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8272. // 验证失败
  8273. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8274. {
  8275. return actionResult;
  8276. }
  8277. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8278. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  8279. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  8280. actionResult.Result = JsonHelper.ToJson(ds);
  8281. actionResult.Status = (int)Constant.PDAResult.Success;
  8282. }
  8283. catch (Exception ex)
  8284. {
  8285. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8286. OutputLog.TraceLog(LogPriority.Error,
  8287. this.ToString(),
  8288. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8289. ex.ToString(),
  8290. LocalPath.LogExePath);
  8291. actionResult.Status = (int)Constant.PDAResult.Exception;
  8292. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8293. }
  8294. return actionResult;
  8295. }
  8296. #endregion
  8297. #region 通用接口
  8298. /// <summary>
  8299. /// PDA调用通用接口
  8300. /// </summary>
  8301. /// <param name="accountCode"></param>
  8302. /// <param name="userCode"></param>
  8303. /// <param name="userPassword"></param>
  8304. /// <param name="sessionKey"></param>
  8305. /// <param name="module"></param>
  8306. /// <param name="action"></param>
  8307. /// <param name="data"></param>
  8308. /// <returns></returns>
  8309. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  8310. string module, string action, string jsonData)
  8311. {
  8312. ActionResult actionResult = null;
  8313. try
  8314. {
  8315. // 验证请求头信息
  8316. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8317. // 验证失败
  8318. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8319. {
  8320. return actionResult;
  8321. }
  8322. actionResult.Status = (int)Constant.PDAResult.Fail;
  8323. Dictionary<string, object> data = null;
  8324. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  8325. {
  8326. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  8327. }
  8328. #region PDA报表
  8329. if (module == "Report")
  8330. {
  8331. // 成型月度结算
  8332. if (action == "GetGroutingSettlementInfo")
  8333. {
  8334. DateTime month = DateTime.Now;
  8335. month = new DateTime(month.Year, month.Month, 1);
  8336. //month = new DateTime(2017, 6, 1);
  8337. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  8338. if (currentMonth != 1)
  8339. {
  8340. month = month.AddMonths(-1);
  8341. }
  8342. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month, currentMonth);
  8343. if (sre.Status == Constant.ServiceResultStatus.Success)
  8344. {
  8345. actionResult.Status = (int)Constant.PDAResult.Success;
  8346. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8347. }
  8348. else
  8349. {
  8350. actionResult.Status = (int)Constant.PDAResult.Fail;
  8351. actionResult.Message = sre.Message;
  8352. }
  8353. return actionResult;
  8354. }
  8355. // 成型月度结算-明细
  8356. if (action == "GetGroutingSettlementDetail")
  8357. {
  8358. DateTime month = DateTime.Now;
  8359. month = new DateTime(month.Year, month.Month, 1);
  8360. //month = new DateTime(2017, 6, 1);
  8361. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  8362. if (currentMonth != 1)
  8363. {
  8364. month = month.AddMonths(-1);
  8365. }
  8366. string goodsCode = data["GoodsCode"].ToString();
  8367. string detailDate = data["DetailDate"].ToString();
  8368. DateTime? date = null;
  8369. if (detailDate != "合计")
  8370. {
  8371. date = DateTime.Parse(detailDate);
  8372. }
  8373. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date, currentMonth);
  8374. if (sre.Status == Constant.ServiceResultStatus.Success)
  8375. {
  8376. actionResult.Status = (int)Constant.PDAResult.Success;
  8377. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8378. }
  8379. else
  8380. {
  8381. actionResult.Status = (int)Constant.PDAResult.Fail;
  8382. actionResult.Message = sre.Message;
  8383. }
  8384. return actionResult;
  8385. }
  8386. // 产成品交接汇总
  8387. if (action == "GetFinishedProductHandoverSum")
  8388. {
  8389. DateTime date = DateTime.Parse(data["date"].ToString());
  8390. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  8391. data["goodscode"] as string, sUserInfo);
  8392. if (sre.Status == Constant.ServiceResultStatus.Success)
  8393. {
  8394. actionResult.Status = (int)Constant.PDAResult.Success;
  8395. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8396. }
  8397. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  8398. {
  8399. actionResult.Status = (int)Constant.PDAResult.Success;
  8400. }
  8401. else
  8402. {
  8403. actionResult.Status = (int)Constant.PDAResult.Fail;
  8404. actionResult.Message = sre.Message;
  8405. }
  8406. return actionResult;
  8407. }
  8408. //xuwei add 2019-10-21
  8409. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  8410. if (action == "GetSemiReworkDayCount")
  8411. {
  8412. //不指定参数查询当天
  8413. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  8414. //dateStr = "2019-10-17";
  8415. //指定参数查询特定日期
  8416. if (data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  8417. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  8418. if (sre.Status == Constant.ServiceResultStatus.Success)
  8419. {
  8420. actionResult.Status = (int)Constant.PDAResult.Success;
  8421. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8422. }
  8423. else
  8424. {
  8425. actionResult.Status = (int)Constant.PDAResult.Fail;
  8426. actionResult.Message = sre.Message;
  8427. }
  8428. return actionResult;
  8429. }
  8430. //xuwe end
  8431. return actionResult;
  8432. }
  8433. #endregion
  8434. #region 模具管理
  8435. if (module == "PC_Mould")
  8436. {
  8437. #region 模具新建画面数据初始化
  8438. if (action == "GetMouldAddInit")
  8439. {
  8440. ClientRequestEntity cre = new ClientRequestEntity();
  8441. cre.Properties["MouldID"] = 0;
  8442. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  8443. if (sre.Status == Constant.ServiceResultStatus.Success)
  8444. {
  8445. actionResult.Status = (int)Constant.PDAResult.Success;
  8446. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8447. }
  8448. else
  8449. {
  8450. actionResult.Status = (int)Constant.PDAResult.Fail;
  8451. actionResult.Message = sre.Message;
  8452. }
  8453. return actionResult;
  8454. }
  8455. #endregion
  8456. #region 验证模具产品型号
  8457. if (action == "CheckGoodsCodeOnMould")
  8458. {
  8459. ClientRequestEntity cre = new ClientRequestEntity();
  8460. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8461. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  8462. if (sre.Status == Constant.ServiceResultStatus.Success &&
  8463. sre.Data.Tables[0].Rows.Count > 0)
  8464. {
  8465. actionResult.Status = (int)Constant.PDAResult.Success;
  8466. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8467. }
  8468. else
  8469. {
  8470. actionResult.Status = (int)Constant.PDAResult.Fail;
  8471. actionResult.Message = "无效产品型号";
  8472. }
  8473. return actionResult;
  8474. }
  8475. #endregion
  8476. #region 验证模具生产工号
  8477. if (action == "CheckUserCodeOnMould")
  8478. {
  8479. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  8480. if (sre != null && sre.Rows.Count > 0)
  8481. {
  8482. actionResult.Status = (int)Constant.PDAResult.Success;
  8483. actionResult.Result = JsonHelper.ToJson(sre);
  8484. }
  8485. else
  8486. {
  8487. actionResult.Status = (int)Constant.PDAResult.Fail;
  8488. actionResult.Message = "无效生产工号";
  8489. }
  8490. return actionResult;
  8491. }
  8492. #endregion
  8493. #region 新建保存
  8494. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  8495. {
  8496. ClientRequestEntity cre = new ClientRequestEntity();
  8497. foreach (string item in data.Keys)
  8498. {
  8499. if (item == "ProductionDate")
  8500. {
  8501. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  8502. }
  8503. else
  8504. {
  8505. cre.Properties.Add(item, data[item]);
  8506. }
  8507. }
  8508. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  8509. if (sre.Status == Constant.ServiceResultStatus.Success)
  8510. {
  8511. actionResult.Status = (int)Constant.PDAResult.Success;
  8512. }
  8513. else
  8514. {
  8515. actionResult.Status = (int)Constant.PDAResult.Fail;
  8516. actionResult.Result = sre.OtherStatus;
  8517. actionResult.Message = sre.Message;
  8518. }
  8519. return actionResult;
  8520. }
  8521. #endregion
  8522. #region 模具编辑画面数据初始化
  8523. if (action == "GetMouldEditInfo")
  8524. {
  8525. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  8526. if (sre != null && sre.Rows.Count > 0)
  8527. {
  8528. actionResult.Status = (int)Constant.PDAResult.Success;
  8529. actionResult.Result = JsonHelper.ToJson(sre);
  8530. }
  8531. else
  8532. {
  8533. actionResult.Status = (int)Constant.PDAResult.Fail;
  8534. actionResult.Message = "无效模具条码";
  8535. }
  8536. return actionResult;
  8537. }
  8538. #endregion
  8539. #region 模具操作-画面初始化
  8540. if (action == "GetMouldOperationInit")
  8541. {
  8542. ClientRequestEntity cre = new ClientRequestEntity();
  8543. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8544. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8545. if (sre.Status == Constant.ServiceResultStatus.Success)
  8546. {
  8547. actionResult.Status = (int)Constant.PDAResult.Success;
  8548. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8549. }
  8550. else
  8551. {
  8552. actionResult.Status = (int)Constant.PDAResult.Fail;
  8553. actionResult.Result = sre.OtherStatus;
  8554. actionResult.Message = sre.Message;
  8555. }
  8556. return actionResult;
  8557. }
  8558. #endregion
  8559. #region 模具操作-验证模具条码
  8560. if (action == "CheckMouldBarcode")
  8561. {
  8562. ClientRequestEntity cre = new ClientRequestEntity();
  8563. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8564. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8565. if (sre.Status == Constant.ServiceResultStatus.Success)
  8566. {
  8567. if (sre.Data.Tables[0].Rows.Count == 0)
  8568. {
  8569. actionResult.Status = (int)Constant.PDAResult.Fail;
  8570. actionResult.Result = -1;
  8571. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8572. return actionResult;
  8573. }
  8574. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8575. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8576. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8577. #region 报损
  8578. if (mouldOperationType == 2)
  8579. {
  8580. if (mouldStatusID == 1 || mouldStatusID == 3)
  8581. {
  8582. actionResult.Status = (int)Constant.PDAResult.Success;
  8583. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8584. }
  8585. else
  8586. {
  8587. actionResult.Status = (int)Constant.PDAResult.Fail;
  8588. actionResult.Result = -2;
  8589. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8590. }
  8591. return actionResult;
  8592. }
  8593. #endregion
  8594. #region 撤销
  8595. if (mouldOperationType == 3)
  8596. {
  8597. if (mouldStatusID == 4)
  8598. {
  8599. actionResult.Status = (int)Constant.PDAResult.Success;
  8600. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8601. }
  8602. else
  8603. {
  8604. actionResult.Status = (int)Constant.PDAResult.Fail;
  8605. actionResult.Result = -2;
  8606. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  8607. }
  8608. return actionResult;
  8609. }
  8610. #endregion
  8611. #region 领用
  8612. if (mouldOperationType == 4)
  8613. {
  8614. if (mouldStatusID == 1)
  8615. {
  8616. actionResult.Status = (int)Constant.PDAResult.Success;
  8617. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8618. }
  8619. else
  8620. {
  8621. actionResult.Status = (int)Constant.PDAResult.Fail;
  8622. actionResult.Result = -2;
  8623. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  8624. }
  8625. return actionResult;
  8626. }
  8627. #endregion
  8628. #region 回收
  8629. if (mouldOperationType == 5)
  8630. {
  8631. if (mouldStatusID == 3)
  8632. {
  8633. actionResult.Status = (int)Constant.PDAResult.Success;
  8634. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8635. }
  8636. else
  8637. {
  8638. actionResult.Status = (int)Constant.PDAResult.Fail;
  8639. actionResult.Result = -2;
  8640. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  8641. }
  8642. return actionResult;
  8643. }
  8644. #endregion
  8645. #region 变更型号
  8646. if (mouldOperationType == -1)
  8647. {
  8648. if (mouldStatusID != 4)
  8649. {
  8650. actionResult.Status = (int)Constant.PDAResult.Success;
  8651. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8652. }
  8653. else
  8654. {
  8655. actionResult.Status = (int)Constant.PDAResult.Fail;
  8656. actionResult.Result = -2;
  8657. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  8658. }
  8659. return actionResult;
  8660. }
  8661. #endregion
  8662. #region 替换条码
  8663. if (mouldOperationType == -2)
  8664. {
  8665. actionResult.Status = (int)Constant.PDAResult.Success;
  8666. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8667. return actionResult;
  8668. }
  8669. #endregion
  8670. #region 模具干燥
  8671. if (mouldOperationType == 14)
  8672. {
  8673. ServiceResultEntity sre1 = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldDataMake(sUserInfo, cre);
  8674. mouldStatusID = Convert.ToInt32(sre1.Data.Tables[0].Rows[0]["MouldStatus"]);
  8675. mouldStatusName = sre1.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8676. if (mouldStatusID == 5)
  8677. {
  8678. actionResult.Status = (int)Constant.PDAResult.Success;
  8679. actionResult.Result = JsonHelper.ToJson(sre1.Data.Tables[0]);
  8680. }
  8681. else
  8682. {
  8683. actionResult.Status = (int)Constant.PDAResult.Fail;
  8684. actionResult.Result = -2;
  8685. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行模具干燥操作";
  8686. }
  8687. return actionResult;
  8688. }
  8689. #endregion
  8690. return actionResult;
  8691. }
  8692. }
  8693. #endregion
  8694. #region 模具操作-保存
  8695. if (action == "SetMouldOperation")
  8696. {
  8697. ClientRequestEntity cre = new ClientRequestEntity();
  8698. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8699. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8700. cre.Properties["Remarks"] = data["Remarks"];
  8701. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8702. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8703. {
  8704. cre.Properties["GoodsID"] = data["GoodsID"];
  8705. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8706. }
  8707. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8708. {
  8709. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8710. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8711. }
  8712. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8713. if (sre.Status == Constant.ServiceResultStatus.Success)
  8714. {
  8715. actionResult.Status = (int)Constant.PDAResult.Success;
  8716. }
  8717. else
  8718. {
  8719. actionResult.Status = (int)Constant.PDAResult.Fail;
  8720. }
  8721. return actionResult;
  8722. }
  8723. #endregion
  8724. #region 模具操作-替换条码
  8725. if (action == "ChangedMouldBarcode")
  8726. {
  8727. ClientRequestEntity cre = new ClientRequestEntity();
  8728. cre.Properties["MouldID"] = data["MouldID"];
  8729. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8730. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8731. cre.Properties["Remarks"] = data["Remarks"];
  8732. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8733. if (sre.Status == Constant.ServiceResultStatus.Success)
  8734. {
  8735. actionResult.Status = (int)Constant.PDAResult.Success;
  8736. }
  8737. else
  8738. {
  8739. actionResult.Status = (int)Constant.PDAResult.Fail;
  8740. actionResult.Result = sre.OtherStatus;
  8741. actionResult.Message = sre.Message;
  8742. }
  8743. return actionResult;
  8744. }
  8745. #endregion
  8746. #region 模具跟踪表
  8747. if (action == "GetMoldTracking")
  8748. {
  8749. ClientRequestEntity cre = new ClientRequestEntity();
  8750. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8751. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8752. if (sre.Status == Constant.ServiceResultStatus.Success)
  8753. {
  8754. actionResult.Status = (int)Constant.PDAResult.Success;
  8755. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8756. }
  8757. else
  8758. {
  8759. actionResult.Status = (int)Constant.PDAResult.Fail;
  8760. actionResult.Message = "此模具条码不存在";
  8761. }
  8762. return actionResult;
  8763. }
  8764. #endregion
  8765. return actionResult;
  8766. }
  8767. #endregion
  8768. #region 成型线模具管理
  8769. if (module == "PC_GroutingLineMould")
  8770. {
  8771. #region 获取当前用户成型线模具管理权限
  8772. if (action == "GetGMouldStatusRight")
  8773. {
  8774. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8775. actionResult.Status = (int)Constant.PDAResult.Success;
  8776. if (right != null && right.Rows.Count > 0)
  8777. {
  8778. actionResult.Result = JsonHelper.ToJson(right);
  8779. }
  8780. return actionResult;
  8781. }
  8782. #endregion
  8783. #region 获取成型线状态等信息,和成型模具信息
  8784. if (action == "GetGroutingLineMould")
  8785. {
  8786. int? groutingLineID = null;
  8787. string groutingLineCode = null;
  8788. if (data.ContainsKey("GroutingLineID"))
  8789. {
  8790. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8791. }
  8792. else
  8793. {
  8794. groutingLineCode = data["GroutingLineCode"] + "";
  8795. }
  8796. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8797. if (lineInfo == null)
  8798. {
  8799. actionResult.Status = (int)Constant.PDAResult.Fail;
  8800. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8801. }
  8802. else
  8803. {
  8804. actionResult.Status = (int)Constant.PDAResult.Success;
  8805. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8806. }
  8807. return actionResult;
  8808. }
  8809. #endregion
  8810. #region 模具操作-画面初始化
  8811. if (action == "GetMouldOperationInit")
  8812. {
  8813. ClientRequestEntity cre = new ClientRequestEntity();
  8814. cre.Properties["MouldOperationType"] = 2;
  8815. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8816. if (sre.Status == Constant.ServiceResultStatus.Success)
  8817. {
  8818. actionResult.Status = (int)Constant.PDAResult.Success;
  8819. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8820. }
  8821. else
  8822. {
  8823. actionResult.Status = (int)Constant.PDAResult.Fail;
  8824. actionResult.Result = sre.OtherStatus;
  8825. actionResult.Message = sre.Message;
  8826. }
  8827. return actionResult;
  8828. }
  8829. #endregion
  8830. #region 成型模具操作-画面初始化
  8831. if (action == "GetGroutingMouldOperationInit")
  8832. {
  8833. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8834. if (initData != null && initData.Rows.Count > 0)
  8835. {
  8836. actionResult.Status = (int)Constant.PDAResult.Success;
  8837. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8838. foreach (DataRow item in initData.Rows)
  8839. {
  8840. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8841. }
  8842. actionResult.Result = JsonHelper.ToJson(syssetting);
  8843. }
  8844. else
  8845. {
  8846. actionResult.Status = (int)Constant.PDAResult.Fail;
  8847. }
  8848. return actionResult;
  8849. }
  8850. #endregion
  8851. #region 模具操作-验证模具条码
  8852. if (action == "CheckMouldBarcode")
  8853. {
  8854. ClientRequestEntity cre = new ClientRequestEntity();
  8855. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8856. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8857. if (sre.Status == Constant.ServiceResultStatus.Success)
  8858. {
  8859. if (sre.Data.Tables[0].Rows.Count == 0)
  8860. {
  8861. actionResult.Status = (int)Constant.PDAResult.Fail;
  8862. actionResult.Result = -1;
  8863. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8864. return actionResult;
  8865. }
  8866. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8867. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8868. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8869. #region 上线
  8870. if (mouldOperationType == 6)
  8871. {
  8872. if (mouldStatusID == 1 || mouldStatusID == 3)
  8873. {
  8874. if (data.ContainsKey("GoodsID"))
  8875. {
  8876. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8877. {
  8878. actionResult.Status = (int)Constant.PDAResult.Fail;
  8879. actionResult.Result = -3;
  8880. actionResult.Message =
  8881. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8882. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8883. "】与当前不一致";
  8884. return actionResult;
  8885. }
  8886. }
  8887. if (!string.IsNullOrWhiteSpace(sre.Data.Tables[0].Rows[0]["MouldTypeName"].ToString()) && sre.Data.Tables[0].Rows[0]["MouldTypeName"].ToString() != "高压")
  8888. {
  8889. if (string.IsNullOrWhiteSpace(sre.Data.Tables[0].Rows[0]["mouldPlan"].ToString()) || Convert.ToInt32(sre.Data.Tables[0].Rows[0]["mouldPlan"].ToString()) == 0)
  8890. {
  8891. actionResult.Status = (int)Constant.PDAResult.Fail;
  8892. actionResult.Result = -3;
  8893. actionResult.Message =
  8894. "此模具未报工,不能添加到成型线";
  8895. return actionResult;
  8896. }
  8897. }
  8898. actionResult.Status = (int)Constant.PDAResult.Success;
  8899. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8900. }
  8901. else
  8902. {
  8903. actionResult.Status = (int)Constant.PDAResult.Fail;
  8904. actionResult.Result = -2;
  8905. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8906. }
  8907. return actionResult;
  8908. }
  8909. #endregion
  8910. return actionResult;
  8911. }
  8912. }
  8913. #endregion
  8914. #region 停用
  8915. if (action == "StopGroutingLineDetail")
  8916. {
  8917. if (data == null || !data.ContainsKey("Details"))
  8918. {
  8919. actionResult.Status = (int)Constant.PDAResult.Fail;
  8920. actionResult.Message = "参数错误";
  8921. return actionResult;
  8922. }
  8923. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8924. DataTable gTable = new DataTable();
  8925. gTable.Columns.Add("GroutingLineID", typeof(int));
  8926. gTable.Columns.Add("GroutingLineCode");
  8927. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8928. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8929. gTable.Columns.Add("GroutingMouldCode");
  8930. gTable.Columns.Add("RecordRemarks");
  8931. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8932. gTable.Columns.Add("MouldID", typeof(int));
  8933. gTable.Columns.Add("MouldCode");
  8934. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8935. string groutingLineCode = data["GroutingLineCode"] + "";
  8936. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8937. foreach (Dictionary<string, object> item in details)
  8938. {
  8939. int? mouldID = null;
  8940. if (item.ContainsKey("MouldID"))
  8941. {
  8942. mouldID = Convert.ToInt32(item["MouldID"]);
  8943. if (mouldID == 0)
  8944. {
  8945. mouldID = null;
  8946. }
  8947. }
  8948. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8949. item["GLineDetailID"], item["GLineDetailCode"],
  8950. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8951. mouldID, item["MouldCode"]);
  8952. }
  8953. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8954. if (result > 0)
  8955. {
  8956. actionResult.Status = (int)Constant.PDAResult.Success;
  8957. }
  8958. else
  8959. {
  8960. actionResult.Status = (int)Constant.PDAResult.Fail;
  8961. actionResult.Result = result;
  8962. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8963. return actionResult;
  8964. }
  8965. return actionResult;
  8966. }
  8967. #endregion
  8968. #region 启用
  8969. if (action == "StartGroutingLineDetail")
  8970. {
  8971. if (data == null || !data.ContainsKey("Details"))
  8972. {
  8973. actionResult.Status = (int)Constant.PDAResult.Fail;
  8974. actionResult.Message = "参数错误";
  8975. return actionResult;
  8976. }
  8977. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8978. DataTable gTable = new DataTable();
  8979. gTable.Columns.Add("GroutingLineID", typeof(int));
  8980. gTable.Columns.Add("GroutingLineCode");
  8981. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8982. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8983. gTable.Columns.Add("GroutingMouldCode");
  8984. gTable.Columns.Add("RecordRemarks");
  8985. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8986. gTable.Columns.Add("MouldID", typeof(int));
  8987. gTable.Columns.Add("MouldCode");
  8988. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8989. string groutingLineCode = data["GroutingLineCode"] + "";
  8990. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8991. foreach (Dictionary<string, object> item in details)
  8992. {
  8993. int? mouldID = null;
  8994. if (item.ContainsKey("MouldID"))
  8995. {
  8996. mouldID = Convert.ToInt32(item["MouldID"]);
  8997. if (mouldID == 0)
  8998. {
  8999. mouldID = null;
  9000. }
  9001. }
  9002. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9003. item["GLineDetailID"], item["GLineDetailCode"],
  9004. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9005. mouldID, item["MouldCode"]);
  9006. }
  9007. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  9008. if (result > 0)
  9009. {
  9010. actionResult.Status = (int)Constant.PDAResult.Success;
  9011. }
  9012. else
  9013. {
  9014. actionResult.Status = (int)Constant.PDAResult.Fail;
  9015. actionResult.Result = result;
  9016. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9017. return actionResult;
  9018. }
  9019. return actionResult;
  9020. }
  9021. #endregion
  9022. #region 维修
  9023. if (action == "RepairStartGroutingLineDetail")
  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("RecordRemarks");
  9039. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9040. gTable.Columns.Add("MouldID", typeof(int));
  9041. gTable.Columns.Add("MouldCode");
  9042. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9043. string groutingLineCode = data["GroutingLineCode"] + "";
  9044. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9045. foreach (Dictionary<string, object> item in details)
  9046. {
  9047. int? mouldID = null;
  9048. if (item.ContainsKey("MouldID"))
  9049. {
  9050. mouldID = Convert.ToInt32(item["MouldID"]);
  9051. if (mouldID == 0)
  9052. {
  9053. mouldID = null;
  9054. }
  9055. }
  9056. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9057. item["GLineDetailID"], item["GLineDetailCode"],
  9058. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9059. mouldID, item["MouldCode"]);
  9060. }
  9061. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  9062. if (result > 0)
  9063. {
  9064. actionResult.Status = (int)Constant.PDAResult.Success;
  9065. }
  9066. else
  9067. {
  9068. actionResult.Status = (int)Constant.PDAResult.Fail;
  9069. actionResult.Result = result;
  9070. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9071. return actionResult;
  9072. }
  9073. return actionResult;
  9074. }
  9075. #endregion
  9076. #region 结束维修
  9077. if (action == "RepairEndGroutingLineDetail")
  9078. {
  9079. if (data == null || !data.ContainsKey("Details"))
  9080. {
  9081. actionResult.Status = (int)Constant.PDAResult.Fail;
  9082. actionResult.Message = "参数错误";
  9083. return actionResult;
  9084. }
  9085. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9086. DataTable gTable = new DataTable();
  9087. gTable.Columns.Add("GroutingLineID", typeof(int));
  9088. gTable.Columns.Add("GroutingLineCode");
  9089. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9090. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9091. gTable.Columns.Add("GroutingMouldCode");
  9092. gTable.Columns.Add("RecordRemarks");
  9093. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9094. gTable.Columns.Add("MouldID", typeof(int));
  9095. gTable.Columns.Add("MouldCode");
  9096. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9097. string groutingLineCode = data["GroutingLineCode"] + "";
  9098. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9099. foreach (Dictionary<string, object> item in details)
  9100. {
  9101. int? mouldID = null;
  9102. if (item.ContainsKey("MouldID"))
  9103. {
  9104. mouldID = Convert.ToInt32(item["MouldID"]);
  9105. if (mouldID == 0)
  9106. {
  9107. mouldID = null;
  9108. }
  9109. }
  9110. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9111. item["GLineDetailID"], item["GLineDetailCode"],
  9112. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9113. mouldID, item["MouldCode"]);
  9114. }
  9115. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  9116. if (result > 0)
  9117. {
  9118. actionResult.Status = (int)Constant.PDAResult.Success;
  9119. }
  9120. else
  9121. {
  9122. actionResult.Status = (int)Constant.PDAResult.Fail;
  9123. actionResult.Result = result;
  9124. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9125. return actionResult;
  9126. }
  9127. return actionResult;
  9128. }
  9129. #endregion
  9130. #region 换模
  9131. if (action == "ChangeGMouldStartGroutingLineDetail")
  9132. {
  9133. if (data == null || !data.ContainsKey("Details"))
  9134. {
  9135. actionResult.Status = (int)Constant.PDAResult.Fail;
  9136. actionResult.Message = "参数错误";
  9137. return actionResult;
  9138. }
  9139. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9140. DataTable gTable = new DataTable();
  9141. gTable.Columns.Add("GroutingLineID", typeof(int));
  9142. gTable.Columns.Add("GroutingLineCode");
  9143. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9144. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9145. gTable.Columns.Add("GroutingMouldCode");
  9146. gTable.Columns.Add("RecordRemarks");
  9147. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9148. gTable.Columns.Add("MouldID", typeof(int));
  9149. gTable.Columns.Add("MouldCode");
  9150. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9151. gTable.Columns.Add("MouldStatus", typeof(int));
  9152. gTable.Columns.Add("ScrapReason", typeof(int));
  9153. gTable.Columns.Add("ScrapResponsibility");
  9154. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9155. string groutingLineCode = data["GroutingLineCode"] + "";
  9156. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9157. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9158. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9159. string scrapResponsibility = data["ScrapRemarks"] + "";
  9160. foreach (Dictionary<string, object> item in details)
  9161. {
  9162. int? mouldID = null;
  9163. if (item.ContainsKey("MouldID"))
  9164. {
  9165. mouldID = Convert.ToInt32(item["MouldID"]);
  9166. if (mouldID == 0)
  9167. {
  9168. mouldID = null;
  9169. }
  9170. }
  9171. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9172. item["GLineDetailID"], item["GLineDetailCode"],
  9173. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9174. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9175. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9176. }
  9177. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  9178. if (result > 0)
  9179. {
  9180. actionResult.Status = (int)Constant.PDAResult.Success;
  9181. }
  9182. else
  9183. {
  9184. actionResult.Status = (int)Constant.PDAResult.Fail;
  9185. actionResult.Result = result;
  9186. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9187. return actionResult;
  9188. }
  9189. return actionResult;
  9190. }
  9191. #endregion
  9192. #region 变产
  9193. if (action == "UpdateLineStartGroutingLineDetail")
  9194. {
  9195. if (data == null || !data.ContainsKey("Details"))
  9196. {
  9197. actionResult.Status = (int)Constant.PDAResult.Fail;
  9198. actionResult.Message = "参数错误";
  9199. return actionResult;
  9200. }
  9201. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9202. DataTable gTable = new DataTable();
  9203. gTable.Columns.Add("GroutingLineID", typeof(int));
  9204. gTable.Columns.Add("GroutingLineCode");
  9205. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9206. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9207. gTable.Columns.Add("GroutingMouldCode");
  9208. gTable.Columns.Add("RecordRemarks");
  9209. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9210. gTable.Columns.Add("MouldID", typeof(int));
  9211. gTable.Columns.Add("MouldCode");
  9212. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9213. gTable.Columns.Add("MouldStatus", typeof(int));
  9214. gTable.Columns.Add("ScrapReason", typeof(int));
  9215. gTable.Columns.Add("ScrapResponsibility");
  9216. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9217. string groutingLineCode = data["GroutingLineCode"] + "";
  9218. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9219. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9220. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9221. string scrapResponsibility = data["ScrapRemarks"] + "";
  9222. foreach (Dictionary<string, object> item in details)
  9223. {
  9224. int? mouldID = null;
  9225. if (item.ContainsKey("MouldID"))
  9226. {
  9227. mouldID = Convert.ToInt32(item["MouldID"]);
  9228. if (mouldID == 0)
  9229. {
  9230. mouldID = null;
  9231. }
  9232. }
  9233. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9234. item["GLineDetailID"], item["GLineDetailCode"],
  9235. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9236. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9237. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9238. }
  9239. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  9240. if (result > 0)
  9241. {
  9242. actionResult.Status = (int)Constant.PDAResult.Success;
  9243. }
  9244. else
  9245. {
  9246. actionResult.Status = (int)Constant.PDAResult.Fail;
  9247. actionResult.Result = result;
  9248. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9249. return actionResult;
  9250. }
  9251. return actionResult;
  9252. }
  9253. #endregion
  9254. #region 整线变产
  9255. if (action == "UpdateAllLineStartGroutingLineDetail")
  9256. {
  9257. if (data == null || !data.ContainsKey("Details"))
  9258. {
  9259. actionResult.Status = (int)Constant.PDAResult.Fail;
  9260. actionResult.Message = "参数错误";
  9261. return actionResult;
  9262. }
  9263. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9264. DataTable gTable = new DataTable();
  9265. gTable.Columns.Add("GroutingLineID", typeof(int));
  9266. gTable.Columns.Add("GroutingLineCode");
  9267. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9268. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9269. gTable.Columns.Add("GroutingMouldCode");
  9270. gTable.Columns.Add("RecordRemarks");
  9271. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9272. gTable.Columns.Add("MouldID", typeof(int));
  9273. gTable.Columns.Add("MouldCode");
  9274. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9275. gTable.Columns.Add("MouldStatus", typeof(int));
  9276. gTable.Columns.Add("ScrapReason", typeof(int));
  9277. gTable.Columns.Add("ScrapResponsibility");
  9278. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9279. string groutingLineCode = data["GroutingLineCode"] + "";
  9280. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9281. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9282. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9283. string scrapResponsibility = data["ScrapRemarks"] + "";
  9284. foreach (Dictionary<string, object> item in details)
  9285. {
  9286. int? mouldID = null;
  9287. if (item.ContainsKey("MouldID"))
  9288. {
  9289. mouldID = Convert.ToInt32(item["MouldID"]);
  9290. if (mouldID == 0)
  9291. {
  9292. mouldID = null;
  9293. }
  9294. }
  9295. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9296. item["GLineDetailID"], item["GLineDetailCode"],
  9297. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9298. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9299. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9300. }
  9301. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  9302. if (result > 0)
  9303. {
  9304. actionResult.Status = (int)Constant.PDAResult.Success;
  9305. }
  9306. else
  9307. {
  9308. actionResult.Status = (int)Constant.PDAResult.Fail;
  9309. actionResult.Result = result;
  9310. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9311. return actionResult;
  9312. }
  9313. return actionResult;
  9314. }
  9315. #endregion
  9316. #region 卸模
  9317. if (action == "UnloadGroutingLineDetail")
  9318. {
  9319. if (data == null || !data.ContainsKey("Details"))
  9320. {
  9321. actionResult.Status = (int)Constant.PDAResult.Fail;
  9322. actionResult.Message = "参数错误";
  9323. return actionResult;
  9324. }
  9325. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9326. DataTable gTable = new DataTable();
  9327. gTable.Columns.Add("GroutingLineID", typeof(int));
  9328. gTable.Columns.Add("GroutingLineCode");
  9329. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9330. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9331. gTable.Columns.Add("GroutingMouldCode");
  9332. gTable.Columns.Add("RecordRemarks");
  9333. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9334. gTable.Columns.Add("MouldID", typeof(int));
  9335. gTable.Columns.Add("MouldCode");
  9336. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9337. gTable.Columns.Add("MouldStatus", typeof(int));
  9338. gTable.Columns.Add("ScrapReason", typeof(int));
  9339. gTable.Columns.Add("ScrapResponsibility");
  9340. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9341. string groutingLineCode = data["GroutingLineCode"] + "";
  9342. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9343. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9344. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9345. string scrapResponsibility = data["ScrapRemarks"] + "";
  9346. foreach (Dictionary<string, object> item in details)
  9347. {
  9348. int? mouldID = null;
  9349. if (item.ContainsKey("MouldID"))
  9350. {
  9351. mouldID = Convert.ToInt32(item["MouldID"]);
  9352. if (mouldID == 0)
  9353. {
  9354. mouldID = null;
  9355. }
  9356. }
  9357. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9358. item["GLineDetailID"], item["GLineDetailCode"],
  9359. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9360. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9361. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9362. }
  9363. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  9364. if (result > 0)
  9365. {
  9366. actionResult.Status = (int)Constant.PDAResult.Success;
  9367. }
  9368. else
  9369. {
  9370. actionResult.Status = (int)Constant.PDAResult.Fail;
  9371. actionResult.Result = result;
  9372. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9373. return actionResult;
  9374. }
  9375. return actionResult;
  9376. }
  9377. #endregion
  9378. #region 结束换模
  9379. if (action == "ChangeGMouldEndGroutingLineDetail")
  9380. {
  9381. if (data == null || !data.ContainsKey("Details"))
  9382. {
  9383. actionResult.Status = (int)Constant.PDAResult.Fail;
  9384. actionResult.Message = "参数错误";
  9385. return actionResult;
  9386. }
  9387. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9388. DataTable gTable = new DataTable();
  9389. gTable.Columns.Add("GroutingLineID", typeof(int));
  9390. gTable.Columns.Add("GroutingLineCode");
  9391. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9392. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9393. gTable.Columns.Add("GroutingMouldCode");
  9394. gTable.Columns.Add("RreasonRemarks");
  9395. gTable.Columns.Add("RecordRemarks");
  9396. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9397. gTable.Columns.Add("MouldID", typeof(int));
  9398. gTable.Columns.Add("MouldCode");
  9399. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9400. gTable.Columns.Add("GoodsID", typeof(int));
  9401. gTable.Columns.Add("GoodsCode");
  9402. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9403. gTable.Columns.Add("GroutingCount", typeof(int));
  9404. gTable.Columns.Add("MouldSource");
  9405. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9406. string groutingLineCode = data["GroutingLineCode"] + "";
  9407. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9408. foreach (Dictionary<string, object> item in details)
  9409. {
  9410. int? mouldID = null;
  9411. if (item.ContainsKey("MouldID"))
  9412. {
  9413. mouldID = Convert.ToInt32(item["MouldID"]);
  9414. if (mouldID == 0)
  9415. {
  9416. mouldID = null;
  9417. }
  9418. }
  9419. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9420. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9421. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9422. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9423. item["GoodsID"], item["GoodsCode"],
  9424. item["StandardGroutingCount"], item["GroutingCount"],
  9425. (mouldID == null ? "0" : "1"));
  9426. }
  9427. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  9428. if (result.Status == Constant.ServiceResultStatus.Success)
  9429. {
  9430. actionResult.Status = (int)Constant.PDAResult.Success;
  9431. }
  9432. else if (result.OtherStatus == -100)
  9433. {
  9434. actionResult.Status = (int)Constant.PDAResult.Fail;
  9435. actionResult.Result = -100;
  9436. actionResult.Message = result.Message;
  9437. return actionResult;
  9438. }
  9439. else
  9440. {
  9441. actionResult.Status = (int)Constant.PDAResult.Fail;
  9442. actionResult.Result = -500;
  9443. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9444. return actionResult;
  9445. }
  9446. return actionResult;
  9447. }
  9448. #endregion
  9449. #region 结束变产
  9450. if (action == "UpdateLineEndGroutingLineDetail")
  9451. {
  9452. if (data == null || !data.ContainsKey("Details"))
  9453. {
  9454. actionResult.Status = (int)Constant.PDAResult.Fail;
  9455. actionResult.Message = "参数错误";
  9456. return actionResult;
  9457. }
  9458. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9459. DataTable gTable = new DataTable();
  9460. gTable.Columns.Add("GroutingLineID", typeof(int));
  9461. gTable.Columns.Add("GroutingLineCode");
  9462. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9463. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9464. gTable.Columns.Add("GroutingMouldCode");
  9465. gTable.Columns.Add("RreasonRemarks");
  9466. gTable.Columns.Add("RecordRemarks");
  9467. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9468. gTable.Columns.Add("MouldID", typeof(int));
  9469. gTable.Columns.Add("MouldCode");
  9470. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9471. gTable.Columns.Add("GoodsID", typeof(int));
  9472. gTable.Columns.Add("GoodsCode");
  9473. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9474. gTable.Columns.Add("GroutingCount", typeof(int));
  9475. gTable.Columns.Add("MouldSource");
  9476. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9477. string groutingLineCode = data["GroutingLineCode"] + "";
  9478. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9479. foreach (Dictionary<string, object> item in details)
  9480. {
  9481. int? mouldID = null;
  9482. if (item.ContainsKey("MouldID"))
  9483. {
  9484. mouldID = Convert.ToInt32(item["MouldID"]);
  9485. if (mouldID == 0)
  9486. {
  9487. mouldID = null;
  9488. }
  9489. }
  9490. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9491. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9492. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9493. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9494. item["GoodsID"], item["GoodsCode"],
  9495. item["StandardGroutingCount"], item["GroutingCount"],
  9496. (mouldID == null ? "0" : "1"));
  9497. }
  9498. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  9499. if (result.Status == Constant.ServiceResultStatus.Success)
  9500. {
  9501. actionResult.Status = (int)Constant.PDAResult.Success;
  9502. }
  9503. else if (result.OtherStatus == -100)
  9504. {
  9505. actionResult.Status = (int)Constant.PDAResult.Fail;
  9506. actionResult.Result = -100;
  9507. actionResult.Message = result.Message;
  9508. return actionResult;
  9509. }
  9510. else
  9511. {
  9512. actionResult.Status = (int)Constant.PDAResult.Fail;
  9513. actionResult.Result = -500;
  9514. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9515. return actionResult;
  9516. }
  9517. return actionResult;
  9518. }
  9519. #endregion
  9520. #region 结束整线变产
  9521. if (action == "UpdateAllLineEndGroutingLineDetail")
  9522. {
  9523. if (data == null || !data.ContainsKey("Details"))
  9524. {
  9525. actionResult.Status = (int)Constant.PDAResult.Fail;
  9526. actionResult.Message = "参数错误";
  9527. return actionResult;
  9528. }
  9529. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9530. DataTable gTable = new DataTable();
  9531. gTable.Columns.Add("GroutingLineID", typeof(int));
  9532. gTable.Columns.Add("GroutingLineCode");
  9533. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9534. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9535. gTable.Columns.Add("GroutingMouldCode");
  9536. gTable.Columns.Add("Remarks");
  9537. gTable.Columns.Add("RecordRemarks");
  9538. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9539. gTable.Columns.Add("MouldID", typeof(int));
  9540. gTable.Columns.Add("MouldCode");
  9541. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9542. gTable.Columns.Add("GoodsID", typeof(int));
  9543. gTable.Columns.Add("GoodsCode");
  9544. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9545. gTable.Columns.Add("GroutingCount", typeof(int));
  9546. gTable.Columns.Add("MouldSource");
  9547. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9548. string groutingLineCode = data["GroutingLineCode"] + "";
  9549. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9550. foreach (Dictionary<string, object> item in details)
  9551. {
  9552. int? mouldID = null;
  9553. if (item.ContainsKey("MouldID"))
  9554. {
  9555. mouldID = Convert.ToInt32(item["MouldID"]);
  9556. if (mouldID == 0)
  9557. {
  9558. mouldID = null;
  9559. }
  9560. }
  9561. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9562. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9563. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  9564. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9565. item["GoodsID"], item["GoodsCode"],
  9566. item["StandardGroutingCount"], item["GroutingCount"],
  9567. (mouldID == null ? "0" : "1"));
  9568. }
  9569. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  9570. if (result.Status == Constant.ServiceResultStatus.Success)
  9571. {
  9572. actionResult.Status = (int)Constant.PDAResult.Success;
  9573. }
  9574. else if (result.OtherStatus == -100)
  9575. {
  9576. actionResult.Status = (int)Constant.PDAResult.Fail;
  9577. actionResult.Result = -100;
  9578. actionResult.Message = result.Message;
  9579. return actionResult;
  9580. }
  9581. else
  9582. {
  9583. actionResult.Status = (int)Constant.PDAResult.Fail;
  9584. actionResult.Result = -500;
  9585. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9586. return actionResult;
  9587. }
  9588. return actionResult;
  9589. }
  9590. #endregion
  9591. #region 上模
  9592. if (action == "UpdateGroutingLine_AddMould")
  9593. {
  9594. if (data == null || !data.ContainsKey("Details"))
  9595. {
  9596. actionResult.Status = (int)Constant.PDAResult.Fail;
  9597. actionResult.Message = "参数错误";
  9598. return actionResult;
  9599. }
  9600. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9601. DataTable gTable = new DataTable();
  9602. gTable.Columns.Add("GroutingLineID", typeof(int));
  9603. gTable.Columns.Add("GroutingLineCode");
  9604. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9605. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9606. gTable.Columns.Add("GroutingMouldCode");
  9607. gTable.Columns.Add("Remarks");
  9608. gTable.Columns.Add("RecordRemarks");
  9609. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9610. gTable.Columns.Add("MouldID", typeof(int));
  9611. gTable.Columns.Add("MouldCode");
  9612. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9613. gTable.Columns.Add("GoodsID", typeof(int));
  9614. gTable.Columns.Add("GoodsCode");
  9615. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9616. gTable.Columns.Add("GroutingCount", typeof(int));
  9617. gTable.Columns.Add("MouldSource");
  9618. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9619. string groutingLineCode = data["GroutingLineCode"] + "";
  9620. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9621. foreach (Dictionary<string, object> item in details)
  9622. {
  9623. int? mouldID = null;
  9624. if (item.ContainsKey("MouldID"))
  9625. {
  9626. mouldID = Convert.ToInt32(item["MouldID"]);
  9627. if (mouldID == 0)
  9628. {
  9629. mouldID = null;
  9630. }
  9631. }
  9632. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  9633. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9634. gldID, item["GLineDetailCode"],
  9635. item["DetailRemarks"], item["RecordRemarks"],
  9636. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  9637. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9638. item["GoodsID"], item["GoodsCode"],
  9639. item["StandardGroutingCount"], item["GroutingCount"],
  9640. (mouldID == null ? "0" : "1"));
  9641. }
  9642. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  9643. if (result.Status == Constant.ServiceResultStatus.Success)
  9644. {
  9645. actionResult.Status = (int)Constant.PDAResult.Success;
  9646. }
  9647. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  9648. {
  9649. actionResult.Status = (int)Constant.PDAResult.Fail;
  9650. actionResult.Result = result.OtherStatus;
  9651. actionResult.Message = result.Message;
  9652. return actionResult;
  9653. }
  9654. else if (result.OtherStatus == -10001 || result.OtherStatus == -10002)
  9655. {
  9656. actionResult.Status = -99;
  9657. actionResult.Result = result.OtherStatus;
  9658. actionResult.Message = result.Message;
  9659. return actionResult;
  9660. }
  9661. else
  9662. {
  9663. actionResult.Status = (int)Constant.PDAResult.Fail;
  9664. actionResult.Result = -500;
  9665. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9666. return actionResult;
  9667. }
  9668. return actionResult;
  9669. }
  9670. #endregion
  9671. return actionResult;
  9672. }
  9673. #endregion
  9674. #region 包装装板限制
  9675. if (module == "FinishedLoadingCar")
  9676. {
  9677. if (action == "GetSetting")
  9678. {
  9679. ClientRequestEntity cre = new ClientRequestEntity();
  9680. cre.Properties["GoodsID"] = data["GoodsID"];
  9681. if (data.ContainsKey("logoID"))
  9682. {
  9683. cre.Properties["logoID"] = data["logoID"] + "";
  9684. }
  9685. else
  9686. {
  9687. cre.Properties["logoID"] = "";
  9688. }
  9689. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9690. if (sre.Status == Constant.ServiceResultStatus.Success)
  9691. {
  9692. actionResult.Status = (int)Constant.PDAResult.Success;
  9693. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9694. {
  9695. if (item["settingcode"].ToString() == "S_PM_011")
  9696. {
  9697. cre.Properties["S_PM_011"] = item["settingvalue"];
  9698. }
  9699. else if (item["settingcode"].ToString() == "S_PM_012")
  9700. {
  9701. cre.Properties["S_PM_012"] = item["settingvalue"];
  9702. }
  9703. else if (item["settingcode"].ToString() == "S_PM_013")
  9704. {
  9705. cre.Properties["S_PM_013"] = item["settingvalue"];
  9706. }
  9707. }
  9708. DataTable dt = sre.Result as DataTable;
  9709. cre.Properties["PlatelitNum"] = dt.Rows[0]["PLATELIMITNUM"];
  9710. cre.Properties["PlatelitNumNew"] = dt.Rows[0]["PLATELIMITNUMNEW"];
  9711. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9712. }
  9713. else
  9714. {
  9715. actionResult.Status = (int)Constant.PDAResult.Fail;
  9716. actionResult.Message = "";
  9717. }
  9718. return actionResult;
  9719. }
  9720. }
  9721. #endregion
  9722. #region 成型报损
  9723. if (module == "GroutingScrapProduct")
  9724. {
  9725. // 查询注浆日报明细表
  9726. if ("GetGroutingDailyDetail" == action)
  9727. {
  9728. ClientRequestEntity cre = new ClientRequestEntity();
  9729. cre.NameSpace = module;
  9730. cre.Name = action;
  9731. if (!string.IsNullOrEmpty(jsonData))
  9732. {
  9733. cre.Properties["BarCode"] = data["BarCode"];
  9734. }
  9735. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9736. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9737. actionResult.Status = (int)Constant.PDAResult.Success;
  9738. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9739. || sre.Data.Tables[0].Rows.Count == 0)
  9740. {
  9741. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9742. actionResult.Status = (int)Constant.PDAResult.Fail;
  9743. }
  9744. else
  9745. {
  9746. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9747. // 判断是否进行了注浆
  9748. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9749. {
  9750. actionResult.Message = "该产品还未进行注浆!";
  9751. actionResult.Status = (int)Constant.PDAResult.Fail;
  9752. }
  9753. // 判断是否进行了交坯
  9754. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9755. {
  9756. actionResult.Message = "该产品已经交坯!";
  9757. actionResult.Status = (int)Constant.PDAResult.Fail;
  9758. }
  9759. // 判断是否已经报损
  9760. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9761. {
  9762. actionResult.Message = "该产品已经报损!";
  9763. actionResult.Status = (int)Constant.PDAResult.Fail;
  9764. }
  9765. // 该产品已进入生产工序
  9766. if ("1".Equals(_barCodeRow["beginningflag"]))
  9767. {
  9768. actionResult.Message = "该产品已进入生产工序!";
  9769. actionResult.Status = (int)Constant.PDAResult.Fail;
  9770. }
  9771. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9772. }
  9773. }
  9774. // 获取成型报损原因
  9775. else if ("GetScrapReasonData" == action)
  9776. {
  9777. ClientRequestEntity cre = new ClientRequestEntity();
  9778. cre.NameSpace = module;
  9779. cre.Name = action;
  9780. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo, "1");
  9781. actionResult.Status = (int)Constant.PDAResult.Success;
  9782. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9783. }
  9784. // 保存成型报损
  9785. else if ("SaveGroutingScrapProduct" == action)
  9786. {
  9787. ClientRequestEntity cre = new ClientRequestEntity();
  9788. cre.NameSpace = module;
  9789. cre.Name = action;
  9790. if (!string.IsNullOrEmpty(jsonData))
  9791. {
  9792. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9793. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9794. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9795. if (dt != null && dt.Rows.Count > 0)
  9796. {
  9797. // 总单信息
  9798. DataRow properties = dt.Rows[0];
  9799. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9800. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9801. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9802. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9803. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9804. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9805. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9806. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9807. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9808. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9809. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9810. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9811. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9812. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9813. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9814. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9815. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9816. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9817. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9818. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9819. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9820. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9821. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9822. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9823. // 责任员工
  9824. cre.Data = new DataSet();
  9825. //DataTable returnTable = returnData.Tables[1].Copy();
  9826. cre.Data.Tables.Add(dtResponsible);
  9827. }
  9828. }
  9829. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9830. if (sre.Status == Constant.ServiceResultStatus.Success)
  9831. {
  9832. actionResult.Status = (int)Constant.PDAResult.Success;
  9833. actionResult.Result = sre.Result;
  9834. }
  9835. else
  9836. {
  9837. actionResult.Status = (int)Constant.PDAResult.Fail;
  9838. actionResult.Result = sre.OtherStatus;
  9839. actionResult.Message = sre.Message;
  9840. }
  9841. }
  9842. // 获取成型报损信息 用于撤销使用
  9843. else if ("GetGroutingScrapProduct" == action)
  9844. {
  9845. ClientRequestEntity cre = new ClientRequestEntity();
  9846. cre.NameSpace = module;
  9847. cre.Name = action;
  9848. if (!string.IsNullOrEmpty(jsonData))
  9849. {
  9850. cre.Properties["BarCode"] = data["BarCode"];
  9851. }
  9852. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9853. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9854. actionResult.Status = (int)Constant.PDAResult.Success;
  9855. }
  9856. //xuwei add 2020-03-23
  9857. //获取成型报损信息 用于撤销使用 支持 浆日报直接报损
  9858. else if ("GetGroutingScrap" == action)
  9859. {
  9860. ClientRequestEntity cre = new ClientRequestEntity();
  9861. cre.NameSpace = module;
  9862. cre.Name = action;
  9863. if (!string.IsNullOrEmpty(jsonData))
  9864. {
  9865. cre.Properties["BarCode"] = data["BarCode"];
  9866. }
  9867. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrap(cre, sUserInfo);
  9868. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9869. actionResult.Status = (int)Constant.PDAResult.Success;
  9870. }
  9871. // 撤销成型报损
  9872. else if ("ReverseGroutingScrapProduct" == action)
  9873. {
  9874. ClientRequestEntity cre = new ClientRequestEntity();
  9875. cre.NameSpace = module;
  9876. cre.Name = action;
  9877. if (!string.IsNullOrEmpty(jsonData))
  9878. {
  9879. cre.Properties["BarCode"] = data["BarCode"];
  9880. }
  9881. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9882. if (sre.Status == Constant.ServiceResultStatus.Success)
  9883. {
  9884. actionResult.Status = (int)Constant.PDAResult.Success;
  9885. actionResult.Result = sre.Result;
  9886. }
  9887. else
  9888. {
  9889. actionResult.Status = (int)Constant.PDAResult.Fail;
  9890. actionResult.Result = sre.OtherStatus;
  9891. actionResult.Message = sre.Message;
  9892. }
  9893. }
  9894. }
  9895. #endregion
  9896. #region 产品挂起
  9897. if (module == "ProductSuspend")
  9898. {
  9899. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9900. if (action == "GetSuspendProcedure")
  9901. {
  9902. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9903. if (sre.Status == Constant.ServiceResultStatus.Success)
  9904. {
  9905. actionResult.Status = (int)Constant.PDAResult.Success;
  9906. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9907. }
  9908. else
  9909. {
  9910. actionResult.Status = (int)Constant.PDAResult.Fail;
  9911. actionResult.Message = sre.Message;
  9912. }
  9913. return actionResult;
  9914. }
  9915. // 验证挂起条码
  9916. if (action == "CheckSuspendBarcode")
  9917. {
  9918. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9919. if (sre.Status == Constant.ServiceResultStatus.Success)
  9920. {
  9921. actionResult.Status = (int)Constant.PDAResult.Success;
  9922. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9923. }
  9924. else
  9925. {
  9926. actionResult.Status = (int)Constant.PDAResult.Fail;
  9927. actionResult.Message = sre.Message;
  9928. }
  9929. return actionResult;
  9930. }
  9931. // 挂起条码
  9932. if (action == "SaveSuspendProduct")
  9933. {
  9934. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9935. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9936. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9937. if (sre.Status == Constant.ServiceResultStatus.Success)
  9938. {
  9939. actionResult.Status = (int)Constant.PDAResult.Success;
  9940. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9941. }
  9942. else
  9943. {
  9944. actionResult.Status = (int)Constant.PDAResult.Fail;
  9945. actionResult.Message = sre.Message;
  9946. }
  9947. return actionResult;
  9948. }
  9949. // 撤销挂起条码
  9950. if (action == "DeleteSuspendProduct")
  9951. {
  9952. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9953. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9954. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9955. if (sre.Status == Constant.ServiceResultStatus.Success)
  9956. {
  9957. actionResult.Status = (int)Constant.PDAResult.Success;
  9958. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9959. }
  9960. else
  9961. {
  9962. actionResult.Status = (int)Constant.PDAResult.Fail;
  9963. actionResult.Message = sre.Message;
  9964. }
  9965. return actionResult;
  9966. }
  9967. // 查询挂起条码
  9968. if (action == "GetSuspendProduct")
  9969. {
  9970. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9971. if (sre.Status == Constant.ServiceResultStatus.Success)
  9972. {
  9973. if (sre.Data.Tables[0].Rows.Count == 0)
  9974. {
  9975. actionResult.Status = (int)Constant.PDAResult.Fail;
  9976. actionResult.Message = "此条码没有可撤销的挂起信息";
  9977. }
  9978. else
  9979. {
  9980. actionResult.Status = (int)Constant.PDAResult.Success;
  9981. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9982. }
  9983. }
  9984. else
  9985. {
  9986. actionResult.Status = (int)Constant.PDAResult.Fail;
  9987. actionResult.Message = sre.Message;
  9988. }
  9989. return actionResult;
  9990. }
  9991. }
  9992. #endregion
  9993. #region 品保抽查
  9994. if (module == "QASpotCheck")
  9995. {
  9996. if (action == "GetAllQASpotCheck")
  9997. {
  9998. ClientRequestEntity cre = new ClientRequestEntity();
  9999. cre.NameSpace = module;
  10000. cre.Name = action;
  10001. if (data != null && data.Count > 0)
  10002. {
  10003. foreach (string item in data.Keys)
  10004. {
  10005. if (item.StartsWith("checktime"))
  10006. {
  10007. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  10008. }
  10009. else
  10010. {
  10011. cre.Properties.Add(item, data[item]);
  10012. }
  10013. }
  10014. }
  10015. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  10016. if (sre.Status == Constant.ServiceResultStatus.Success)
  10017. {
  10018. actionResult.Status = (int)Constant.PDAResult.Success;
  10019. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  10020. }
  10021. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  10022. {
  10023. actionResult.Status = (int)Constant.PDAResult.Success;
  10024. }
  10025. else
  10026. {
  10027. actionResult.Status = (int)Constant.PDAResult.Fail;
  10028. actionResult.Message = sre.Message;
  10029. }
  10030. return actionResult;
  10031. }
  10032. if (action == "AutoSaveQASpotCheck")
  10033. {
  10034. string barcode = data["barcode"] + "";
  10035. string remarks = data["remarks"] + "";
  10036. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  10037. if (sre.Status == Constant.ServiceResultStatus.Success)
  10038. {
  10039. actionResult.Status = (int)Constant.PDAResult.Success;
  10040. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  10041. }
  10042. else
  10043. {
  10044. actionResult.Status = (int)Constant.PDAResult.Fail;
  10045. actionResult.Message = sre.Message;
  10046. }
  10047. return actionResult;
  10048. }
  10049. if (action == "CheckQASpotCheck")
  10050. {
  10051. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  10052. if (sre.Status == Constant.ServiceResultStatus.Success)
  10053. {
  10054. actionResult.Status = (int)Constant.PDAResult.Success;
  10055. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  10056. }
  10057. else
  10058. {
  10059. actionResult.Status = (int)Constant.PDAResult.Fail;
  10060. actionResult.Message = sre.Message;
  10061. }
  10062. return actionResult;
  10063. }
  10064. if (action == "SaveQASpotCheck")
  10065. {
  10066. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  10067. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  10068. if (sre.Status == Constant.ServiceResultStatus.Success)
  10069. {
  10070. actionResult.Status = (int)Constant.PDAResult.Success;
  10071. }
  10072. else
  10073. {
  10074. actionResult.Status = (int)Constant.PDAResult.Fail;
  10075. actionResult.Message = sre.Message;
  10076. }
  10077. return actionResult;
  10078. }
  10079. return null;
  10080. }
  10081. #endregion
  10082. #region 产成品交接
  10083. if (module == "FinishedProduct")
  10084. {
  10085. #region 产成品交接、整板撤销 by fubin 20200824
  10086. // 交接验证
  10087. if (action == "FinishedHandoverBarcode")
  10088. {
  10089. string barcode = data["Barcode"] + "";
  10090. ServiceResultEntity sre = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo);
  10091. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10092. {
  10093. actionResult.Status = (int)Constant.PDAResult.Success;
  10094. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10095. actionResult.Message = sre.Message;
  10096. }
  10097. else
  10098. {
  10099. actionResult.Status = (int)Constant.PDAResult.Fail;
  10100. actionResult.Message = sre.Message;
  10101. }
  10102. return actionResult;
  10103. }
  10104. // 交接操作
  10105. if (action == "SaveFinishedHandover")
  10106. {
  10107. int orderID = Convert.ToInt32(data["OrderID"]);
  10108. //暂存标识 add by qq 20251031、
  10109. int temporarilyFlag = 0;
  10110. if (data.ContainsKey("TemporarilyFlag"))
  10111. {
  10112. temporarilyFlag = Convert.ToInt32(data["TemporarilyFlag"]);
  10113. }
  10114. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  10115. //切换sap地址 by fy 2022年7月5日09:15:23 开始
  10116. //ServiceResultEntity sre = PMModuleLogicDAL.SaveFinishedHandover(orderID, dt, sUserInfo);
  10117. string sapName = "";
  10118. if (data.ContainsKey("SPANAME") && data["SPANAME"] is object &&
  10119. (data["SPANAME"].Equals("APP1") || data["SPANAME"].Equals("APP2") || data["SPANAME"].Equals("APP3")))
  10120. {
  10121. sapName = "_" + data["SPANAME"].ToString();
  10122. }
  10123. else
  10124. {
  10125. sapName = "";
  10126. }
  10127. //ServiceResultEntity sre = PMModuleLogicDAL.SaveFinishedHandover(orderID, dt, sUserInfo, sapName);
  10128. //暂存标识 为1时,不同步sap等操作
  10129. ServiceResultEntity sre = new ServiceResultEntity();
  10130. if (temporarilyFlag == 1)
  10131. {
  10132. sre = PMModuleLogicDAL.SaveFinishedHandoverNoSAP(orderID, dt, sUserInfo, sapName);
  10133. }
  10134. else
  10135. {
  10136. sre = PMModuleLogicDAL.SaveFinishedHandover(orderID, dt, sUserInfo, sapName);
  10137. }
  10138. //结束
  10139. if (Convert.ToInt32(sre.Result) > 0)
  10140. {
  10141. actionResult.Status = (int)Constant.PDAResult.Success;
  10142. actionResult.Message = "产成品交接成功";
  10143. }
  10144. else
  10145. {
  10146. actionResult.Status = (int)Constant.PDAResult.Fail;
  10147. actionResult.Message = sre.Message;
  10148. }
  10149. return actionResult;
  10150. }
  10151. // 撤销交接验证
  10152. if (action == "BackFinishedHandoverCheck")
  10153. {
  10154. string barcode = data["Barcode"] + "";
  10155. ServiceResultEntity sre = PMModuleLogic.BackFinishedHandoverCheck(barcode, sUserInfo);
  10156. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10157. {
  10158. actionResult.Status = (int)Constant.PDAResult.Success;
  10159. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10160. actionResult.Message = sre.Message;
  10161. }
  10162. else
  10163. {
  10164. actionResult.Status = (int)Constant.PDAResult.Fail;
  10165. actionResult.Message = sre.Message;
  10166. }
  10167. return actionResult;
  10168. }
  10169. // 撤销交接操作
  10170. if (action == "BackFinishedHandover")
  10171. {
  10172. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  10173. //暂存标识 add by qq 20251031 撤销的是暂存数据
  10174. int temporarilyFlag = 0;
  10175. if (data.ContainsKey("TemporarilyFlag"))
  10176. {
  10177. temporarilyFlag = Convert.ToInt32(data["TemporarilyFlag"]);
  10178. }
  10179. //暂存标识 为1时,不撤销同步sap等操作
  10180. ServiceResultEntity sre = new ServiceResultEntity();
  10181. if (temporarilyFlag == 1)
  10182. {
  10183. sre = PMModuleLogicDAL.BackFinishedHandoverNoSAP(dt, sUserInfo);
  10184. }
  10185. else
  10186. {
  10187. sre = PMModuleLogicDAL.BackFinishedHandover(dt, sUserInfo);
  10188. }
  10189. //ServiceResultEntity sre = PMModuleLogicDAL.BackFinishedHandover(dt, sUserInfo);
  10190. if (Convert.ToInt32(sre.Result) > 0)
  10191. {
  10192. actionResult.Status = (int)Constant.PDAResult.Success;
  10193. actionResult.Message = "产成品撤销交接成功";
  10194. }
  10195. else
  10196. {
  10197. actionResult.Status = (int)Constant.PDAResult.Fail;
  10198. actionResult.Message = sre.Message;
  10199. }
  10200. return actionResult;
  10201. }
  10202. #endregion
  10203. #region 暂存产品再次交接
  10204. //交接验证
  10205. if (action == "FinishedHandoverBarcodeAgain")
  10206. {
  10207. string barcode = data["Barcode"] + "";
  10208. ServiceResultEntity sre = PMModuleLogic.FinishedHandoverBarcodeAgain(barcode, sUserInfo);
  10209. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10210. {
  10211. actionResult.Status = (int)Constant.PDAResult.Success;
  10212. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10213. actionResult.Message = sre.Message;
  10214. }
  10215. else
  10216. {
  10217. actionResult.Status = (int)Constant.PDAResult.Fail;
  10218. actionResult.Message = sre.Message;
  10219. }
  10220. return actionResult;
  10221. }
  10222. //保存
  10223. if (action == "SaveFinishedHandoverAgain")
  10224. {
  10225. int orderID = Convert.ToInt32(data["OrderID"]);
  10226. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  10227. ServiceResultEntity sre = PMModuleLogicDAL.SaveFinishedHandoverAgain(orderID, dt, sUserInfo);
  10228. //结束
  10229. if (Convert.ToInt32(sre.Result) > 0)
  10230. {
  10231. actionResult.Status = (int)Constant.PDAResult.Success;
  10232. actionResult.Message = "产成品交接成功";
  10233. }
  10234. else
  10235. {
  10236. actionResult.Status = (int)Constant.PDAResult.Fail;
  10237. actionResult.Message = sre.Message;
  10238. }
  10239. return actionResult;
  10240. }
  10241. #endregion
  10242. // 设定商标
  10243. if (action == "GetFinishedBarcode")
  10244. {
  10245. string barcode = data["barcode"].ToString();
  10246. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  10247. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10248. if (Convert.ToInt32(resultEntity.Result) < 0)
  10249. {
  10250. actionResult.Status = (int)Constant.PDAResult.Fail;
  10251. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  10252. actionResult.Message = resultEntity.Message;
  10253. }
  10254. else
  10255. {
  10256. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10257. actionResult.Status = (int)Constant.PDAResult.Success;
  10258. actionResult.Message = resultEntity.Message;
  10259. }
  10260. return actionResult;
  10261. }
  10262. if (action == "GetHandoveredBarcode")
  10263. {
  10264. string barcode = data["barcode"].ToString();
  10265. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  10266. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10267. if (Convert.ToInt32(resultEntity.Result) < 0)
  10268. {
  10269. actionResult.Status = (int)Constant.PDAResult.Fail;
  10270. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  10271. actionResult.Message = resultEntity.Message;
  10272. }
  10273. else
  10274. {
  10275. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10276. actionResult.Status = (int)Constant.PDAResult.Success;
  10277. actionResult.Message = resultEntity.Message;
  10278. }
  10279. return actionResult;
  10280. }
  10281. if (action == "SetFinishedLogo")
  10282. {
  10283. int logoid = Convert.ToInt32(data["logoid"]);
  10284. string[] barcodes = data["barcodes"].ToString().Split(',');
  10285. string returnMessage = "";
  10286. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo, out returnMessage);
  10287. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10288. if (result < 0)
  10289. {
  10290. actionResult.Status = (int)Constant.PDAResult.Fail;
  10291. actionResult.Message = returnMessage;
  10292. }
  10293. else
  10294. {
  10295. actionResult.Status = (int)Constant.PDAResult.Success;
  10296. }
  10297. return actionResult;
  10298. }
  10299. if (action == "SetHandoveredOrder")
  10300. {
  10301. int orderID = Convert.ToInt32(data["orderID"]);
  10302. string[] barcodes = data["barcodes"].ToString().Split(',');
  10303. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  10304. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10305. if (result < 0)
  10306. {
  10307. actionResult.Status = (int)Constant.PDAResult.Fail;
  10308. }
  10309. else
  10310. {
  10311. actionResult.Status = (int)Constant.PDAResult.Success;
  10312. }
  10313. return actionResult;
  10314. }
  10315. }
  10316. #endregion
  10317. #region 产成品装车
  10318. if (module == "SendOutGoods")
  10319. {
  10320. if (action == "GetSendOutGoodsLogs")
  10321. {
  10322. string Lgort = data["Lgort"].ToString();
  10323. string sendoutgoodslogid = data.ContainsKey("sendoutgoodslogid")&& data["sendoutgoodslogid"]!=null? data["sendoutgoodslogid"].ToString() : "";
  10324. var result = PMModuleLogicDAL.GetSendOutGoodsLogs(Lgort, sendoutgoodslogid, sUserInfo);
  10325. actionResult.Result = JsonHelper.ToJson(result);
  10326. actionResult.Status = (int)Constant.PDAResult.Success;
  10327. return actionResult;
  10328. }
  10329. if (action == "CheckSendOutBarcode")
  10330. {
  10331. var result = PMModuleLogic.CHeckFinishOutlabelCode(data["banma"].ToString(), sUserInfo);
  10332. actionResult.Result = JsonHelper.ToJson(result.Result);
  10333. actionResult.Status = (int)result.Status;
  10334. actionResult.Message = result.Message;
  10335. return actionResult;
  10336. }
  10337. if (action == "SaveSendOutGoods")
  10338. {
  10339. SendOutGoodsEntity send = JsonHelper.FromJson<SendOutGoodsEntity>(data.ElementAt(0).Value.ToString());
  10340. var sendDetail = JsonHelper.FromJson<List<SendOutGoodsDetailEntity>>(data.ElementAt(1).Value.ToString());
  10341. var result = PMModuleLogicDAL.SaveSendOutGoodsLogs(send, sendDetail, sUserInfo);
  10342. if (result.OtherStatus < 0)
  10343. {
  10344. actionResult.Status = (int)Constant.PDAResult.Fail;
  10345. actionResult.Message = result.Message;
  10346. }
  10347. else
  10348. {
  10349. actionResult.Status = (int)Constant.PDAResult.Success;
  10350. actionResult.Message = "保存成功; 【凭证单号:" + result.Message + "】" ;
  10351. }
  10352. return actionResult;
  10353. }
  10354. }
  10355. /*
  10356. if (module == "FinishedLoading")
  10357. {
  10358. // 设定商标
  10359. if (action == "GetMaxLoadingNo")
  10360. {
  10361. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  10362. actionResult.Status = (int)Constant.PDAResult.Success;
  10363. actionResult.Result = no;
  10364. return actionResult;
  10365. }
  10366. if (action == "CheckFinishedLaodingBarcode")
  10367. {
  10368. string barcode = data["barcode"].ToString();
  10369. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  10370. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  10371. {
  10372. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10373. actionResult.Status = (int)Constant.PDAResult.Success;
  10374. actionResult.Message = resultEntity.Message;
  10375. }
  10376. else
  10377. {
  10378. actionResult.Status = (int)Constant.PDAResult.Fail;
  10379. actionResult.Result = resultEntity.OtherStatus;
  10380. actionResult.Message = resultEntity.Message;
  10381. }
  10382. return actionResult;
  10383. }
  10384. if (action == "SaveFinishedLoading")
  10385. {
  10386. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  10387. string carLicense = data["carLicense"] + "";
  10388. int palletNum = Convert.ToInt32(data["palletNum"]);
  10389. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  10390. string remarks = data["remarks"] + "";
  10391. Dictionary<string, object>[] details =
  10392. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  10393. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  10394. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  10395. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  10396. if (result.Status == Constant.ServiceResultStatus.Success)
  10397. {
  10398. actionResult.Status = (int)Constant.PDAResult.Success;
  10399. actionResult.Message = result.Message;
  10400. }
  10401. else
  10402. {
  10403. actionResult.Status = (int)Constant.PDAResult.Fail;
  10404. actionResult.Result = result.OtherStatus;
  10405. actionResult.Message = result.Message;
  10406. }
  10407. return actionResult;
  10408. }
  10409. }
  10410. */
  10411. #endregion
  10412. #region 产成品质量改判
  10413. if (module == "FinishedProductTamper")
  10414. {
  10415. // 获取产成品信息及缺陷数据
  10416. if (action == "GetDefectData")
  10417. {
  10418. string barcode = data["barcode"].ToString();
  10419. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  10420. if (sre.Status == Constant.ServiceResultStatus.Success)
  10421. {
  10422. actionResult.Status = (int)Constant.PDAResult.Success;
  10423. actionResult.Result = JsonHelper.ToJson(sre.Result);
  10424. actionResult.Message = sre.Message;
  10425. }
  10426. else
  10427. {
  10428. actionResult.Status = (int)Constant.PDAResult.Fail;
  10429. actionResult.Result = sre.OtherStatus;
  10430. actionResult.Message = sre.Message;
  10431. }
  10432. return actionResult;
  10433. }
  10434. // 获取产成品信息及缺陷数据
  10435. if (action == "SaveDefectData")
  10436. {
  10437. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  10438. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  10439. if (sre.Status == Constant.ServiceResultStatus.Success)
  10440. {
  10441. actionResult.Status = (int)Constant.PDAResult.Success;
  10442. actionResult.Message = sre.Message;
  10443. }
  10444. else
  10445. {
  10446. actionResult.Status = (int)Constant.PDAResult.Fail;
  10447. actionResult.Message = sre.Message;
  10448. }
  10449. return actionResult;
  10450. }
  10451. // 通过条码查出责任工序(成品改判用)
  10452. if (action == "GetDutyProcedureByBarCodeForTamper")
  10453. {
  10454. string barcode = data["barcode"] + "";
  10455. int defectid = int.Parse(data["defectid"] + "");
  10456. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  10457. if (sre.Status == Constant.ServiceResultStatus.Success)
  10458. {
  10459. actionResult.Status = (int)Constant.PDAResult.Success;
  10460. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10461. actionResult.Message = sre.Message;
  10462. }
  10463. else
  10464. {
  10465. actionResult.Status = (int)Constant.PDAResult.Fail;
  10466. actionResult.Result = sre.OtherStatus;
  10467. actionResult.Message = sre.Message;
  10468. }
  10469. return actionResult;
  10470. }
  10471. }
  10472. #endregion
  10473. #region PDA独立功能
  10474. #region 水效标识
  10475. if (module == "WaterEffect")
  10476. {
  10477. // 获取产成品信息及水效标识
  10478. if (action == "GetGoodsByBarCode")
  10479. {
  10480. string barcode = data["barcode"].ToString();
  10481. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  10482. if (sre.Status == Constant.ServiceResultStatus.Success)
  10483. {
  10484. actionResult.Status = (int)Constant.PDAResult.Success;
  10485. actionResult.Result = JsonHelper.ToJson(sre.Result);
  10486. actionResult.Message = sre.Message;
  10487. }
  10488. else
  10489. {
  10490. actionResult.Status = (int)Constant.PDAResult.Fail;
  10491. actionResult.Result = sre.OtherStatus;
  10492. actionResult.Message = sre.Message;
  10493. }
  10494. return actionResult;
  10495. }
  10496. }
  10497. #endregion
  10498. #region 盖板型号
  10499. if (module == "SeatCoverType")
  10500. {
  10501. // 获取产成品信息及水效标识
  10502. if (action == "SendGoodsCodeToPLC")
  10503. {
  10504. string barcode = data["barcode"].ToString();
  10505. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  10506. if (sre == 0)
  10507. {
  10508. actionResult.Status = (int)Constant.PDAResult.Success;
  10509. }
  10510. else
  10511. {
  10512. actionResult.Status = (int)Constant.PDAResult.Fail;
  10513. actionResult.Result = sre;
  10514. switch (sre)
  10515. {
  10516. case 1:
  10517. case 2:
  10518. actionResult.Message = "无效条码";
  10519. break;
  10520. case 3:
  10521. actionResult.Message = "此产品型号没有设置盖板标识码";
  10522. break;
  10523. case 4:
  10524. actionResult.Message = "当前用户没有设置PLC参数";
  10525. break;
  10526. case 5:
  10527. actionResult.Message = "PLC参数设置不全";
  10528. break;
  10529. default:
  10530. actionResult.Message = "PLC通信异常";
  10531. break;
  10532. }
  10533. }
  10534. return actionResult;
  10535. }
  10536. }
  10537. #endregion
  10538. #region PDA PLC 相关功能
  10539. if (module == "PDA_FUN_PLC")
  10540. {
  10541. // PDA扫码发送到PLCServer
  10542. if (action == "SendBarcodeToPLCServer")
  10543. {
  10544. string barcode = data["barcode"].ToString();
  10545. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  10546. if (sre == 0)
  10547. {
  10548. actionResult.Status = (int)Constant.PDAResult.Success;
  10549. }
  10550. else
  10551. {
  10552. actionResult.Status = (int)Constant.PDAResult.Fail;
  10553. actionResult.Result = sre;
  10554. switch (sre)
  10555. {
  10556. case 1:
  10557. case 2:
  10558. actionResult.Message = "无效条码";
  10559. break;
  10560. case 3:
  10561. actionResult.Message = "PLC通信异常";
  10562. break;
  10563. case 4:
  10564. actionResult.Message = "当前用户没有设置PLC参数";
  10565. break;
  10566. case 5:
  10567. actionResult.Message = "PLC参数设置不全";
  10568. break;
  10569. default:
  10570. actionResult.Message = "PLC通信异常";
  10571. break;
  10572. }
  10573. }
  10574. return actionResult;
  10575. }
  10576. }
  10577. #endregion
  10578. #endregion
  10579. #region 半检返修
  10580. if (module == "SemiRework")
  10581. {
  10582. // 验证半检返修条码
  10583. if (action == "CheckSemiReworkBarcode")
  10584. {
  10585. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10586. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  10587. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10588. if (Convert.ToInt32(resultEntity.Result) < 0)
  10589. {
  10590. actionResult.Status = (int)Constant.PDAResult.Fail;
  10591. }
  10592. else
  10593. {
  10594. actionResult.Status = (int)Constant.PDAResult.Success;
  10595. }
  10596. actionResult.Message = resultEntity.Message;
  10597. return actionResult;
  10598. }
  10599. // 可以返修的工序
  10600. if (action == "GetSemiReworkProcedure")
  10601. {
  10602. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10603. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  10604. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10605. actionResult.Status = (int)Constant.PDAResult.Success;
  10606. return actionResult;
  10607. }
  10608. // 根据条码获取经过的工序,用于责任工序
  10609. if (action == "GetSemiReworkPassProcedure")
  10610. {
  10611. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10612. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  10613. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10614. actionResult.Status = (int)Constant.PDAResult.Success;
  10615. return actionResult;
  10616. }
  10617. // 根据所选生产工序(生产数据ID)查询责任员工
  10618. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  10619. {
  10620. int productionDataID = Convert.ToInt32(jsonData);
  10621. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10622. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  10623. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10624. actionResult.Status = (int)Constant.PDAResult.Success;
  10625. return actionResult;
  10626. }
  10627. // 根据所选工号,查出缺陷责任员工
  10628. if (action == "GetSemiReworkDefectStaffByUserID")
  10629. {
  10630. int userID = Convert.ToInt32(jsonData);
  10631. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10632. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  10633. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10634. actionResult.Status = (int)Constant.PDAResult.Success;
  10635. return actionResult;
  10636. }
  10637. // 新建半检返修
  10638. if (action == "AddSemiRework")
  10639. {
  10640. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10641. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10642. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  10643. actionResult.Result = resultEntity.Result;
  10644. actionResult.Message = resultEntity.Message;
  10645. if (Convert.ToInt32(resultEntity.Result) > 0)
  10646. {
  10647. actionResult.Status = (int)Constant.PDAResult.Success;
  10648. }
  10649. else
  10650. {
  10651. actionResult.Status = (int)Constant.PDAResult.Fail;
  10652. }
  10653. return actionResult;
  10654. }
  10655. // 编辑半检返修
  10656. if (action == "EditSemiRework")
  10657. {
  10658. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10659. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10660. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  10661. actionResult.Result = resultEntity.Result;
  10662. actionResult.Message = resultEntity.Message;
  10663. if (Convert.ToInt32(resultEntity.Result) > 0)
  10664. {
  10665. actionResult.Status = (int)Constant.PDAResult.Success;
  10666. }
  10667. else
  10668. {
  10669. actionResult.Status = (int)Constant.PDAResult.Fail;
  10670. }
  10671. return actionResult;
  10672. }
  10673. // 撤销半检返修
  10674. if (action == "CancelSemiRework")
  10675. {
  10676. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10677. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10678. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  10679. actionResult.Result = resultEntity.Result;
  10680. actionResult.Message = resultEntity.Message;
  10681. if (Convert.ToInt32(resultEntity.Result) > 0)
  10682. {
  10683. actionResult.Status = (int)Constant.PDAResult.Success;
  10684. }
  10685. else
  10686. {
  10687. actionResult.Status = (int)Constant.PDAResult.Fail;
  10688. }
  10689. return actionResult;
  10690. }
  10691. // 获取半检返修数据(PDA编辑用)
  10692. if (action == "GetSemiReworkByID")
  10693. {
  10694. int id = Convert.ToInt32(jsonData);
  10695. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10696. PMModuleLogic.GetSemiReworkByID(id, sUserInfo.UserCode);
  10697. DataTable data1 = resultEntity.Data.Tables[0];
  10698. DataTable data2 = resultEntity.Data.Tables[1];
  10699. DataTable data3 = resultEntity.Data.Tables[2];
  10700. if (data1.Rows.Count == 0)
  10701. {
  10702. actionResult.Status = (int)Constant.PDAResult.Fail;
  10703. actionResult.Message = "半检返修信息不存在";
  10704. return actionResult;
  10705. }
  10706. SemiReworkEntity srEntity = new SemiReworkEntity();
  10707. srEntity.SemiReworkID = id;
  10708. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  10709. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  10710. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  10711. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  10712. foreach (DataRow row2 in data2.Rows)
  10713. {
  10714. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  10715. srEntity.SemiReworkDefects.Add(defectEntity);
  10716. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  10717. defectEntity.SemiReworkID = id;
  10718. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  10719. defectEntity.DefectCode = row2["DefectCode"] + "";
  10720. defectEntity.DefectName = row2["DefectName"] + "";
  10721. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  10722. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  10723. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  10724. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  10725. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  10726. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  10727. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  10728. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  10729. defectEntity.Remarks = row2["Remarks"] + "";
  10730. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  10731. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  10732. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  10733. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  10734. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  10735. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  10736. if (row3s.Length == 0)
  10737. {
  10738. continue;
  10739. }
  10740. foreach (DataRow row3 in row3s)
  10741. {
  10742. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  10743. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  10744. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  10745. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  10746. semiReworkRPS.StaffName = row3["StaffName"] + "";
  10747. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  10748. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  10749. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  10750. semiReworkRPS.UserCode = row3["UserCode"] + "";
  10751. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  10752. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  10753. }
  10754. }
  10755. //xuwei note 总单用于显示,信息较全
  10756. actionResult.Message = JsonHelper.ToJson(data1);
  10757. //xuwei note 总单信息不全,但有明细,用于回传保存
  10758. actionResult.Result = JsonHelper.ToJson(srEntity);
  10759. actionResult.Status = (int)Constant.PDAResult.Success;
  10760. }
  10761. }
  10762. #endregion
  10763. #region 窑车漏扫补件
  10764. if (module == "F_PM_0504")
  10765. {
  10766. // 验证窑车编码是否存在
  10767. if (action == "CheckKilnCar")
  10768. {
  10769. ClientRequestEntity cre = new ClientRequestEntity();
  10770. cre.Properties["kilncarcode"] = data["KilnCarCode"];
  10771. cre.Properties["procedureID"] = data["ProcedureID"];
  10772. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo);
  10773. if (sre.Status == Constant.ServiceResultStatus.Success)
  10774. {
  10775. actionResult.Status = (int)Constant.PDAResult.Success;
  10776. actionResult.Result = sre.Result;
  10777. }
  10778. else
  10779. {
  10780. actionResult.Status = (int)Constant.PDAResult.Fail;
  10781. actionResult.Message = sre.Message;
  10782. }
  10783. return actionResult;
  10784. }
  10785. // 验证窑车烧成批次号是否存在 和 是否能补漏扫
  10786. if (action == "CheckKilnCarBatchNo")
  10787. {
  10788. ClientRequestEntity cre = new ClientRequestEntity();
  10789. cre.Properties["KilnID"] = data["KilnID"];
  10790. cre.Properties["KilnCarID"] = data["KilnCarID"];
  10791. cre.Properties["ProcedureID"] = data["ProcedureID"];
  10792. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10793. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo);
  10794. if (sre.Status == Constant.ServiceResultStatus.Success)
  10795. {
  10796. actionResult.Status = (int)Constant.PDAResult.Success;
  10797. }
  10798. else
  10799. {
  10800. actionResult.Status = (int)Constant.PDAResult.Fail;
  10801. actionResult.Message = sre.Message;
  10802. }
  10803. return actionResult;
  10804. }
  10805. // 窑车漏扫补件
  10806. if (action == "SetKilnCarMissing")
  10807. {
  10808. ClientRequestEntity cre = new ClientRequestEntity();
  10809. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10810. string carData = data["CarData"] + "";
  10811. DataTable dataTable = JsonHelper.FromJson<DataTable>(carData);
  10812. cre.Data = new DataSet();
  10813. cre.Data.Tables.Add(dataTable);
  10814. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo);
  10815. if (sre.Status == Constant.ServiceResultStatus.Success)
  10816. {
  10817. actionResult.Status = (int)Constant.PDAResult.Success;
  10818. }
  10819. else
  10820. {
  10821. actionResult.Status = (int)Constant.PDAResult.Fail;
  10822. actionResult.Message = sre.Message;
  10823. }
  10824. return actionResult;
  10825. }
  10826. }
  10827. #endregion
  10828. #region 梭式窑入窑
  10829. else if (module == "F_PM_0505")
  10830. {
  10831. // 验证窑车编码是否存在
  10832. if (action == "GetAllKilntInfo")
  10833. {
  10834. DataSet dsKilntInfo = SystemModuleLogic.GetAllKilntInfo(sUserInfo);
  10835. if (dsKilntInfo != null && dsKilntInfo.Tables.Count > 0)
  10836. {
  10837. actionResult.Status = (int)Constant.PDAResult.Success;
  10838. actionResult.Result = JsonHelper.ToJson(dsKilntInfo.Tables[0]);
  10839. }
  10840. else
  10841. {
  10842. actionResult.Status = (int)Constant.PDAResult.Fail;
  10843. }
  10844. return actionResult;
  10845. }
  10846. // 保存梭式窑入窑计数
  10847. if (action == "SaveSKBatchNo")
  10848. {
  10849. ClientRequestEntity cre = new ClientRequestEntity();
  10850. cre.Properties["KilnCode"] = data["KilnCode"];
  10851. cre.Properties["Remarks"] = data["Remarks"];
  10852. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SaveSKBatchNo(cre, sUserInfo);
  10853. if (sre.Status == Constant.ServiceResultStatus.Success)
  10854. {
  10855. if (sre.OtherStatus > 0)
  10856. {
  10857. actionResult.Status = (int)Constant.PDAResult.Success;
  10858. }
  10859. else
  10860. {
  10861. actionResult.Status = (int)Constant.PDAResult.Fail;
  10862. actionResult.Message = sre.Message;
  10863. }
  10864. }
  10865. else
  10866. {
  10867. actionResult.Status = (int)Constant.PDAResult.Fail;
  10868. actionResult.Message = sre.Message;
  10869. }
  10870. return actionResult;
  10871. }
  10872. }
  10873. #endregion
  10874. #region 重启3#高压注浆
  10875. else if (module == "F_PM_0107")
  10876. {
  10877. // 查询3#高压注浆线
  10878. if (action == "GetGroutingLine3")
  10879. {
  10880. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.GetGroutingLine3(sUserInfo);
  10881. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10882. {
  10883. actionResult.Status = (int)Constant.PDAResult.Success;
  10884. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  10885. }
  10886. else
  10887. {
  10888. actionResult.Status = (int)Constant.PDAResult.Fail;
  10889. }
  10890. return actionResult;
  10891. }
  10892. // 重置注浆批次
  10893. if (action == "SaveGroutingLine3")
  10894. {
  10895. ClientRequestEntity cre = new ClientRequestEntity();
  10896. cre.Properties["GroutingLineID"] = data["GroutingLineID"];
  10897. cre.Properties["H_BatchNo"] = data["H_BatchNo"];
  10898. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SaveGroutingLine3(cre, sUserInfo);
  10899. if (sre.Status == Constant.ServiceResultStatus.Success)
  10900. {
  10901. if (sre.OtherStatus > 0)
  10902. {
  10903. actionResult.Status = (int)Constant.PDAResult.Success;
  10904. }
  10905. else
  10906. {
  10907. actionResult.Status = (int)Constant.PDAResult.Fail;
  10908. actionResult.Message = sre.Message;
  10909. }
  10910. }
  10911. else
  10912. {
  10913. actionResult.Status = (int)Constant.PDAResult.Fail;
  10914. actionResult.Message = sre.Message;
  10915. }
  10916. return actionResult;
  10917. }
  10918. }
  10919. #endregion
  10920. #region 3#条码打印机(PDA用)
  10921. // 3#配置工位打印机
  10922. else if (module == "01070804")
  10923. {
  10924. // 获取3#条码打印机配置(PDA用)
  10925. if (action == "GetWorkStationPrinter3")
  10926. {
  10927. ServiceResultEntity sre = SystemModuleLogic.GetWorkStationPrinter3(sUserInfo);
  10928. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10929. {
  10930. actionResult.Status = (int)Constant.PDAResult.Success;
  10931. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10932. }
  10933. else
  10934. {
  10935. actionResult.Status = (int)Constant.PDAResult.Fail;
  10936. }
  10937. return actionResult;
  10938. }
  10939. // 保存3#条码打印机配置(PDA用)
  10940. else if (action == "SaveWorkStationPrinter3")
  10941. {
  10942. ClientRequestEntity cre = new ClientRequestEntity();
  10943. cre.Properties["WorkStationID"] = data["WorkStationID"];
  10944. cre.Properties["PrinterID1"] = data["PrinterID1"];
  10945. cre.Properties["PrinterID2"] = data["PrinterID2"];
  10946. cre.Properties["PrinterID3"] = data["PrinterID3"];
  10947. ServiceResultEntity sre = SystemModuleLogic.SaveWorkStationPrinter3(cre, sUserInfo);
  10948. if (sre.Status == Constant.ServiceResultStatus.Success)
  10949. {
  10950. if (sre.OtherStatus > 0)
  10951. {
  10952. actionResult.Status = (int)Constant.PDAResult.Success;
  10953. }
  10954. else
  10955. {
  10956. actionResult.Status = (int)Constant.PDAResult.Fail;
  10957. actionResult.Message = sre.Message;
  10958. }
  10959. }
  10960. else
  10961. {
  10962. actionResult.Status = (int)Constant.PDAResult.Fail;
  10963. actionResult.Message = sre.Message;
  10964. }
  10965. return actionResult;
  10966. }
  10967. }
  10968. // 3#条码打印
  10969. else if (module == "01070805")
  10970. {
  10971. // 获取3#条码打印机配置(PDA用)
  10972. if (action == "GetWorkStationPrinter3")
  10973. {
  10974. ServiceResultEntity sre = SystemModuleLogic.GetWorkStationPrinter3(sUserInfo);
  10975. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10976. {
  10977. actionResult.Status = (int)Constant.PDAResult.Success;
  10978. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10979. }
  10980. else
  10981. {
  10982. actionResult.Status = (int)Constant.PDAResult.Fail;
  10983. }
  10984. return actionResult;
  10985. }
  10986. // 条码打印(PDA用)
  10987. else if (action == "PrintBarcode_3BL")
  10988. {
  10989. ClientRequestEntity cre = new ClientRequestEntity();
  10990. cre.Properties["Barcode"] = data["Barcode"];
  10991. cre.Properties["WorkStationID"] = data["WorkStationID"];
  10992. ServiceResultEntity sre = SystemModuleLogic.PrintBarcode_3BL(cre, sUserInfo);
  10993. if (sre.Status == Constant.ServiceResultStatus.Success)
  10994. {
  10995. if (sre.Result != null)
  10996. {
  10997. actionResult.Status = (int)Constant.PDAResult.Success;
  10998. }
  10999. else
  11000. {
  11001. actionResult.Status = (int)Constant.PDAResult.Fail;
  11002. actionResult.Message = sre.Message;
  11003. }
  11004. }
  11005. else
  11006. {
  11007. actionResult.Status = (int)Constant.PDAResult.Fail;
  11008. actionResult.Message = sre.Message;
  11009. }
  11010. return actionResult;
  11011. }
  11012. }
  11013. // 3#条码补打
  11014. else if (module == "01070806")
  11015. {
  11016. // 获取3#条码打印机配置(PDA用)
  11017. if (action == "GetWorkStationPrinter3")
  11018. {
  11019. ServiceResultEntity sre = SystemModuleLogic.GetWorkStationPrinter3(sUserInfo);
  11020. if (sre.Data != null && sre.Data.Tables.Count > 0)
  11021. {
  11022. actionResult.Status = (int)Constant.PDAResult.Success;
  11023. actionResult.Result = JsonHelper.ToJson(sre.Data);
  11024. }
  11025. else
  11026. {
  11027. actionResult.Status = (int)Constant.PDAResult.Fail;
  11028. }
  11029. return actionResult;
  11030. }
  11031. // 补打3#条码(PDA用)
  11032. else if (action == "PrintBarcode_3BL_B")
  11033. {
  11034. ClientRequestEntity cre = new ClientRequestEntity();
  11035. cre.Properties["Barcode"] = data["Barcode"];
  11036. if (data.ContainsKey("PrinterID1"))
  11037. cre.Properties["PrinterID1"] = data["PrinterID1"];
  11038. if (data.ContainsKey("PrinterID2"))
  11039. cre.Properties["PrinterID2"] = data["PrinterID2"];
  11040. if (data.ContainsKey("PrinterID3"))
  11041. cre.Properties["PrinterID3"] = data["PrinterID3"];
  11042. ServiceResultEntity sre = SystemModuleLogic.PrintBarcode_3BL_B(cre, sUserInfo);
  11043. if (sre.Status == Constant.ServiceResultStatus.Success)
  11044. {
  11045. if (sre.Result != null)
  11046. {
  11047. actionResult.Status = (int)Constant.PDAResult.Success;
  11048. }
  11049. else
  11050. {
  11051. actionResult.Status = (int)Constant.PDAResult.Fail;
  11052. actionResult.Message = sre.Message;
  11053. }
  11054. }
  11055. else
  11056. {
  11057. actionResult.Status = (int)Constant.PDAResult.Fail;
  11058. actionResult.Message = sre.Message;
  11059. }
  11060. return actionResult;
  11061. }
  11062. }
  11063. #endregion
  11064. #region 获取3#成检二检PLC重量
  11065. else if (module == "GetPLCWeight")
  11066. {
  11067. // 获取3#条码打印机配置(PDA用)
  11068. if (action == "GetPLCWeight")
  11069. {
  11070. actionResult.Result = PMModuleLogic.Get3PLCWeight(sUserInfo);
  11071. actionResult.Status = (int)Constant.PDAResult.Success;
  11072. return actionResult;
  11073. }
  11074. }
  11075. #endregion
  11076. #region 注浆绑码时,验证成型线是否能绑码
  11077. else if (module == "CheckGroutingLine")
  11078. {
  11079. if (action == "CheckGroutingLine")
  11080. {
  11081. ServiceResultEntity sre = PDAModuleLogic.CheckGroutingLine(data["GroutingLineCode"] + "");
  11082. if (sre.OtherStatus < 0)
  11083. {
  11084. actionResult.Status = (int)Constant.PDAResult.Fail;
  11085. actionResult.Message = sre.Message;
  11086. }
  11087. else
  11088. {
  11089. actionResult.Status = (int)Constant.PDAResult.Success;
  11090. }
  11091. return actionResult;
  11092. }
  11093. }
  11094. #endregion
  11095. #region 注浆绑码选批次查询最小启用的模具编码
  11096. else if (module == "GetGroutingMouldByBatchNo")
  11097. {
  11098. if (action == "GetGroutingMouldByBatchNo")
  11099. {
  11100. string groutingLineCode = data["groutingLineCode"] + "";
  11101. string groutingDay = data["groutingDay"] + "";
  11102. string groutingBatchNo = data["groutingBatchNo"] + "";
  11103. string groutingMouldCode = data["groutingMouldCode"] + "";
  11104. ServiceResultEntity sre = PDAModuleLogic.GetGroutingMouldByBatchNo(groutingMouldCode, groutingLineCode, groutingDay, groutingBatchNo);
  11105. if (sre.Status == Constant.ServiceResultStatus.Success)
  11106. {
  11107. actionResult.Status = (int)Constant.PDAResult.Success;
  11108. actionResult.Result = JsonHelper.ToJson(sre.Result);
  11109. actionResult.Message = sre.Message;
  11110. }
  11111. else
  11112. {
  11113. actionResult.Status = (int)Constant.PDAResult.Fail;
  11114. actionResult.Result = sre.OtherStatus;
  11115. actionResult.Message = sre.Message;
  11116. }
  11117. return actionResult;
  11118. }
  11119. }
  11120. #endregion
  11121. #region 3#半检一检交坯
  11122. else if (module == "SemiQualityStatistics")
  11123. {
  11124. if (action == "SemiQualityStatisticsDeliver3")
  11125. {
  11126. ServiceResultEntity sre = PMModuleLogicDAL.SemiQualityStatisticsDeliver3(data, sUserInfo);
  11127. if (sre.OtherStatus < 0)
  11128. {
  11129. actionResult.Status = (int)Constant.PDAResult.Fail;
  11130. actionResult.Message = sre.Message;
  11131. }
  11132. else
  11133. {
  11134. actionResult.Status = (int)Constant.PDAResult.Success;
  11135. }
  11136. return actionResult;
  11137. }
  11138. }
  11139. #endregion
  11140. #region 产品分级(3车间)
  11141. else if (module == "0628")
  11142. {
  11143. if (action == "CheckOneLevelType")
  11144. {
  11145. string barcode = data["Barcode"] + "";
  11146. ServiceResultEntity sre = PDAModuleLogic.CheckOneLevelType(barcode);
  11147. if (sre.OtherStatus < 0)
  11148. {
  11149. actionResult.Status = (int)Constant.PDAResult.Fail;
  11150. actionResult.Message = sre.Message;
  11151. }
  11152. else
  11153. {
  11154. actionResult.Status = (int)Constant.PDAResult.Success;
  11155. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  11156. }
  11157. return actionResult;
  11158. }
  11159. if (action == "SaveOneLevelType")
  11160. {
  11161. int? levelTypeID = data["LevelTypeID"].ToNullableInt32();
  11162. string barcode = data["Barcode"] + "";
  11163. ServiceResultEntity sre = PDAModuleLogic.SaveOneLevelType(levelTypeID, barcode);
  11164. if (sre.OtherStatus < 0)
  11165. {
  11166. actionResult.Status = (int)Constant.PDAResult.Fail;
  11167. actionResult.Message = sre.Message;
  11168. }
  11169. else
  11170. {
  11171. actionResult.Status = (int)Constant.PDAResult.Success;
  11172. }
  11173. return actionResult;
  11174. }
  11175. }
  11176. #endregion
  11177. #region 半检查询责任工序(3车间)
  11178. else if (module == "GetDutyProcedureByBarCode3")
  11179. {
  11180. if (action == "GetDutyProcedureByBarCode3")
  11181. {
  11182. string barcode = data["barcode"] + "";
  11183. int defectid = Convert.ToInt32(data["defectid"] + "");
  11184. int procedureid = Convert.ToInt32(data["procedureid"] + "");
  11185. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  11186. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID, procedureid));
  11187. if (dutyProcedureDs != null)
  11188. {
  11189. actionResult.Status = (int)Constant.PDAResult.Success;
  11190. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  11191. }
  11192. else
  11193. {
  11194. actionResult.Status = (int)Constant.PDAResult.Fail;
  11195. }
  11196. return actionResult;
  11197. }
  11198. }
  11199. #endregion
  11200. #region 成品检验
  11201. if (module == "ProductionData")
  11202. {
  11203. //扫码查询
  11204. if (action == "CheckBarcode")
  11205. {
  11206. string barcode = data["barcode"] + "";
  11207. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.GetProductionID(barcode);
  11208. int procedureID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["finishedcheckprocedureid"]);
  11209. sre = Service.PCModuleService.FinishedCheckLogic.CheckBarcode(procedureID, barcode, sUserInfo);
  11210. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  11211. if (Convert.ToInt32(sre.Result) < 0)
  11212. {
  11213. actionResult.Status = (int)Constant.PDAResult.Fail;
  11214. actionResult.Result = sre.OtherStatus; //漏扫1,反之0
  11215. actionResult.Message = sre.Message;
  11216. }
  11217. else
  11218. {
  11219. actionResult.Result = JsonHelper.ToJson(sre.Data);
  11220. actionResult.Status = (int)Constant.PDAResult.Success;
  11221. actionResult.Message = sre.Message;
  11222. }
  11223. return actionResult;
  11224. }
  11225. //撤销查询
  11226. if (action == "GetFinishedCancleData")
  11227. {
  11228. string barcode = data["barcode"] + "";
  11229. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.GetFinishedCancleData(barcode, sUserInfo);
  11230. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  11231. if (Convert.ToInt32(sre.Result) < 0)
  11232. {
  11233. actionResult.Status = (int)Constant.PDAResult.Fail;
  11234. actionResult.Result = sre.OtherStatus; //漏扫1,反之0
  11235. actionResult.Message = sre.Message;
  11236. }
  11237. else
  11238. {
  11239. actionResult.Result = JsonHelper.ToJson(sre.Data);
  11240. actionResult.Status = (int)Constant.PDAResult.Success;
  11241. actionResult.Message = sre.Message;
  11242. }
  11243. return actionResult;
  11244. }
  11245. //保存成品检验
  11246. if (action == "AddCheckBarcode")
  11247. {
  11248. int procedureID = Convert.ToInt32(data["procedureID"]);
  11249. //DataTable TableProductionData = JsonHelper.FromJson<DataTable>(data["productionData"] + "");
  11250. //缺陷
  11251. //DataTable productionDefectTable = JsonHelper.FromJson<DataTable>(data["productionDefectTable"] + "");
  11252. //责任员工
  11253. //DataTable DSTableStaff = JsonHelper.FromJson<DataTable>(data["dSTableStaff"] + "");
  11254. //漏检员工
  11255. //DataTable DSTableMissedStaff = JsonHelper.FromJson<DataTable>(data["dSTableMissedStaff"] + "");
  11256. //图片
  11257. //DataTable DSTableImage = JsonHelper.FromJson<DataTable>(data["dSTableImage"] + "");
  11258. //ProductionDataEntity[] productionDataEntitys = new ProductionDataEntity[TableProductionData.Rows.Count];
  11259. #region 转换实体
  11260. //for (int i = 0; i < TableProductionData.Rows.Count; i++)
  11261. //{
  11262. // if (TableProductionData.Rows[i]["ReadOnly"].ToString() == "1") //只读数据不进行保存
  11263. // {
  11264. // continue;
  11265. // }
  11266. // ProductionDataEntity productionDataEntity = new ProductionDataEntity();
  11267. // if (TableProductionData.Rows[i]["ProductionDataID"].ToString() != "")
  11268. // {
  11269. // productionDataEntity.ProductionDataID = Convert.ToInt32(TableProductionData.Rows[i]["ProductionDataID"]);
  11270. // }
  11271. // productionDataEntity.Barcode = TableProductionData.Rows[i]["BarCode"].ToString();
  11272. // productionDataEntity.UserID = sUserInfo.UserID;
  11273. // productionDataEntity.UserCode = sUserInfo.UserCode;
  11274. // productionDataEntity.UserName = sUserInfo.UserName; ;
  11275. // productionDataEntity.DefectFlag = Convert.ToInt32(TableProductionData.Rows[i]["GoodsLevelTypeID"]) == 4 ? 1 : 2;
  11276. // productionDataEntity.GoodsLevelID = Convert.ToInt32(TableProductionData.Rows[i]["DefectFlagID"]);
  11277. // productionDataEntity.GoodsLevelTypeID = Convert.ToInt32(TableProductionData.Rows[i]["GoodsLevelTypeID"]);
  11278. // productionDataEntity.Remarks = TableProductionData.Rows[i]["Remarks"].ToString();
  11279. // if (TableProductionData.Rows[i]["LogoID"].ToString() != "")
  11280. // {
  11281. // productionDataEntity.LogoID = Convert.ToInt32(TableProductionData.Rows[i]["LogoID"]);
  11282. // }
  11283. // if (TableProductionData.Rows[i]["OPTimeStamp"].ToString() != "")
  11284. // {
  11285. // productionDataEntity.OPTimeStamp = Convert.ToDateTime(TableProductionData.Rows[i]["OPTimeStamp"]);
  11286. // }
  11287. // if (TableProductionData.Rows[i]["CheckTime"].ToString() != "")
  11288. // {
  11289. // productionDataEntity.CheckTime = Convert.ToDateTime(TableProductionData.Rows[i]["CheckTime"]);
  11290. // }
  11291. // if (TableProductionData.Rows[i]["OrgGoodsLevelTypeID"].ToString() != "-1")
  11292. // {
  11293. // productionDataEntity.OrgGoodsLevelTypeID = Convert.ToInt32(TableProductionData.Rows[i]["OrgGoodsLevelTypeID"]);
  11294. // }
  11295. // if (!string.IsNullOrEmpty(TableProductionData.Rows[i]["ReworkProcedureID"].ToString()))
  11296. // {
  11297. // productionDataEntity.ReworkProcedureID = int.Parse(TableProductionData.Rows[i]["ReworkProcedureID"].ToString());
  11298. // productionDataEntity.IsReworked = 1;
  11299. // }
  11300. // productionDataEntitys[i] = productionDataEntity;
  11301. // List<ProductionDefectEntity> productionDefectEntitys = new List<ProductionDefectEntity>();
  11302. // ProductionDefectEntity productionDefectEntity = null;
  11303. // for (int j = 0; j < productionDefectTable.Rows.Count; j++) //缺陷列表
  11304. // {
  11305. // productionDefectEntity = new ProductionDefectEntity();
  11306. // productionDefectEntity.SpecialDefect = productionDefectTable.Rows[j]["IsOtherDefect"].ToString();
  11307. // //if (productionDefectTable.Rows[j]["DefectDeductionID"].ToString() != "-1"
  11308. // // && productionDefectTable.Rows[j]["DefectDeductionID"].ToString() != string.Empty)
  11309. // //{
  11310. // // productionDefectEntity.DefectDeductionNum = Convert.ToDecimal(productionDefectTable.Rows[j]["DefectDeductionNum"]);
  11311. // //}
  11312. // if (!string.IsNullOrEmpty(productionDefectTable.Rows[j]["DefectDeductionNum"] + ""))
  11313. // {
  11314. // productionDefectEntity.DefectDeductionNum = Convert.ToDecimal(productionDefectTable.Rows[j]["DefectDeductionNum"]);
  11315. // }
  11316. // productionDefectEntity.ScrapResponFlag = "0";
  11317. // productionDefectEntity.DefectID =
  11318. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectID"]);
  11319. // productionDefectEntity.DefectCode =
  11320. // productionDefectTable.Rows[j]["DefectCode"].ToString();
  11321. // productionDefectEntity.DefectName =
  11322. // productionDefectTable.Rows[j]["DefectName"].ToString().Replace(productionDefectEntity.DefectCode + "->", "");
  11323. // productionDefectEntity.DefectPositionID =
  11324. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectPositionID"]);
  11325. // productionDefectEntity.DefectPositionCode =
  11326. // productionDefectTable.Rows[j]["DefectPositionCode"].ToString();
  11327. // productionDefectEntity.DefectPositionName =
  11328. // productionDefectTable.Rows[j]["DefectPositionName"].ToString().Replace(productionDefectEntity.DefectPositionCode + "->", "");
  11329. // productionDefectEntity.DefectProductionDataID =
  11330. // Convert.ToInt32(productionDefectTable.Rows[j]["ProductionDataID"] + "");
  11331. // if (productionDefectEntity.DefectProductionDataID == 0)
  11332. // {
  11333. // productionDefectEntity.DefectProductionDataID = null;
  11334. // }
  11335. // if (productionDefectTable.Rows[j]["DefectProcedureID"].ToString() != string.Empty &&
  11336. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectProcedureID"] + "") > Constant.INT_IS_ZERO)
  11337. // {
  11338. // productionDefectEntity.DefectProcedureID =
  11339. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectProcedureID"]);
  11340. // }
  11341. // productionDefectEntity.DefectProcedureCode =
  11342. // productionDefectTable.Rows[j]["DefectProcedureCode"].ToString();
  11343. // productionDefectEntity.DefectProcedureName =
  11344. // productionDefectTable.Rows[j]["DefectProcedureName"].ToString();
  11345. // productionDefectEntity.DefectUserID =
  11346. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectUserID"]);
  11347. // productionDefectEntity.DefectUserCode =
  11348. // productionDefectTable.Rows[j]["DefectUserCode"].ToString();
  11349. // productionDefectEntity.DefectUserName =
  11350. // productionDefectTable.Rows[j]["DefectUserName"].ToString();
  11351. // productionDefectEntity.DefectJobs =
  11352. // Convert.ToInt32(productionDefectTable.Rows[j]["Jobs"].ToString());
  11353. // productionDefectEntity.Remarks =
  11354. // productionDefectTable.Rows[j]["DefectRemarks"].ToString();
  11355. // productionDefectEntity.Remarks =
  11356. // productionDefectTable.Rows[j]["DefectRemarks"].ToString();
  11357. // if (productionDefectTable.Rows[j]["DefectFineID"].ToString() != "-1"
  11358. // && productionDefectTable.Rows[j]["DefectFineID"].ToString() != string.Empty)
  11359. // {
  11360. // productionDefectEntity.DefectFine = Convert.ToInt32(productionDefectTable.Rows[j]["DefectFineID"]);
  11361. // }
  11362. // if (productionDefectTable.Rows[j]["CheckTime"].ToString() != string.Empty)
  11363. // {
  11364. // //if (Convert.ToInt32(this.TableProductionData.Rows[i]["OrgGoodsLevelTypeID"]) == Convert.ToInt32(this.TableProductionData.Rows[i]["GoodsLevelTypeID"]))
  11365. // //{
  11366. // productionDefectEntity.CheckTime = Convert.ToDateTime(productionDefectTable.Rows[j]["CheckTime"]);
  11367. // //}
  11368. // }
  11369. // if (productionDefectTable.Rows[j]["MissedUserID"].ToString() != "-1"
  11370. // && productionDefectTable.Rows[j]["MissedUserID"].ToString() != string.Empty)
  11371. // {
  11372. // productionDefectEntity.MissedUserID = Convert.ToInt32(productionDefectTable.Rows[j]["MissedUserID"]);
  11373. // productionDefectEntity.MissedUserCode = productionDefectTable.Rows[j]["MissedUserCode"].ToString();
  11374. // productionDefectEntity.MissedUserName = productionDefectTable.Rows[j]["MissedUserName"].ToString();
  11375. // }
  11376. // // 遍历责任员工
  11377. // List<DefectResponsibleEntity> DefectResponsibles = new List<DefectResponsibleEntity>();
  11378. // if (DSTableStaff != null && DSTableStaff.Rows.Count > 0)
  11379. // {
  11380. // DefectResponsibleEntity defectResponsibleEntity = null;
  11381. // foreach (DataRow drStaff in DSTableStaff.Rows)
  11382. // {
  11383. // if (Convert.ToInt32(drStaff["IsSelected"]) == Constant.INT_IS_ONE)
  11384. // {
  11385. // defectResponsibleEntity = new DefectResponsibleEntity();
  11386. // defectResponsibleEntity.StaffID = Convert.ToInt32(drStaff["StaffID"]);
  11387. // defectResponsibleEntity.UserID = Convert.ToInt32(productionDefectEntity.DefectUserID);
  11388. // defectResponsibleEntity.UserCode = productionDefectEntity.DefectUserCode;
  11389. // defectResponsibleEntity.UJobsID =
  11390. // Convert.ToInt32(productionDefectTable.Rows[j]["Jobs"].ToString());
  11391. // defectResponsibleEntity.SJobsID =
  11392. // Convert.ToInt32(productionDefectTable.Rows[j]["Jobs"].ToString());
  11393. // defectResponsibleEntity.StaffStatus = Convert.ToInt32(drStaff["StaffStatus"]);
  11394. // DefectResponsibles.Add(defectResponsibleEntity);
  11395. // }
  11396. // }
  11397. // //productionDefectEntity.DefectResponsibles = DefectResponsibles.ToArray();//每个缺陷对应的责任员工
  11398. // productionDefectEntity.DefectResponsibles = DefectResponsibles;//每个缺陷对应的责任员工
  11399. // }
  11400. // // 遍历漏检责任员工
  11401. // List<DefectMissedResponsibleEntity> DefectMissedResponsibles = new List<DefectMissedResponsibleEntity>();
  11402. // if (DSTableMissedStaff != null && DSTableMissedStaff.Rows.Count > 0)
  11403. // {
  11404. // DefectMissedResponsibleEntity defectMissedResponsibleEntity = null;
  11405. // foreach (DataRow drStaff in DSTableMissedStaff.Rows)
  11406. // {
  11407. // if (Convert.ToInt32(drStaff["IsSelected"]) == Constant.INT_IS_ONE)
  11408. // {
  11409. // defectMissedResponsibleEntity = new DefectMissedResponsibleEntity();
  11410. // defectMissedResponsibleEntity.StaffID = Convert.ToInt32(drStaff["StaffID"]);
  11411. // defectMissedResponsibleEntity.UserID = Convert.ToInt32(productionDefectEntity.DefectUserID);
  11412. // defectMissedResponsibleEntity.UserCode = productionDefectEntity.DefectUserCode;
  11413. // defectMissedResponsibleEntity.UJobsID = Convert.ToInt32(drStaff["UJobsID"]);
  11414. // defectMissedResponsibleEntity.SJobsID = Convert.ToInt32(drStaff["SJobsID"]);
  11415. // defectMissedResponsibleEntity.StaffStatus = Convert.ToInt32(drStaff["StaffStatus"]);
  11416. // DefectMissedResponsibles.Add(defectMissedResponsibleEntity);
  11417. // }
  11418. // }
  11419. // //productionDefectEntity.DefectMissedResponsibles = DefectMissedResponsibles.ToArray();
  11420. // productionDefectEntity.DefectMissedResponsibles = DefectMissedResponsibles;
  11421. // }
  11422. // // 遍历缺陷图片
  11423. // if (DSTableImage != null && DSTableImage.Rows.Count > 0)
  11424. // {
  11425. // List<DefectImageEntity> defectImageEntitys = new List<DefectImageEntity>();
  11426. // DefectImageEntity defectImageEntity = null;
  11427. // foreach (DataRow drImage in DSTableImage.Rows)
  11428. // {
  11429. // defectImageEntity = new DefectImageEntity();
  11430. // defectImageEntity.Thumbnail = (byte[])drImage["ImageByte"];
  11431. // defectImageEntity.Image = (byte[])drImage["orgImageByte"];
  11432. // defectImageEntitys.Add(defectImageEntity);
  11433. // }
  11434. // productionDefectEntity.DefectImages = defectImageEntitys;
  11435. // }
  11436. // productionDefectEntitys.Add(productionDefectEntity);
  11437. // }
  11438. // productionDataEntitys[i].ProductionDefects = productionDefectEntitys;
  11439. // }
  11440. #endregion
  11441. ProductionDataEntity[] productionDataEntitys = JsonHelper.FromJson<ProductionDataEntity[]>(data["productionDataEntitys"] + "");
  11442. DataTable bomDetailTable = new DataTable();
  11443. if (data["bomDetailTable"] != null)
  11444. {
  11445. bomDetailTable = JsonHelper.FromJson<DataTable>(data["bomDetailTable"] + "");
  11446. }
  11447. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.AddCheckBarcode(procedureID, productionDataEntitys, bomDetailTable, sUserInfo);
  11448. if (Convert.ToInt32(sre.Result) > 0)
  11449. {
  11450. actionResult.Status = (int)Constant.PDAResult.Success;
  11451. actionResult.Message = "保存成功";
  11452. }
  11453. else
  11454. {
  11455. actionResult.Status = (int)Constant.PDAResult.Fail;
  11456. actionResult.Message = sre.Message;
  11457. }
  11458. return actionResult;
  11459. }
  11460. //撤销
  11461. if (action == "FinishedCancleData")
  11462. {
  11463. int productionDataID = Convert.ToInt32(data["productionDataID"]);
  11464. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.FinishedCancleData(productionDataID, sUserInfo);
  11465. if (Convert.ToInt32(sre.OtherStatus) > 0)
  11466. {
  11467. actionResult.Status = (int)Constant.PDAResult.Success;
  11468. actionResult.Message = "撤销成功";
  11469. }
  11470. else
  11471. {
  11472. actionResult.Status = (int)Constant.PDAResult.Fail;
  11473. actionResult.Message = sre.Message;
  11474. }
  11475. return actionResult;
  11476. }
  11477. //查询用户
  11478. if (action == "CheckProcedureUser")
  11479. {
  11480. string userCode1 = data["UserCode"] + "";
  11481. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.CheckProcedureUser(userCode1, sUserInfo);
  11482. if (Convert.ToInt32(sre.Result) < 0)
  11483. {
  11484. actionResult.Status = (int)Constant.PDAResult.Fail;
  11485. actionResult.Result = sre.OtherStatus;
  11486. actionResult.Message = sre.Message;
  11487. }
  11488. else
  11489. {
  11490. actionResult.Result = JsonHelper.ToJson(sre.Data);
  11491. actionResult.Status = (int)Constant.PDAResult.Success;
  11492. actionResult.Message = sre.Message;
  11493. }
  11494. return actionResult;
  11495. }
  11496. }
  11497. #endregion
  11498. #region BPM同步日志 add xiacm 2022-11-17
  11499. else if (module == "BARCODEIDNRKSCRAP")
  11500. {
  11501. if (action == "GetBarcodeIdnrkScrap")
  11502. {
  11503. //组件唯一编码
  11504. string IdnrkOnlyCode = data["IdnrkOnlyCode"].ToString();
  11505. // 确认日期
  11506. DateTime createTime = DateTime.Now.Date;
  11507. if (data.ContainsKey("CreateTime") && !string.IsNullOrEmpty(data["CreateTime"] + ""))
  11508. {
  11509. createTime = Convert.ToDateTime(data["CreateTime"].ToString());
  11510. }
  11511. // 确认标识(1:确认;2:撤销)
  11512. string confirmFlag = data["ConfirmFlag"].ToString();
  11513. string message = string.Empty;
  11514. DataSet IdnrkOnlyCodeDs = ServiceInvoker.Invoke(this,
  11515. () => PMModuleLogic.GetIdnrkOnlyCode(IdnrkOnlyCode, createTime, confirmFlag, sUserInfo, out message));
  11516. if (IdnrkOnlyCodeDs != null)
  11517. {
  11518. if (string.IsNullOrEmpty(message))
  11519. {
  11520. actionResult.Status = (int)Constant.PDAResult.Success;
  11521. actionResult.Result = JsonHelper.ToJson(IdnrkOnlyCodeDs);
  11522. }
  11523. else
  11524. {
  11525. actionResult.Status = (int)Constant.PDAResult.Fail;
  11526. actionResult.Message = message;
  11527. }
  11528. }
  11529. else
  11530. {
  11531. actionResult.Status = (int)Constant.PDAResult.Fail;
  11532. actionResult.Message = message;
  11533. }
  11534. return actionResult;
  11535. }
  11536. if (action == "ConfirmBarcodeIdnrkScrap")
  11537. {
  11538. ClientRequestEntity cre = new ClientRequestEntity();
  11539. DataTable dtBarcodeIdnrkScrap = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  11540. DateTime createTime = DateTime.Now.Date;
  11541. if (data.ContainsKey("CreateTime") && !string.IsNullOrEmpty(data["CreateTime"] + ""))
  11542. {
  11543. createTime = Convert.ToDateTime(data["CreateTime"].ToString());
  11544. }
  11545. cre.Data = new DataSet();
  11546. cre.Data.Tables.Add(dtBarcodeIdnrkScrap);
  11547. // 确认日期
  11548. cre.Properties["CreateTime"] = createTime;
  11549. // 确认标识(1:确认;2:撤销)
  11550. cre.Properties["ConfirmFlag"] = data["ConfirmFlag"].ToString();
  11551. if (dtBarcodeIdnrkScrap != null && dtBarcodeIdnrkScrap.Rows.Count > 0)
  11552. {
  11553. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11554. () => PMModuleLogic.ConfirmBarcodeIdnrkScrap(cre, sUserInfo));
  11555. if (Convert.ToInt32(sre.Result) <= 0)
  11556. {
  11557. actionResult.Status = (int)Constant.PDAResult.Fail;
  11558. actionResult.Message = sre.Message;
  11559. }
  11560. else
  11561. {
  11562. actionResult.Status = (int)Constant.PDAResult.Success;
  11563. actionResult.Message = "保存成功";
  11564. }
  11565. }
  11566. else
  11567. {
  11568. actionResult.Status = (int)Constant.PDAResult.Fail;
  11569. }
  11570. return actionResult;
  11571. }
  11572. }
  11573. #endregion
  11574. #region 次品扫描功能 20230406 by qq
  11575. if (module == "Recycling")
  11576. {
  11577. //扫码查询
  11578. if (action == "RecyclingAddBarcode")
  11579. {
  11580. string barcode = data["barcode"] + "";
  11581. string type = data["type"] + "";
  11582. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11583. () => PMModuleLogic.RecyclingAddBarcode(barcode, type, sUserInfo));
  11584. if (Convert.ToInt32(sre.Result) <= 0)
  11585. {
  11586. actionResult.Status = (int)Constant.PDAResult.Fail;
  11587. actionResult.Message = sre.Message;
  11588. }
  11589. else
  11590. {
  11591. actionResult.Status = (int)Constant.PDAResult.Success;
  11592. actionResult.Message = "保存成功";
  11593. }
  11594. return actionResult;
  11595. }
  11596. }
  11597. #endregion
  11598. #region 裸瓷包装状态撤销(非工序) by qq
  11599. if (module == "LuociRevoke")
  11600. {
  11601. //扫码查询
  11602. if (action == "CheckLuoci")
  11603. {
  11604. string barcode = data["barcode"] + "";
  11605. int procedureID = 159;
  11606. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11607. () => PMModuleLogic.CheckLuoci(procedureID, barcode, sUserInfo));
  11608. if (sre.OtherStatus < 0)
  11609. {
  11610. actionResult.Status = (int)Constant.PDAResult.Fail;
  11611. actionResult.Message = sre.Message;
  11612. }
  11613. else
  11614. {
  11615. actionResult.Status = (int)Constant.PDAResult.Success;
  11616. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  11617. }
  11618. return actionResult;
  11619. }
  11620. //撤销保存
  11621. else if (action == "AddChancelLuoci")
  11622. {
  11623. DataTable detailTable = new DataTable();
  11624. if (data["detailTable"] != null)
  11625. {
  11626. detailTable = JsonHelper.FromJson<DataTable>(data["detailTable"] + "");
  11627. }
  11628. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11629. () => PMModuleLogic.AddChancelLuoci(detailTable, sUserInfo));
  11630. if (Convert.ToInt32(sre.Result) < 0)
  11631. {
  11632. actionResult.Status = (int)Constant.PDAResult.Fail;
  11633. actionResult.Message = sre.Message;
  11634. }
  11635. else
  11636. {
  11637. actionResult.Status = (int)Constant.PDAResult.Success;
  11638. }
  11639. return actionResult;
  11640. }
  11641. }
  11642. #endregion
  11643. #region 裸瓷产成品交接 by qq
  11644. if (module == "LCFinishedProduct")
  11645. {
  11646. #region 裸瓷交接、整板撤销 by qq 20250521
  11647. // 交接验证
  11648. if (action == "LCFinishedHandoverBarcode")
  11649. {
  11650. string barcode = data["Barcode"] + "";
  11651. ServiceResultEntity sre = PMModuleLogic.LCFinishedHandoverBarcode(barcode, sUserInfo);
  11652. if (sre.Data != null && sre.Data.Tables.Count > 0)
  11653. {
  11654. actionResult.Status = (int)Constant.PDAResult.Success;
  11655. actionResult.Result = JsonHelper.ToJson(sre.Data);
  11656. actionResult.Message = sre.Message;
  11657. }
  11658. else
  11659. {
  11660. actionResult.Status = (int)Constant.PDAResult.Fail;
  11661. actionResult.Message = sre.Message;
  11662. }
  11663. return actionResult;
  11664. }
  11665. // 交接操作
  11666. if (action == "LCSaveFinishedHandover")
  11667. {
  11668. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  11669. ServiceResultEntity sre = PMModuleLogicDAL.LCSaveFinishedHandover(dt, sUserInfo);
  11670. //结束
  11671. if (Convert.ToInt32(sre.Result) > 0)
  11672. {
  11673. actionResult.Status = (int)Constant.PDAResult.Success;
  11674. actionResult.Message = "裸瓷交接成功";
  11675. }
  11676. else
  11677. {
  11678. actionResult.Status = (int)Constant.PDAResult.Fail;
  11679. actionResult.Message = sre.Message;
  11680. }
  11681. return actionResult;
  11682. }
  11683. // 撤销交接验证
  11684. if (action == "LCBackFinishedHandoverCheck")
  11685. {
  11686. string barcode = data["Barcode"] + "";
  11687. ServiceResultEntity sre = PMModuleLogic.LCBackFinishedHandoverCheck(barcode, sUserInfo);
  11688. if (sre.Data != null && sre.Data.Tables.Count > 0)
  11689. {
  11690. actionResult.Status = (int)Constant.PDAResult.Success;
  11691. actionResult.Result = JsonHelper.ToJson(sre.Data);
  11692. actionResult.Message = sre.Message;
  11693. }
  11694. else
  11695. {
  11696. actionResult.Status = (int)Constant.PDAResult.Fail;
  11697. actionResult.Message = sre.Message;
  11698. }
  11699. return actionResult;
  11700. }
  11701. // 撤销交接操作
  11702. if (action == "LCBackFinishedHandover")
  11703. {
  11704. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  11705. ServiceResultEntity sre = PMModuleLogicDAL.LCBackFinishedHandover(dt, sUserInfo);
  11706. if (Convert.ToInt32(sre.Result) > 0)
  11707. {
  11708. actionResult.Status = (int)Constant.PDAResult.Success;
  11709. actionResult.Message = "产成品撤销交接成功";
  11710. }
  11711. else
  11712. {
  11713. actionResult.Status = (int)Constant.PDAResult.Fail;
  11714. actionResult.Message = sre.Message;
  11715. }
  11716. return actionResult;
  11717. }
  11718. #endregion
  11719. }
  11720. #endregion
  11721. #region 三水对接潮州裸瓷产品 20251015 by qq
  11722. if (module == "DockingLuoci")
  11723. {
  11724. if (action == "CheckDockingLuoci")
  11725. {
  11726. string barcode = data["barcode"] + "";
  11727. string workshop = data["workshop"] + "";
  11728. //251022074439-D731F504-A4D0-4ED2-A956-0A36B1C8C8D3
  11729. ServiceResultEntity sre1 = SystemModuleLogic.GetDockingLuoci(barcode, workshop, sUserInfo);
  11730. ServiceResultEntity sre = new ServiceResultEntity();
  11731. if (sre1.Data != null && sre1.Data.Tables.Count > 0 && sre1.Data.Tables[0].Rows.Count > 0)
  11732. {
  11733. sre = SystemModuleLogic.CheckDockingLuoci(sre1.Data.Copy(), sUserInfo);
  11734. }
  11735. else
  11736. {
  11737. //未查找到数据
  11738. actionResult.Status = (int)Constant.PDAResult.Fail;
  11739. actionResult.Message = "调出工厂未查找到该条码数据";
  11740. return actionResult;
  11741. }
  11742. if (sre.Data != null && sre.Data.Tables.Count > 0 && sre.Data.Tables[0].Rows.Count > 0)
  11743. {
  11744. //----------------------测试
  11745. //DataTable dt = sre.Data.Tables[0];
  11746. //PMModuleLogicDAL.SaveDockingLuoci(dt, sUserInfo);
  11747. //---------------------
  11748. actionResult.Status = (int)Constant.PDAResult.Success;
  11749. actionResult.Result = JsonHelper.ToJson(sre.Data);
  11750. actionResult.Message = sre.Message;
  11751. }
  11752. else
  11753. {
  11754. actionResult.Status = (int)Constant.PDAResult.Fail;
  11755. actionResult.Message = sre.Message;
  11756. }
  11757. return actionResult;
  11758. }
  11759. else if (action == "SaveDockingLuoci")
  11760. {
  11761. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  11762. ServiceResultEntity sre = PMModuleLogicDAL.SaveDockingLuoci(dt, sUserInfo);
  11763. if (Convert.ToInt32(sre.OtherStatus) < 0)
  11764. {
  11765. actionResult.Status = (int)Constant.PDAResult.Fail;
  11766. actionResult.Message = sre.Message;
  11767. }
  11768. else
  11769. {
  11770. actionResult.Status = (int)Constant.PDAResult.Success;
  11771. }
  11772. return actionResult;
  11773. }
  11774. }
  11775. #endregion
  11776. return actionResult;
  11777. }
  11778. catch (Exception ex)
  11779. {
  11780. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11781. OutputLog.TraceLog(LogPriority.Error,
  11782. this.ToString(),
  11783. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  11784. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  11785. " module:" + module + " action:" + action + " json:" + jsonData,
  11786. ex.ToString(),
  11787. LocalPath.LogExePath);
  11788. actionResult.Status = (int)Constant.PDAResult.Exception;
  11789. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11790. }
  11791. return actionResult;
  11792. }
  11793. #endregion
  11794. #region 发货单一览
  11795. /// <summary>
  11796. /// 发货单信息查询
  11797. /// </summary>
  11798. /// <param name="accountCode"></param>
  11799. /// <param name="userCode"></param>
  11800. /// <param name="userPassword"></param>
  11801. /// <param name="sessionKey"></param>
  11802. /// <param name="ementy"></param>
  11803. /// <returns></returns>
  11804. public ActionResult SelectDeliveryNoteInquiry(string accountCode, string userCode, string userPassword, string sessionKey, DeliveryNoteInquiry ementy)
  11805. {
  11806. ActionResult actionResult = new ActionResult();
  11807. try
  11808. {
  11809. // 验证请求头信息
  11810. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  11811. // 验证失败
  11812. if (actionResult.Status != (int)Constant.PDAResult.Success)
  11813. {
  11814. return actionResult;
  11815. }
  11816. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11817. () => PMModuleLogicDAL.GetDetails(ementy));
  11818. if (resultEntity.OtherStatus == -1)
  11819. {
  11820. actionResult.Status = (int)Constant.PDAResult.Fail;
  11821. }
  11822. else
  11823. {
  11824. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  11825. actionResult.Status = (int)Constant.PDAResult.Success;
  11826. }
  11827. actionResult.Message = resultEntity.Message;
  11828. }
  11829. catch (Exception ex)
  11830. {
  11831. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11832. OutputLog.TraceLog(LogPriority.Error,
  11833. this.ToString(),
  11834. System.Reflection.MethodBase.GetCurrentMethod().Name,
  11835. ex.ToString(),
  11836. LocalPath.LogExePath);
  11837. actionResult.Status = (int)Constant.PDAResult.Exception;
  11838. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11839. }
  11840. return actionResult;
  11841. }
  11842. /// <summary>
  11843. /// 查询发出仓库,接收仓库,车牌号
  11844. /// </summary>
  11845. /// <param name="type"></param>
  11846. /// <returns></returns>
  11847. public ActionResult SelectCARPLATENAMES(string type)
  11848. {
  11849. ActionResult actionResult = new ActionResult();
  11850. try
  11851. {
  11852. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11853. () => PMModuleLogicDAL.GetDATA(type));
  11854. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  11855. if (resultEntity.Data.Tables[0].Rows.Count == 0)
  11856. {
  11857. actionResult.Status = (int)Constant.PDAResult.Fail;
  11858. }
  11859. else
  11860. {
  11861. actionResult.Status = (int)Constant.PDAResult.Success;
  11862. }
  11863. actionResult.Message = resultEntity.Message;
  11864. }
  11865. catch (Exception ex)
  11866. {
  11867. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11868. OutputLog.TraceLog(LogPriority.Error,
  11869. this.ToString(),
  11870. System.Reflection.MethodBase.GetCurrentMethod().Name,
  11871. ex.ToString(),
  11872. LocalPath.LogExePath);
  11873. actionResult.Status = (int)Constant.PDAResult.Exception;
  11874. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11875. }
  11876. return actionResult;
  11877. }
  11878. /// <summary>
  11879. /// 刪除订单
  11880. /// </summary>
  11881. /// <param name="accountCode"></param>
  11882. /// <param name="userCode"></param>
  11883. /// <param name="userPassword"></param>
  11884. /// <param name="sessionKey"></param>
  11885. /// <param name="ementy"></param>
  11886. /// <returns></returns>
  11887. public ActionResult DestroyInvoice(string accountCode, string userCode, string userPassword, string sessionKey, string ementy)
  11888. {
  11889. ActionResult actionResult = new ActionResult();
  11890. try
  11891. {
  11892. // 验证请求头信息
  11893. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  11894. // 验证失败
  11895. if (actionResult.Status != (int)Constant.PDAResult.Success)
  11896. {
  11897. return actionResult;
  11898. }
  11899. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11900. () => PMModuleLogicDAL.DestroyInvoice(ementy, userCode, userPassword));
  11901. actionResult.Result = JsonHelper.ToJson(resultEntity.Result);
  11902. actionResult.Status = (int)Constant.PDAResult.Success;
  11903. actionResult.Message = resultEntity.Message;
  11904. }
  11905. catch (Exception ex)
  11906. {
  11907. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11908. OutputLog.TraceLog(LogPriority.Error,
  11909. this.ToString(),
  11910. System.Reflection.MethodBase.GetCurrentMethod().Name,
  11911. ex.ToString(),
  11912. LocalPath.LogExePath);
  11913. actionResult.Status = (int)Constant.PDAResult.Exception;
  11914. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11915. }
  11916. return actionResult;
  11917. }
  11918. /// <summary>
  11919. /// 撤销订单
  11920. /// </summary>
  11921. /// <param name="accountCode"></param>
  11922. /// <param name="userCode"></param>
  11923. /// <param name="userPassword"></param>
  11924. /// <param name="sessionKey"></param>
  11925. /// <param name="ementy"></param>
  11926. /// <returns></returns>
  11927. public ActionResult RevokeInvoice(string accountCode, string userCode, string userPassword, string sessionKey, string ementy)
  11928. {
  11929. ActionResult actionResult = new ActionResult();
  11930. try
  11931. {
  11932. // 验证请求头信息
  11933. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  11934. // 验证失败
  11935. if (actionResult.Status != (int)Constant.PDAResult.Success)
  11936. {
  11937. return actionResult;
  11938. }
  11939. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11940. () => PMModuleLogicDAL.RevokeInvoice(ementy, userCode, userPassword));
  11941. if (resultEntity.OtherStatus == -1)
  11942. {
  11943. actionResult.Status = (int)Constant.PDAResult.Fail;
  11944. }
  11945. else
  11946. {
  11947. actionResult.Result = JsonHelper.ToJson(resultEntity.Result);
  11948. actionResult.Status = (int)Constant.PDAResult.Success;
  11949. }
  11950. actionResult.Message = resultEntity.Message;
  11951. }
  11952. catch (Exception ex)
  11953. {
  11954. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11955. OutputLog.TraceLog(LogPriority.Error,
  11956. this.ToString(),
  11957. System.Reflection.MethodBase.GetCurrentMethod().Name,
  11958. ex.ToString(),
  11959. LocalPath.LogExePath);
  11960. actionResult.Status = (int)Constant.PDAResult.Exception;
  11961. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11962. }
  11963. return actionResult;
  11964. }
  11965. /// <summary>
  11966. /// 补推订单
  11967. /// </summary>
  11968. /// <param name="accountCode"></param>
  11969. /// <param name="userCode"></param>
  11970. /// <param name="userPassword"></param>
  11971. /// <param name="sessionKey"></param>
  11972. /// <param name="ementy"></param>
  11973. /// <returns></returns>
  11974. public ActionResult SupplementaryPush(string accountCode, string userCode, string userPassword, string sessionKey, string ementy)
  11975. {
  11976. ActionResult actionResult = new ActionResult();
  11977. try
  11978. {
  11979. // 验证请求头信息
  11980. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  11981. // 验证失败
  11982. if (actionResult.Status != (int)Constant.PDAResult.Success)
  11983. {
  11984. return actionResult;
  11985. }
  11986. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11987. () => PMModuleLogicDAL.SupplementaryPush(ementy, userCode));
  11988. if (resultEntity.OtherStatus == -1)
  11989. {
  11990. actionResult.Status = (int)Constant.PDAResult.Fail;
  11991. }
  11992. else
  11993. {
  11994. actionResult.Result = JsonHelper.ToJson(resultEntity.Result);
  11995. actionResult.Status = (int)Constant.PDAResult.Success;
  11996. }
  11997. actionResult.Message = resultEntity.Message;
  11998. }
  11999. catch (Exception ex)
  12000. {
  12001. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  12002. OutputLog.TraceLog(LogPriority.Error,
  12003. this.ToString(),
  12004. System.Reflection.MethodBase.GetCurrentMethod().Name,
  12005. ex.ToString(),
  12006. LocalPath.LogExePath);
  12007. actionResult.Status = (int)Constant.PDAResult.Exception;
  12008. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  12009. }
  12010. return actionResult;
  12011. }
  12012. #endregion
  12013. #region PDA 包装 校验板码
  12014. /// <summary>
  12015. /// 托盘下有没有产品未交接的
  12016. /// </summary>
  12017. /// <param name="accountCode"></param>
  12018. /// <param name="userCode"></param>
  12019. /// <param name="userPassword"></param>
  12020. /// <param name="sessionKey"></param>
  12021. /// <param name="ementy"></param>
  12022. /// <returns></returns>
  12023. public ActionResult CheckBanma(string accountCode, string userCode, string userPassword, string sessionKey, string banma)
  12024. {
  12025. ActionResult actionResult = new ActionResult();
  12026. try
  12027. {
  12028. // 验证请求头信息
  12029. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  12030. // 验证失败
  12031. if (actionResult.Status != (int)Constant.PDAResult.Success)
  12032. {
  12033. return actionResult;
  12034. }
  12035. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  12036. () => PMModuleLogicDAL.ToCheckBanma(banma));
  12037. if (resultEntity.OtherStatus == -1)
  12038. {
  12039. actionResult.Status = (int)Constant.PDAResult.Fail;
  12040. }
  12041. else
  12042. {
  12043. actionResult.Result = JsonHelper.ToJson(resultEntity.Result);
  12044. actionResult.Status = (int)Constant.PDAResult.Success;
  12045. }
  12046. actionResult.Message = resultEntity.Message;
  12047. }
  12048. catch (Exception ex)
  12049. {
  12050. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  12051. OutputLog.TraceLog(LogPriority.Error,
  12052. this.ToString(),
  12053. System.Reflection.MethodBase.GetCurrentMethod().Name,
  12054. ex.ToString(),
  12055. LocalPath.LogExePath);
  12056. actionResult.Status = (int)Constant.PDAResult.Exception;
  12057. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  12058. }
  12059. return actionResult;
  12060. }
  12061. #endregion
  12062. }
  12063. }