PDAModuleServiceGet.cs 374 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:PDAModuleService.cs
  5. * 2.功能描述:PDA模块WCF服务
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 徐伟 2019/10/23 1.01 增加Get方法
  9. * 必须做调整:
  10. * 时间原因,此文件只是PDAModuleService的副本,所有方法名称加了Get,
  11. * 方法实现与不带Get的方法一模一样,为保证业务逻辑一致,
  12. * 应将所有Get方法调整为调用非Get方法,
  13. * 例如:DoPDALoginGet 方法中 应直接调用 PDALoginGet 方法。
  14. *******************************************************************************/
  15. using System;
  16. using System.Collections.Generic;
  17. using System.Data;
  18. using System.IO;
  19. using System.ServiceModel;
  20. using System.ServiceModel.Activation;
  21. using Dongke.IBOSS.PRD.Basics.BaseResources;
  22. using Dongke.IBOSS.PRD.Basics.DataAccess;
  23. using Dongke.IBOSS.PRD.Basics.Library;
  24. using Dongke.IBOSS.PRD.Service.BarcodePrintService;
  25. using Dongke.IBOSS.PRD.Service.CommonModuleLogic;
  26. using Dongke.IBOSS.PRD.Service.DataModels;
  27. using Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic;
  28. using Dongke.IBOSS.PRD.Service.HRModuleLogic;
  29. using Dongke.IBOSS.PRD.Service.PCModuleLogic;
  30. using Dongke.IBOSS.PRD.Service.PDAModuleLogic;
  31. using Dongke.IBOSS.PRD.Service.PMModuleLogic;
  32. using Dongke.IBOSS.PRD.Service.PublicModuleService;
  33. using Dongke.IBOSS.PRD.Service.ReportModuleLogic;
  34. using Dongke.IBOSS.PRD.Service.SmartDeviceService;
  35. using Dongke.IBOSS.PRD.Service.SystemModuleLogic;
  36. using Dongke.IBOSS.PRD.WCF.Contracts;
  37. using Dongke.IBOSS.PRD.WCF.DataModels;
  38. using Dongke.IBOSS.PRD.WCF.DataModels.ConfigModule;
  39. using Dongke.IBOSS.PRD.WCF.DataModels.HRModule;
  40. using Dongke.IBOSS.PRD.WCF.DataModels.PCModule;
  41. using Dongke.IBOSS.PRD.WCF.DataModels.PMModule;
  42. namespace Dongke.IBOSS.PRD.WCF.Services
  43. {
  44. // 服务实现类,继承服务声明接口
  45. // 该标签声明该服务可以在ASP.NET下运行
  46. public partial class PDAModuleService : IPDAModule
  47. {
  48. #region 验证
  49. /// <summary>
  50. /// 验证访问头
  51. /// </summary>
  52. /// <param name="accountCode">帐套编码</param>
  53. /// <param name="userCode">用户编码</param>
  54. /// <param name="userPassword">用户密码</param>
  55. /// <param name="sessionKey">访问密钥</param>
  56. /// <returns></returns>
  57. private ActionResult DoPDACheckGet(string accountCode, string userCode, string userPassword, string sessionKey)
  58. {
  59. try
  60. {
  61. ActionResult actionResult = new ActionResult();
  62. LoginRequestEntity requestEntity = new LoginRequestEntity();
  63. requestEntity.AccountCode = accountCode;
  64. requestEntity.UserCode = userCode;
  65. requestEntity.Password = userPassword;
  66. requestEntity.SessionKey = sessionKey;
  67. SUserInfo userInfo = null;
  68. string loginStatus = DKIBOSSPRDLogic.AuthenticateRepeatLogin(requestEntity, out userInfo);
  69. // 用户登录信息错误
  70. if (Constant.INT_IS_ONE.ToString().Equals(loginStatus))
  71. {
  72. actionResult.Status = (int)Constant.PDAResult.LoginInfoError;
  73. actionResult.Message = Constant.PDA_RESULT_LOGININFOERROR;
  74. }
  75. // 用户在其它终端登陆
  76. else if (Constant.INT_IS_TWO.ToString().Equals(loginStatus))
  77. {
  78. actionResult.Status = (int)Constant.PDAResult.RepeatLogin;
  79. actionResult.Message = Constant.PDA_RESULT_REPEATLOGIN;
  80. }
  81. // Lic错误
  82. else if ("3".Equals(loginStatus))
  83. {
  84. actionResult.Status = (int)Constant.PDAResult.LicInfoError;
  85. actionResult.Message = "授权信息错误,请联系管理员。";
  86. }
  87. else
  88. {
  89. actionResult.Status = (int)Constant.PDAResult.Success;
  90. }
  91. sUserInfo = userInfo;
  92. return actionResult;
  93. }
  94. catch (Exception ex)
  95. {
  96. throw ex;
  97. }
  98. }
  99. #endregion
  100. #region WCF服务
  101. /// <summary>
  102. /// 测试PDA连接WCF服务
  103. /// </summary>
  104. /// <param name="value">测试文本</param>
  105. /// <returns>返回文本</returns>
  106. public string TestConnectionExGet(string value)
  107. {
  108. return "连接成功!" + value;
  109. }
  110. public string TestConnectionGet()
  111. {
  112. return "连接成功!";
  113. }
  114. #endregion
  115. #region 系统登录
  116. /// <summary>
  117. /// 系统登录
  118. /// </summary>
  119. /// <param name="accountCode"></param>
  120. /// <param name="userCode"></param>
  121. /// <param name="userPassword"></param>
  122. /// <param name="macAddress"></param>
  123. /// <param name="ipAddress"></param>
  124. /// <param name="phoneCode"></param>
  125. /// <param name="phoneType"></param>
  126. /// <param name="appVersion"></param>
  127. /// <param name="systemType"></param>
  128. /// <param name="systemVersion"></param>
  129. /// <returns></returns>
  130. public PDALoginResult DoPDALoginGet(string accountCode, string userCode, string userPassword,
  131. string macAddress, string ipAddress, string phoneCode, string phoneType,
  132. string appVersion, string systemType, string systemVersion)
  133. {
  134. try
  135. {
  136. LoginRequestEntity requestEntity = new LoginRequestEntity();
  137. requestEntity.AccountCode = accountCode;
  138. requestEntity.UserCode = userCode;
  139. requestEntity.Password = userPassword;
  140. requestEntity.ComputerName = phoneCode;
  141. requestEntity.IPAddress = ipAddress;
  142. requestEntity.MACAddress = macAddress;
  143. PDALoginResult result = ServiceInvoker.Invoke<PDALoginResult>(this,
  144. () => PDAModuleLogic.DoPDALogin(requestEntity));
  145. return result;
  146. }
  147. catch (Exception ex)
  148. {
  149. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  150. OutputLog.TraceLog(LogPriority.Error,
  151. this.ToString(),
  152. System.Reflection.MethodBase.GetCurrentMethod().Name,
  153. ex.ToString(),
  154. LocalPath.LogExePath);
  155. PDALoginResult result = new PDALoginResult();
  156. result.Status = (int)Constant.PDAResult.Exception;
  157. result.Message = Constant.PDA_RESULT_EXCEPTION;
  158. return result;
  159. }
  160. }
  161. /// <summary>
  162. /// 退出
  163. /// </summary>
  164. /// <param name="accountCode">帐套code</param>
  165. /// <param name="userCode">用户code</param>
  166. /// <param name="userPassword">用户密码</param>
  167. /// <param name="sessionKey">本次登陆密钥</param>
  168. /// <returns></returns>
  169. public ActionResult DoPDAOutGet(string accountCode, string userCode, string userPassword, string sessionKey)
  170. {
  171. ActionResult actionResult = new ActionResult();
  172. try
  173. {
  174. // 验证请求头信息
  175. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  176. // 验证失败
  177. if (actionResult.Status != (int)Constant.PDAResult.Success)
  178. {
  179. return actionResult;
  180. }
  181. bool result = DKIBOSSPRDLogic.Logout(sUserInfo.UserID, "3", sUserInfo);
  182. actionResult.Result = JsonHelper.ToJson(result);
  183. actionResult.Status = (int)Constant.PDAResult.Success;
  184. }
  185. catch (Exception ex)
  186. {
  187. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  188. OutputLog.TraceLog(LogPriority.Error,
  189. this.ToString(),
  190. System.Reflection.MethodBase.GetCurrentMethod().Name,
  191. ex.ToString(),
  192. LocalPath.LogExePath);
  193. actionResult.Status = (int)Constant.PDAResult.Exception;
  194. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  195. }
  196. return actionResult;
  197. }
  198. /// <summary>
  199. /// 修改密码
  200. /// </summary>
  201. /// <param name="accountCode"></param>
  202. /// <param name="userCode"></param>
  203. /// <param name="userPassword"></param>
  204. /// <param name="sessionKey"></param>
  205. /// <returns></returns>
  206. public ActionResult ChangeUserPasswordGet(string accountCode, string userCode, string userPassword, string sessionKey,
  207. string newPassWord)
  208. {
  209. ActionResult actionResult = new ActionResult();
  210. try
  211. {
  212. // 验证请求头信息
  213. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  214. // 验证失败
  215. if (actionResult.Status != (int)Constant.PDAResult.Success)
  216. {
  217. return actionResult;
  218. }
  219. string result = ServiceInvoker.Invoke<string>(this,
  220. () => SystemModuleDAL.SaveUserPassWord(newPassWord, userCode, null, sUserInfo));
  221. actionResult.Status = (int)Constant.PDAResult.Success;
  222. }
  223. catch (Exception ex)
  224. {
  225. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  226. OutputLog.TraceLog(LogPriority.Error,
  227. this.ToString(),
  228. System.Reflection.MethodBase.GetCurrentMethod().Name,
  229. ex.ToString(),
  230. LocalPath.LogExePath);
  231. actionResult.Status = (int)Constant.PDAResult.Exception;
  232. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  233. }
  234. return actionResult;
  235. }
  236. #endregion
  237. #region 取得展示数据
  238. /// <summary>
  239. /// 获得生产线菜单
  240. /// </summary>
  241. /// <param name="accountCode">帐套code</param>
  242. /// <param name="userCode">用户code</param>
  243. /// <param name="userPassword">用户密码</param>
  244. /// <param name="sessionKey">本次登陆密钥</param>
  245. /// <returns></returns>
  246. /// <remarks>
  247. /// 陈冰 2014.09.18 新建
  248. /// </remarks>
  249. public ActionResult GetProductionLineMenuGet(string accountCode, string userCode, string userPassword, string sessionKey)
  250. {
  251. ActionResult actionResult = new ActionResult();
  252. try
  253. {
  254. // 验证请求头信息
  255. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  256. // 验证失败
  257. if (actionResult.Status != (int)Constant.PDAResult.Success)
  258. {
  259. return actionResult;
  260. }
  261. // 查询菜单
  262. DataTable dtPLM = ServiceInvoker.Invoke<DataTable>(this,
  263. () => PDAModuleLogic.GetProductionLineMenu(sUserInfo));
  264. PDAFunctionResult pdaFunction = new PDAFunctionResult();
  265. pdaFunction.MenuCode = "Root";
  266. DataRow[] navigationRows = dtPLM.Select("LEN(MenuCode) = " + Constant.INT_IS_TWO.ToString(), "MenuCode ASC"); // 编号2为一级菜单
  267. foreach (DataRow newRow in navigationRows)
  268. {
  269. #region 插入子节点数据
  270. int? intProcedureID = null;
  271. int? intModelType = null;
  272. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  273. {
  274. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  275. }
  276. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  277. {
  278. intModelType = Convert.ToInt32(newRow["ModelType"]);
  279. }
  280. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  281. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  282. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  283. pdaFunctionChild.ProcedureID = intProcedureID;
  284. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  285. pdaFunctionChild.ModelType = intModelType;
  286. pdaFunction.PDAFunctions.Add(pdaFunctionChild);
  287. #endregion
  288. InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild);
  289. }
  290. //actionResult.Result = JsonHelper.ToJson(dtPLM);
  291. actionResult.Result = JsonHelper.ToJson(pdaFunction);
  292. actionResult.Status = (int)Constant.PDAResult.Success;
  293. }
  294. catch (Exception ex)
  295. {
  296. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  297. OutputLog.TraceLog(LogPriority.Error,
  298. this.ToString(),
  299. System.Reflection.MethodBase.GetCurrentMethod().Name,
  300. ex.ToString(),
  301. LocalPath.LogExePath);
  302. actionResult.Status = (int)Constant.PDAResult.Exception;
  303. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  304. }
  305. return actionResult;
  306. }
  307. /// <summary>
  308. /// 初始化树形控件
  309. /// </summary>
  310. /// <param name="treeTable">菜单数据表</param>
  311. /// <param name="rows">待处理的菜单集合</param>
  312. /// <param name="node">当前树节点</param>
  313. private void InitTreeViewGet(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions)
  314. {
  315. string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = "
  316. + (pFuncCode.Length + Constant.INT_IS_TWO);
  317. DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC");
  318. //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC");
  319. foreach (DataRow newRow in subRows)
  320. {
  321. #region 插入子节点数据
  322. int? intProcedureID = null;
  323. int? intModelType = null;
  324. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  325. {
  326. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  327. }
  328. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  329. {
  330. intModelType = Convert.ToInt32(newRow["ModelType"]);
  331. }
  332. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  333. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  334. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  335. pdaFunctionChild.ProcedureID = intProcedureID;
  336. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  337. pdaFunctionChild.ModelType = intModelType;
  338. pFunctions.PDAFunctions.Add(pdaFunctionChild);
  339. #endregion
  340. // 递归方法
  341. InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild);
  342. }
  343. }
  344. #endregion
  345. #region 获得工序信息
  346. /// <summary>
  347. /// 获得工序信息
  348. /// </summary>
  349. /// <param name="accountCode">帐套code</param>
  350. /// <param name="userCode">用户code</param>
  351. /// <param name="userPassword">用户密码</param>
  352. /// <param name="sessionKey">本次登陆密钥</param>
  353. /// <param name="procedureID">工序ID</param>
  354. /// <returns></returns>
  355. /// <remarks>
  356. /// 陈冰 2014.09.18 新建
  357. /// </remarks>
  358. public ActionResult GetProcedureByIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  359. {
  360. ActionResult actionResult = new ActionResult();
  361. try
  362. {
  363. // 验证请求头信息
  364. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  365. // 验证失败
  366. if (actionResult.Status != (int)Constant.PDAResult.Success)
  367. {
  368. return actionResult;
  369. }
  370. ProcedureEntity procedureEntity = ServiceInvoker.Invoke<ProcedureEntity>(this,
  371. () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo));
  372. actionResult.Result = JsonHelper.ToJson(procedureEntity);
  373. actionResult.Status = (int)Constant.PDAResult.Success;
  374. }
  375. catch (Exception ex)
  376. {
  377. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  378. OutputLog.TraceLog(LogPriority.Error,
  379. this.ToString(),
  380. System.Reflection.MethodBase.GetCurrentMethod().Name,
  381. ex.ToString(),
  382. LocalPath.LogExePath);
  383. actionResult.Status = (int)Constant.PDAResult.Exception;
  384. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  385. }
  386. return actionResult;
  387. }
  388. #endregion
  389. #region 校验
  390. /// <summary>
  391. /// 校验产品条码是否可以走到该工序
  392. /// </summary>
  393. /// <param name="accountCode">帐套code</param>
  394. /// <param name="userCode">用户code</param>
  395. /// <param name="userPassword">用户密码</param>
  396. /// <param name="sessionKey">本次登陆密钥</param>
  397. /// <param name="procedureID">工序ID</param>
  398. /// <param name="barcode">条码</param>
  399. /// <returns></returns>
  400. /// <remarks>
  401. /// 陈冰 2014.09.18 新建
  402. /// </remarks>
  403. public ActionResult CheckBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  404. {
  405. ActionResult actionResult = new ActionResult();
  406. try
  407. {
  408. // 验证请求头信息
  409. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  410. // 验证失败
  411. if (actionResult.Status != (int)Constant.PDAResult.Success)
  412. {
  413. return actionResult;
  414. }
  415. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  416. () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo));
  417. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  418. {
  419. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  420. actionResult.Status = (int)Constant.PDAResult.Success;
  421. }
  422. else
  423. {
  424. actionResult.Status = (int)Constant.PDAResult.Fail;
  425. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  426. }
  427. }
  428. catch (Exception ex)
  429. {
  430. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  431. OutputLog.TraceLog(LogPriority.Error,
  432. this.ToString(),
  433. System.Reflection.MethodBase.GetCurrentMethod().Name,
  434. ex.ToString(),
  435. LocalPath.LogExePath);
  436. actionResult.Status = (int)Constant.PDAResult.Exception;
  437. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  438. }
  439. return actionResult;
  440. }
  441. /// <summary>
  442. /// 校验产品条码是否可以进行干补
  443. /// </summary>
  444. /// <param name="accountCode">帐套code</param>
  445. /// <param name="userCode">用户code</param>
  446. /// <param name="userPassword">用户密码</param>
  447. /// <param name="sessionKey">本次登陆密钥</param>
  448. /// <param name="procedureID">工序ID</param>
  449. /// <param name="barcode">条码</param>
  450. /// <returns></returns>
  451. /// <remarks>
  452. /// 袁新成 2015.4.1 新建
  453. /// </remarks>
  454. public ActionResult CheckDryRepairBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  455. {
  456. ActionResult actionResult = new ActionResult();
  457. try
  458. {
  459. // 验证请求头信息
  460. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  461. // 验证失败
  462. if (actionResult.Status != (int)Constant.PDAResult.Success)
  463. {
  464. return actionResult;
  465. }
  466. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  467. () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
  468. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  469. {
  470. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  471. actionResult.Status = (int)Constant.PDAResult.Success;
  472. }
  473. else
  474. {
  475. actionResult.Status = (int)Constant.PDAResult.Fail;
  476. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  477. }
  478. }
  479. catch (Exception ex)
  480. {
  481. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  482. OutputLog.TraceLog(LogPriority.Error,
  483. this.ToString(),
  484. System.Reflection.MethodBase.GetCurrentMethod().Name,
  485. ex.ToString(),
  486. LocalPath.LogExePath);
  487. actionResult.Status = (int)Constant.PDAResult.Exception;
  488. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  489. }
  490. return actionResult;
  491. }
  492. /// <summary>
  493. /// 检验生产工号
  494. /// </summary>
  495. /// <param name="accountCode">帐套code</param>
  496. /// <param name="userCode">用户code</param>
  497. /// <param name="userPassword">用户密码</param>
  498. /// <param name="sessionKey">本次登陆密钥</param>
  499. /// <param name="procedureID">工序ID</param>
  500. /// <param name="procedureUserCode">生产工号</param>
  501. /// <remarks>
  502. /// 陈冰 2014.09.18 新建
  503. /// </remarks>
  504. public ActionResult CheckProcedureUserGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
  505. {
  506. ActionResult actionResult = new ActionResult();
  507. try
  508. {
  509. // 验证请求头信息
  510. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  511. // 验证失败
  512. if (actionResult.Status != (int)Constant.PDAResult.Success)
  513. {
  514. return actionResult;
  515. }
  516. CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
  517. () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
  518. actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
  519. actionResult.Status = (int)Constant.PDAResult.Success;
  520. }
  521. catch (Exception ex)
  522. {
  523. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  524. OutputLog.TraceLog(LogPriority.Error,
  525. this.ToString(),
  526. System.Reflection.MethodBase.GetCurrentMethod().Name,
  527. ex.ToString(),
  528. LocalPath.LogExePath);
  529. actionResult.Status = (int)Constant.PDAResult.Exception;
  530. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  531. }
  532. return actionResult;
  533. }
  534. /// <summary>
  535. /// 校验窑车是否可装车并返回窑车信息
  536. /// </summary>
  537. /// <param name="accountCode">帐套code</param>
  538. /// <param name="userCode">用户code</param>
  539. /// <param name="userPassword">用户密码</param>
  540. /// <param name="sessionKey">本次登陆密钥</param>
  541. /// <param name="kilnCarCode">窑车号</param>
  542. /// <param name="modelType">工序类别</param>
  543. /// <returns></returns>
  544. /// <remarks>
  545. /// 陈冰 2014.10.04 新建
  546. /// </remarks>
  547. public ActionResult CheckKilnCarGet(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
  548. {
  549. ActionResult actionResult = new ActionResult();
  550. try
  551. {
  552. // 验证请求头信息
  553. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  554. // 验证失败
  555. if (actionResult.Status != (int)Constant.PDAResult.Success)
  556. {
  557. return actionResult;
  558. }
  559. CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
  560. () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
  561. actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
  562. actionResult.Status = (int)Constant.PDAResult.Success;
  563. }
  564. catch (Exception ex)
  565. {
  566. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  567. OutputLog.TraceLog(LogPriority.Error,
  568. this.ToString(),
  569. System.Reflection.MethodBase.GetCurrentMethod().Name,
  570. ex.ToString(),
  571. LocalPath.LogExePath);
  572. actionResult.Status = (int)Constant.PDAResult.Exception;
  573. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  574. }
  575. return actionResult;
  576. }
  577. #endregion
  578. #region 保存条码信息
  579. /// <summary>
  580. /// 保存条码信息
  581. /// </summary>
  582. /// <param name="accountCode">帐套code</param>
  583. /// <param name="userCode">用户code</param>
  584. /// <param name="userPassword">用户密码</param>
  585. /// <param name="sessionKey">本次登陆密钥</param>
  586. /// <param name="procedureID">工序ID</param>
  587. /// <param name="productionDataEntitys">条码信息</param>
  588. public ActionResult AddWorkPieceGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  589. {
  590. ActionResult actionResult = new ActionResult();
  591. try
  592. {
  593. // 验证请求头信息
  594. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  595. // 验证失败
  596. if (actionResult.Status != (int)Constant.PDAResult.Success)
  597. {
  598. return actionResult;
  599. }
  600. DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
  601. if (!dtProductionData.Columns.Contains("IsPDA"))
  602. {
  603. dtProductionData.Columns.Add("IsPDA");
  604. }
  605. ProcedureEntity procedureInfo = null;
  606. DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
  607. () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
  608. actionResult.Result = JsonHelper.ToJson(resultDT);
  609. actionResult.Status = (int)Constant.PDAResult.Success;
  610. if (resultDT != null)
  611. {
  612. DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
  613. if (drs != null && drs.Length > 0)
  614. {
  615. return actionResult;
  616. }
  617. }
  618. #region PDA条码打印
  619. if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
  620. procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
  621. {
  622. try
  623. {
  624. if (procedureInfo.CollectType == 1)
  625. {
  626. //foreach (DataRow item in dtProductionData.Rows)
  627. //{
  628. // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
  629. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  630. // if (sre.Status != Constant.ServiceResultStatus.Success)
  631. // {
  632. // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  633. // actionResult.Message = sre.Message;
  634. // return actionResult;
  635. // }
  636. //}
  637. }
  638. else
  639. {
  640. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
  641. procedureInfo.BarCodePrintCopies, null, sUserInfo);
  642. if (sre.Status != Constant.ServiceResultStatus.Success)
  643. {
  644. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  645. actionResult.Message = sre.Message;
  646. return actionResult;
  647. }
  648. }
  649. }
  650. catch (Exception ex)
  651. {
  652. OutputLog.TraceLog(LogPriority.Error,
  653. this.ToString(),
  654. System.Reflection.MethodBase.GetCurrentMethod().Name,
  655. ex.ToString(),
  656. LocalPath.LogExePath);
  657. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  658. actionResult.Message = "条码打印异常";
  659. return actionResult;
  660. }
  661. }
  662. #endregion PDA条码打印
  663. }
  664. catch (Exception ex)
  665. {
  666. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  667. OutputLog.TraceLog(LogPriority.Error,
  668. this.ToString(),
  669. System.Reflection.MethodBase.GetCurrentMethod().Name,
  670. ex.ToString(),
  671. LocalPath.LogExePath);
  672. actionResult.Status = (int)Constant.PDAResult.Exception;
  673. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  674. }
  675. return actionResult;
  676. }
  677. #endregion
  678. #region 获得系统/基数数据
  679. /// <summary>
  680. /// 获得数据字典
  681. /// </summary>
  682. /// <param name="accountCode">帐套code</param>
  683. /// <param name="userCode">用户code</param>
  684. /// <param name="userPassword">用户密码</param>
  685. /// <param name="sessionKey">本次登陆密钥</param>
  686. /// <param name="dicType">字典类型</param>
  687. /// <returns></returns>
  688. public ActionResult GetDataDictionaryByTypeGet(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  689. {
  690. ActionResult actionResult = new ActionResult();
  691. try
  692. {
  693. // 验证请求头信息
  694. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  695. // 验证失败
  696. if (actionResult.Status != (int)Constant.PDAResult.Success)
  697. {
  698. return actionResult;
  699. }
  700. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  701. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  702. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  703. actionResult.Status = (int)Constant.PDAResult.Success;
  704. }
  705. catch (Exception ex)
  706. {
  707. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  708. OutputLog.TraceLog(LogPriority.Error,
  709. this.ToString(),
  710. System.Reflection.MethodBase.GetCurrentMethod().Name,
  711. ex.ToString(),
  712. LocalPath.LogExePath);
  713. actionResult.Status = (int)Constant.PDAResult.Exception;
  714. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  715. }
  716. return actionResult;
  717. }
  718. #endregion
  719. #region 检验工序接口
  720. /// <summary>
  721. /// 获得检验标识
  722. /// </summary>
  723. /// <param name="accountCode">帐套code</param>
  724. /// <param name="userCode">用户code</param>
  725. /// <param name="userPassword">用户密码</param>
  726. /// <param name="sessionKey">本次登陆密钥</param>
  727. /// <returns></returns>
  728. /// <remarks>
  729. /// 陈冰 2014.10.04 新建
  730. /// </remarks>
  731. public ActionResult GetDefectFlagDataGet(string accountCode, string userCode, string userPassword, string sessionKey)
  732. {
  733. ActionResult actionResult = new ActionResult();
  734. try
  735. {
  736. // 验证请求头信息
  737. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  738. // 验证失败
  739. if (actionResult.Status != (int)Constant.PDAResult.Success)
  740. {
  741. return actionResult;
  742. }
  743. #region 构造缺陷标识的数据源
  744. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  745. #endregion
  746. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  747. actionResult.Status = (int)Constant.PDAResult.Success;
  748. }
  749. catch (Exception ex)
  750. {
  751. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  752. OutputLog.TraceLog(LogPriority.Error,
  753. this.ToString(),
  754. System.Reflection.MethodBase.GetCurrentMethod().Name,
  755. ex.ToString(),
  756. LocalPath.LogExePath);
  757. actionResult.Status = (int)Constant.PDAResult.Exception;
  758. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  759. }
  760. return actionResult;
  761. }
  762. /// <summary>
  763. /// 由条码和当前检验工序获取返工工序
  764. /// </summary>
  765. /// <param name="accountCode">帐套code</param>
  766. /// <param name="userCode">用户code</param>
  767. /// <param name="userPassword">用户密码</param>
  768. /// <param name="sessionKey">本次登陆密钥</param>
  769. /// <param name="procedureID">当前检验工序ID</param>
  770. /// <param name="barcode">条码</param>
  771. /// <returns></returns>
  772. /// <remarks>
  773. /// 陈冰 2014.10.04 新建
  774. /// </remarks>
  775. public ActionResult GetReworkProcedureByBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  776. {
  777. ActionResult actionResult = new ActionResult();
  778. try
  779. {
  780. // 验证请求头信息
  781. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  782. // 验证失败
  783. if (actionResult.Status != (int)Constant.PDAResult.Success)
  784. {
  785. return actionResult;
  786. }
  787. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  788. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  789. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  790. {
  791. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  792. actionResult.Status = (int)Constant.PDAResult.Success;
  793. }
  794. else
  795. {
  796. actionResult.Status = (int)Constant.PDAResult.Fail;
  797. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  798. }
  799. }
  800. catch (Exception ex)
  801. {
  802. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  803. OutputLog.TraceLog(LogPriority.Error,
  804. this.ToString(),
  805. System.Reflection.MethodBase.GetCurrentMethod().Name,
  806. ex.ToString(),
  807. LocalPath.LogExePath);
  808. actionResult.Status = (int)Constant.PDAResult.Exception;
  809. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  810. }
  811. return actionResult;
  812. }
  813. /// <summary>
  814. /// 由当前检验工序获取缺陷列表
  815. /// </summary>
  816. /// <param name="accountCode">帐套code</param>
  817. /// <param name="userCode">用户code</param>
  818. /// <param name="userPassword">用户密码</param>
  819. /// <param name="sessionKey">本次登陆密钥</param>
  820. /// <param name="procedureID">当前检验工序ID</param>
  821. /// <param name="defectCode">缺陷编码</param>
  822. /// <returns></returns>
  823. /// <remarks>
  824. /// 陈冰 2014.10.04 新建
  825. /// </remarks>
  826. public ActionResult GetDefectByProcedureIDAndDefectCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  827. {
  828. ActionResult actionResult = new ActionResult();
  829. try
  830. {
  831. // 验证请求头信息
  832. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  833. // 验证失败
  834. if (actionResult.Status != (int)Constant.PDAResult.Success)
  835. {
  836. return actionResult;
  837. }
  838. object defectDs = ServiceInvoker.Invoke<object>(this,
  839. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  840. if (defectDs != null)
  841. {
  842. actionResult.Result = JsonHelper.ToJson(defectDs);
  843. actionResult.Status = (int)Constant.PDAResult.Success;
  844. }
  845. else
  846. {
  847. actionResult.Status = (int)Constant.PDAResult.Fail;
  848. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  849. }
  850. }
  851. catch (Exception ex)
  852. {
  853. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  854. OutputLog.TraceLog(LogPriority.Error,
  855. this.ToString(),
  856. System.Reflection.MethodBase.GetCurrentMethod().Name,
  857. ex.ToString(),
  858. LocalPath.LogExePath);
  859. actionResult.Status = (int)Constant.PDAResult.Exception;
  860. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  861. }
  862. return actionResult;
  863. }
  864. /// <summary>
  865. /// 根据产品ID查出缺陷位置
  866. /// </summary>
  867. /// <param name="accountCode">帐套code</param>
  868. /// <param name="userCode">用户code</param>
  869. /// <param name="userPassword">用户密码</param>
  870. /// <param name="sessionKey">本次登陆密钥</param>
  871. /// <param name="goodsID">产品ID</param>
  872. /// <param name="positionCode">位置编码</param>
  873. /// <returns></returns>
  874. /// <remarks>
  875. /// 陈冰 2014.10.04 新建
  876. /// </remarks>
  877. public ActionResult GetDefectPositionByGoodsIDAndPositionCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  878. {
  879. ActionResult actionResult = new ActionResult();
  880. try
  881. {
  882. // 验证请求头信息
  883. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  884. // 验证失败
  885. if (actionResult.Status != (int)Constant.PDAResult.Success)
  886. {
  887. return actionResult;
  888. }
  889. // 缺陷位置已经不用在关联产品
  890. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  891. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  892. if (defectDs != null)
  893. {
  894. actionResult.Result = JsonHelper.ToJson(defectDs);
  895. actionResult.Status = (int)Constant.PDAResult.Success;
  896. }
  897. else
  898. {
  899. actionResult.Status = (int)Constant.PDAResult.Fail;
  900. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  901. }
  902. }
  903. catch (Exception ex)
  904. {
  905. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  906. OutputLog.TraceLog(LogPriority.Error,
  907. this.ToString(),
  908. System.Reflection.MethodBase.GetCurrentMethod().Name,
  909. ex.ToString(),
  910. LocalPath.LogExePath);
  911. actionResult.Status = (int)Constant.PDAResult.Exception;
  912. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  913. }
  914. return actionResult;
  915. }
  916. /// <summary>
  917. /// 通过条码和缺陷查出责任工序
  918. /// </summary>
  919. /// <param name="accountCode">帐套code</param>
  920. /// <param name="userCode">用户code</param>
  921. /// <param name="userPassword">用户密码</param>
  922. /// <param name="sessionKey">本次登陆密钥</param>
  923. /// <param name="barcode">条码</param>
  924. /// <param name="defectid">缺陷ID</param>
  925. /// <returns></returns>
  926. /// <remarks>
  927. /// 陈冰 2014.10.04 新建
  928. /// </remarks>
  929. public ActionResult GetDutyProcedureByBarCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  930. {
  931. ActionResult actionResult = new ActionResult();
  932. try
  933. {
  934. // 验证请求头信息
  935. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  936. // 验证失败
  937. if (actionResult.Status != (int)Constant.PDAResult.Success)
  938. {
  939. return actionResult;
  940. }
  941. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  942. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  943. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  944. {
  945. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  946. actionResult.Status = (int)Constant.PDAResult.Success;
  947. }
  948. else
  949. {
  950. actionResult.Status = (int)Constant.PDAResult.Fail;
  951. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  952. }
  953. }
  954. catch (Exception ex)
  955. {
  956. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  957. OutputLog.TraceLog(LogPriority.Error,
  958. this.ToString(),
  959. System.Reflection.MethodBase.GetCurrentMethod().Name,
  960. ex.ToString(),
  961. LocalPath.LogExePath);
  962. actionResult.Status = (int)Constant.PDAResult.Exception;
  963. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  964. }
  965. return actionResult;
  966. }
  967. /// <summary>
  968. /// 通过条码与工序查出责任工号(己废)
  969. /// </summary>
  970. /// <param name="accountCode">帐套code</param>
  971. /// <param name="userCode">用户code</param>
  972. /// <param name="userPassword">用户密码</param>
  973. /// <param name="sessionKey">本次登陆密钥</param>
  974. /// <param name="barcode">条码</param>
  975. /// <param name="dutyProcedureID">责任工序</param>
  976. /// <returns></returns>
  977. /// <remarks>
  978. /// 陈冰 2014.10.04 新建
  979. /// </remarks>
  980. public ActionResult GetDutyProcedureCodeByBarCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  981. {
  982. ActionResult actionResult = new ActionResult();
  983. try
  984. {
  985. // 验证请求头信息
  986. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  987. // 验证失败
  988. if (actionResult.Status != (int)Constant.PDAResult.Success)
  989. {
  990. return actionResult;
  991. }
  992. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  993. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  994. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  995. {
  996. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  997. actionResult.Status = (int)Constant.PDAResult.Success;
  998. }
  999. else
  1000. {
  1001. actionResult.Status = (int)Constant.PDAResult.Fail;
  1002. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1003. }
  1004. }
  1005. catch (Exception ex)
  1006. {
  1007. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1008. OutputLog.TraceLog(LogPriority.Error,
  1009. this.ToString(),
  1010. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1011. ex.ToString(),
  1012. LocalPath.LogExePath);
  1013. actionResult.Status = (int)Constant.PDAResult.Exception;
  1014. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1015. }
  1016. return actionResult;
  1017. }
  1018. /// <summary>
  1019. /// 通过条码与工序查出责任工号
  1020. /// </summary>
  1021. /// <param name="accountCode"></param>
  1022. /// <param name="userCode"></param>
  1023. /// <param name="userPassword"></param>
  1024. /// <param name="sessionKey"></param>
  1025. /// <param name="ProductionDataID">生产数据ID</param>
  1026. /// <returns></returns>
  1027. public ActionResult GetDutyProcedureCodeByProductionDataIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1028. {
  1029. ActionResult actionResult = new ActionResult();
  1030. try
  1031. {
  1032. // 验证请求头信息
  1033. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1034. // 验证失败
  1035. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1036. {
  1037. return actionResult;
  1038. }
  1039. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1040. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1041. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1042. {
  1043. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1044. actionResult.Status = (int)Constant.PDAResult.Success;
  1045. }
  1046. else
  1047. {
  1048. actionResult.Status = (int)Constant.PDAResult.Fail;
  1049. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1050. }
  1051. }
  1052. catch (Exception ex)
  1053. {
  1054. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1055. OutputLog.TraceLog(LogPriority.Error,
  1056. this.ToString(),
  1057. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1058. ex.ToString(),
  1059. LocalPath.LogExePath);
  1060. actionResult.Status = (int)Constant.PDAResult.Exception;
  1061. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1062. }
  1063. return actionResult;
  1064. }
  1065. /// <summary>
  1066. /// 通过生产数据与工号ID查询工种
  1067. /// </summary>
  1068. /// <param name="accountCode">帐套code</param>
  1069. /// <param name="userCode">用户code</param>
  1070. /// <param name="userPassword">用户密码</param>
  1071. /// <param name="sessionKey">本次登陆密钥</param>
  1072. /// <param name="productionDataID">生产数据ID</param>
  1073. /// <param name="userID">工号ID</param>
  1074. /// <returns></returns>
  1075. /// <remarks>
  1076. /// 陈冰 2014.10.08 新建
  1077. /// </remarks>
  1078. public ActionResult GetDutyJobsByUserIDAndProductionIDGet(string accountCode, string userCode, string userPassword, string sessionKey,
  1079. //int productionDataID, int userID)
  1080. int classesSettingID, int defectid, int procedureID)
  1081. {
  1082. ActionResult actionResult = new ActionResult();
  1083. try
  1084. {
  1085. // 验证请求头信息
  1086. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1087. // 验证失败
  1088. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1089. {
  1090. return actionResult;
  1091. }
  1092. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1093. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1094. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  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. /// 根据生产数据ID,用户ID及工种选出责任员工
  1121. /// </summary>
  1122. /// <param name="accountCode">帐套code</param>
  1123. /// <param name="userCode">用户code</param>
  1124. /// <param name="userPassword">用户密码</param>
  1125. /// <param name="sessionKey">本次登陆密钥</param>
  1126. /// <param name="productionDataID">生产数据ID</param>
  1127. /// <param name="userID">工号ID</param>
  1128. /// <param name="jobsID">工种ID</param>
  1129. /// <returns></returns>
  1130. /// <remarks>
  1131. /// 陈冰 2014.10.08 新建
  1132. /// </remarks>
  1133. public ActionResult GetDutyStaffByUserIDAndJobsGet(string accountCode, string userCode, string userPassword, string sessionKey,
  1134. //int productionDataID, int userID, int jobsID)
  1135. int classesSettingID, int jobsID)
  1136. {
  1137. ActionResult actionResult = new ActionResult();
  1138. try
  1139. {
  1140. // 验证请求头信息
  1141. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1142. // 验证失败
  1143. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1144. {
  1145. return actionResult;
  1146. }
  1147. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1148. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1149. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1150. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1151. {
  1152. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1153. actionResult.Status = (int)Constant.PDAResult.Success;
  1154. }
  1155. else
  1156. {
  1157. actionResult.Status = (int)Constant.PDAResult.Fail;
  1158. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1159. }
  1160. }
  1161. catch (Exception ex)
  1162. {
  1163. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1164. OutputLog.TraceLog(LogPriority.Error,
  1165. this.ToString(),
  1166. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1167. ex.ToString(),
  1168. LocalPath.LogExePath);
  1169. actionResult.Status = (int)Constant.PDAResult.Exception;
  1170. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1171. }
  1172. return actionResult;
  1173. }
  1174. /// <summary>
  1175. /// 获得产品分级
  1176. /// </summary>
  1177. /// <param name="accountCode">帐套code</param>
  1178. /// <param name="userCode">用户code</param>
  1179. /// <param name="userPassword">用户密码</param>
  1180. /// <param name="sessionKey">本次登陆密钥</param>
  1181. /// <returns></returns>
  1182. /// <remarks>
  1183. /// 陈冰 2014.10.08 新建
  1184. /// </remarks>
  1185. public ActionResult GetGoodsGradeDataGet(string accountCode, string userCode, string userPassword, string sessionKey)
  1186. {
  1187. ActionResult actionResult = new ActionResult();
  1188. try
  1189. {
  1190. // 验证请求头信息
  1191. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1192. // 验证失败
  1193. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1194. {
  1195. return actionResult;
  1196. }
  1197. #region 构造产品分级的数据源
  1198. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1199. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2, sUserInfo);
  1200. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1201. {
  1202. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1203. actionResult.Status = (int)Constant.PDAResult.Success;
  1204. }
  1205. else
  1206. {
  1207. actionResult.Status = (int)Constant.PDAResult.Fail;
  1208. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1209. }
  1210. #endregion
  1211. }
  1212. catch (Exception ex)
  1213. {
  1214. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1215. OutputLog.TraceLog(LogPriority.Error,
  1216. this.ToString(),
  1217. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1218. ex.ToString(),
  1219. LocalPath.LogExePath);
  1220. OutputLog.TraceLog(LogPriority.Error,
  1221. this.ToString(),
  1222. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1223. ex.ToString(),
  1224. LocalPath.LogExePath);
  1225. actionResult.Status = (int)Constant.PDAResult.Exception;
  1226. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1227. }
  1228. return actionResult;
  1229. }
  1230. #endregion
  1231. #region 保存检验条码
  1232. /// <summary>
  1233. /// 保存检验条码
  1234. /// </summary>
  1235. /// <param name="accountCode">帐套code</param>
  1236. /// <param name="userCode">用户code</param>
  1237. /// <param name="userPassword">用户密码</param>
  1238. /// <param name="sessionKey">本次登陆密钥</param>
  1239. /// <param name="procedureID">工序ID</param>
  1240. /// <param name="productionDataEntitys">条码信息</param>
  1241. /// <returns></returns>
  1242. public ActionResult AddCheckBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1243. {
  1244. ActionResult actionResult = new ActionResult();
  1245. try
  1246. {
  1247. // 验证请求头信息
  1248. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1249. // 验证失败
  1250. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1251. {
  1252. return actionResult;
  1253. }
  1254. //if(productionDataEntitys.Length>0)
  1255. //{
  1256. // if(productionDataEntitys[0].ProductionDataID>0)
  1257. // {
  1258. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1259. // }
  1260. //}
  1261. string err = ServiceInvoker.Invoke<string>(this,
  1262. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1263. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1264. if (err == null)
  1265. {
  1266. err = "";
  1267. }
  1268. //actionResult.Result = JsonHelper.ToJson(err);
  1269. actionResult.Result = err;// JsonHelper.ToJson(err);
  1270. actionResult.Status = (int)Constant.PDAResult.Success;
  1271. }
  1272. catch (Exception ex)
  1273. {
  1274. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1275. OutputLog.TraceLog(LogPriority.Error,
  1276. this.ToString(),
  1277. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1278. ex.ToString(),
  1279. LocalPath.LogExePath);
  1280. actionResult.Status = (int)Constant.PDAResult.Exception;
  1281. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1282. }
  1283. return actionResult;
  1284. }
  1285. #endregion
  1286. #region 文件上传下载
  1287. /// <summary>
  1288. /// 软件更新
  1289. /// </summary>
  1290. /// <param name="accountCode">帐套code</param>
  1291. /// <param name="userCode">用户code</param>
  1292. /// <param name="userPassword">用户密码</param>
  1293. /// <param name="sessionKey">本次登陆密钥</param>
  1294. /// <returns></returns>
  1295. public Stream AutoUpgradeGet(string accountCode, string userCode, string userPassword, string sessionKey)
  1296. {
  1297. try
  1298. {
  1299. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1300. }
  1301. catch (Exception ex)
  1302. {
  1303. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1304. OutputLog.TraceLog(LogPriority.Error,
  1305. this.ToString(),
  1306. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1307. ex.ToString(),
  1308. LocalPath.LogExePath);
  1309. return null;
  1310. }
  1311. }
  1312. /// <summary>
  1313. /// 上传临时文件
  1314. /// </summary>
  1315. /// <param name="imgStream"></param>
  1316. /// <returns></returns>
  1317. public ActionResult SaveImgGet(Stream mageStream)
  1318. {
  1319. ActionResult actionResult = new ActionResult();
  1320. try
  1321. {
  1322. string err = PDAModuleLogic.SaveImg(mageStream);
  1323. if (err == null)
  1324. {
  1325. err = "";
  1326. }
  1327. actionResult.Result = err;
  1328. actionResult.Status = (int)Constant.PDAResult.Success;
  1329. }
  1330. catch (Exception ex)
  1331. {
  1332. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1333. OutputLog.TraceLog(LogPriority.Error,
  1334. this.ToString(),
  1335. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1336. ex.ToString(),
  1337. LocalPath.LogExePath);
  1338. actionResult.Status = (int)Constant.PDAResult.Exception;
  1339. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1340. }
  1341. return actionResult;
  1342. }
  1343. public Stream GetFileTestGet(string path)
  1344. {
  1345. return PDAModuleLogic.GetImg(path);
  1346. }
  1347. public Stream GetFileStreamGet()
  1348. {
  1349. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1350. long l = fs.Length;
  1351. return fs;
  1352. }
  1353. public byte[] GetFileTestByteGet(string path)
  1354. {
  1355. FileStream stream = new FileInfo(path).OpenRead();
  1356. Byte[] buffer = new Byte[stream.Length];
  1357. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1358. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1359. return buffer;
  1360. }
  1361. public string GetFileGet(string path)
  1362. {
  1363. string imgFilePath = path;
  1364. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1365. int i = (int)fs.Length;
  1366. byte[] content = new byte[i];
  1367. fs.Read(content, 0, i);
  1368. string result = Convert.ToBase64String(content);
  1369. fs.Close();
  1370. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1371. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1372. sw.Write(result);
  1373. sw.Close();
  1374. fsTxt.Close();
  1375. return result;
  1376. }
  1377. #endregion
  1378. /// <summary>
  1379. /// 获得产品分级
  1380. /// </summary>
  1381. /// <param name="accountCode">帐套code</param>
  1382. /// <param name="userCode">用户code</param>
  1383. /// <param name="userPassword">用户密码</param>
  1384. /// <param name="sessionKey">本次登陆密钥</param>
  1385. /// <param name="procedureID">当前工序ID</param>
  1386. /// <returns></returns>
  1387. /// <remarks>
  1388. /// 陈冰 2014.10.22 新建
  1389. /// </remarks>
  1390. public ActionResult GetReworkProcedureByProcedureIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1391. {
  1392. ActionResult actionResult = new ActionResult();
  1393. try
  1394. {
  1395. // 验证请求头信息
  1396. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1397. // 验证失败
  1398. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1399. {
  1400. return actionResult;
  1401. }
  1402. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1403. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1404. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1405. {
  1406. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1407. actionResult.Status = (int)Constant.PDAResult.Success;
  1408. }
  1409. else
  1410. {
  1411. actionResult.Status = (int)Constant.PDAResult.Fail;
  1412. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1413. }
  1414. }
  1415. catch (Exception ex)
  1416. {
  1417. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1418. OutputLog.TraceLog(LogPriority.Error,
  1419. this.ToString(),
  1420. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1421. ex.ToString(),
  1422. LocalPath.LogExePath);
  1423. actionResult.Status = (int)Constant.PDAResult.Exception;
  1424. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1425. }
  1426. return actionResult;
  1427. }
  1428. /// <summary>
  1429. /// 获得产品分级
  1430. /// </summary>
  1431. /// <param name="accountCode">帐套code</param>
  1432. /// <param name="userCode">用户code</param>
  1433. /// <param name="userPassword">用户密码</param>
  1434. /// <param name="sessionKey">本次登陆密钥</param>
  1435. /// <param name="barcode">条码</param>
  1436. /// <returns></returns>
  1437. public ActionResult GetKilnCarByBarCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1438. {
  1439. ActionResult actionResult = new ActionResult();
  1440. try
  1441. {
  1442. // 验证请求头信息
  1443. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1444. // 验证失败
  1445. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1446. {
  1447. return actionResult;
  1448. }
  1449. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1450. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1451. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1452. {
  1453. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1454. actionResult.Status = (int)Constant.PDAResult.Success;
  1455. }
  1456. else
  1457. {
  1458. actionResult.Status = (int)Constant.PDAResult.Fail;
  1459. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1460. }
  1461. }
  1462. catch (Exception ex)
  1463. {
  1464. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1465. OutputLog.TraceLog(LogPriority.Error,
  1466. this.ToString(),
  1467. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1468. ex.ToString(),
  1469. LocalPath.LogExePath);
  1470. actionResult.Status = (int)Constant.PDAResult.Exception;
  1471. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1472. }
  1473. return actionResult;
  1474. }
  1475. #region 统计
  1476. /// <summary>
  1477. /// 统计当日计数数量
  1478. /// </summary>
  1479. /// <param name="accountCode">帐套code</param>
  1480. /// <param name="userCode">用户code</param>
  1481. /// <param name="userPassword">用户密码</param>
  1482. /// <param name="sessionKey">本次登陆密钥</param>
  1483. /// <param name="procedureID">工序ID</param>
  1484. /// <returns></returns>
  1485. public ActionResult StatisticsCollectBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1486. {
  1487. ActionResult actionResult = new ActionResult();
  1488. try
  1489. {
  1490. // 验证请求头信息
  1491. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1492. // 验证失败
  1493. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1494. {
  1495. return actionResult;
  1496. }
  1497. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1498. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1499. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1500. {
  1501. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1502. actionResult.Status = (int)Constant.PDAResult.Success;
  1503. }
  1504. else
  1505. {
  1506. actionResult.Status = (int)Constant.PDAResult.Fail;
  1507. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1508. }
  1509. }
  1510. catch (Exception ex)
  1511. {
  1512. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1513. OutputLog.TraceLog(LogPriority.Error,
  1514. this.ToString(),
  1515. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1516. ex.ToString(),
  1517. LocalPath.LogExePath);
  1518. actionResult.Status = (int)Constant.PDAResult.Exception;
  1519. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1520. }
  1521. return actionResult;
  1522. }
  1523. /// <summary>
  1524. /// 统计当日计数数量
  1525. /// </summary>
  1526. /// <param name="accountCode">帐套code</param>
  1527. /// <param name="userCode">用户code</param>
  1528. /// <param name="userPassword">用户密码</param>
  1529. /// <param name="sessionKey">本次登陆密钥</param>
  1530. /// <param name="procedureID">工序ID</param>
  1531. /// <returns></returns>
  1532. public ActionResult StatisticsKilnCarGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1533. {
  1534. ActionResult actionResult = new ActionResult();
  1535. try
  1536. {
  1537. // 验证请求头信息
  1538. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1539. // 验证失败
  1540. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1541. {
  1542. return actionResult;
  1543. }
  1544. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1545. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1546. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1547. {
  1548. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1549. actionResult.Status = (int)Constant.PDAResult.Success;
  1550. }
  1551. else
  1552. {
  1553. actionResult.Status = (int)Constant.PDAResult.Fail;
  1554. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1555. }
  1556. }
  1557. catch (Exception ex)
  1558. {
  1559. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1560. OutputLog.TraceLog(LogPriority.Error,
  1561. this.ToString(),
  1562. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1563. ex.ToString(),
  1564. LocalPath.LogExePath);
  1565. actionResult.Status = (int)Constant.PDAResult.Exception;
  1566. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1567. }
  1568. return actionResult;
  1569. }
  1570. /// <summary>
  1571. /// 统计产品跟踪
  1572. /// </summary>
  1573. /// <param name="accountCode">帐套code</param>
  1574. /// <param name="userCode">用户code</param>
  1575. /// <param name="userPassword">用户密码</param>
  1576. /// <param name="sessionKey">本次登陆密钥</param>
  1577. /// <param name="procedureID">工序ID</param>
  1578. /// <returns></returns>
  1579. public ActionResult StatisticsProductTrackGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1580. {
  1581. ActionResult actionResult = new ActionResult();
  1582. try
  1583. {
  1584. // 验证请求头信息
  1585. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1586. // 验证失败
  1587. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1588. {
  1589. return actionResult;
  1590. }
  1591. RPT020101_SE se = new RPT020101_SE();
  1592. se.Barcode = barcode;
  1593. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1594. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1595. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1596. {
  1597. actionResult.Status = (int)Constant.PDAResult.Fail;
  1598. actionResult.Message = Messages.MSG_CMN_I002;
  1599. }
  1600. else
  1601. {
  1602. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1603. actionResult.Status = (int)Constant.PDAResult.Success;
  1604. }
  1605. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1606. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1607. //if (productionDataEntity != null)
  1608. //{
  1609. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1610. // actionResult.Status = (int)Constant.PDAResult.Success;
  1611. //}
  1612. //else
  1613. //{
  1614. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1615. // actionResult.Message = Messages.MSG_CMN_I002;
  1616. //}
  1617. }
  1618. catch (Exception ex)
  1619. {
  1620. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1621. OutputLog.TraceLog(LogPriority.Error,
  1622. this.ToString(),
  1623. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1624. ex.ToString() + ex.HelpLink,
  1625. LocalPath.LogExePath);
  1626. actionResult.Status = (int)Constant.PDAResult.Exception;
  1627. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1628. }
  1629. return actionResult;
  1630. }
  1631. #endregion
  1632. #region 撤销装车及成检
  1633. /// <summary>
  1634. /// 检验条码是否可以撤销装车
  1635. /// </summary>
  1636. /// <param name="accountCode">帐套code</param>
  1637. /// <param name="userCode">用户code</param>
  1638. /// <param name="userPassword">用户密码</param>
  1639. /// <param name="sessionKey">本次登陆密钥</param>
  1640. /// <param name="procedureID">当前工序ID</param>
  1641. /// <param name="barcode">条码</param>
  1642. /// <returns></returns>
  1643. public ActionResult CheckCancelLoadCarGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1644. {
  1645. ActionResult actionResult = new ActionResult();
  1646. try
  1647. {
  1648. // 验证请求头信息
  1649. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1650. // 验证失败
  1651. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1652. {
  1653. return actionResult;
  1654. }
  1655. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1656. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1657. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1658. actionResult.Status = (int)Constant.PDAResult.Success;
  1659. }
  1660. catch (Exception ex)
  1661. {
  1662. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1663. OutputLog.TraceLog(LogPriority.Error,
  1664. this.ToString(),
  1665. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1666. ex.ToString(),
  1667. LocalPath.LogExePath);
  1668. actionResult.Status = (int)Constant.PDAResult.Exception;
  1669. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1670. }
  1671. return actionResult;
  1672. }
  1673. /// <summary>
  1674. /// 保存撤销装车的条码
  1675. /// </summary>
  1676. /// <param name="accountCode">帐套code</param>
  1677. /// <param name="userCode">用户code</param>
  1678. /// <param name="userPassword">用户密码</param>
  1679. /// <param name="sessionKey">本次登陆密钥</param>
  1680. /// <param name="procedureID">当前工序ID</param>
  1681. /// <param name="barcode">条码</param>
  1682. /// <returns></returns>
  1683. public ActionResult AddCancelLoadCarGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1684. {
  1685. ActionResult actionResult = new ActionResult();
  1686. try
  1687. {
  1688. // 验证请求头信息
  1689. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1690. // 验证失败
  1691. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1692. {
  1693. return actionResult;
  1694. }
  1695. string err = ServiceInvoker.Invoke<string>(this,
  1696. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1697. if (err == null)
  1698. {
  1699. err = "";
  1700. }
  1701. actionResult.Result = JsonHelper.ToJson(err);
  1702. actionResult.Status = (int)Constant.PDAResult.Success;
  1703. }
  1704. catch (Exception ex)
  1705. {
  1706. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1707. OutputLog.TraceLog(LogPriority.Error,
  1708. this.ToString(),
  1709. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1710. ex.ToString(),
  1711. LocalPath.LogExePath);
  1712. actionResult.Status = (int)Constant.PDAResult.Exception;
  1713. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1714. }
  1715. return actionResult;
  1716. }
  1717. /// <summary>
  1718. /// 由产品条码获取注浆信息
  1719. /// </summary>
  1720. /// <param name="barcode"></param>
  1721. /// <returns></returns>
  1722. public ActionResult GetGroutingProducttByBarCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1723. {
  1724. ActionResult actionResult = new ActionResult();
  1725. try
  1726. {
  1727. // 验证请求头信息
  1728. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1729. // 验证失败
  1730. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1731. {
  1732. return actionResult;
  1733. }
  1734. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1735. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1736. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1737. {
  1738. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1739. actionResult.Status = (int)Constant.PDAResult.Success;
  1740. }
  1741. else
  1742. {
  1743. actionResult.Status = (int)Constant.PDAResult.Fail;
  1744. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1745. }
  1746. }
  1747. catch (Exception ex)
  1748. {
  1749. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1750. OutputLog.TraceLog(LogPriority.Error,
  1751. this.ToString(),
  1752. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1753. ex.ToString(),
  1754. LocalPath.LogExePath);
  1755. actionResult.Status = (int)Constant.PDAResult.Exception;
  1756. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1757. }
  1758. return actionResult;
  1759. }
  1760. /// <summary>
  1761. /// 获取工号下的所有工种信息
  1762. /// </summary>
  1763. /// <param name="UserID">工号ID</param>
  1764. /// <returns></returns>
  1765. public ActionResult GetAllJobsByUserIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1766. {
  1767. ActionResult actionResult = new ActionResult();
  1768. try
  1769. {
  1770. // 验证请求头信息
  1771. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1772. // 验证失败
  1773. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1774. {
  1775. return actionResult;
  1776. }
  1777. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1778. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1779. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1780. {
  1781. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1782. actionResult.Status = (int)Constant.PDAResult.Success;
  1783. }
  1784. else
  1785. {
  1786. actionResult.Status = (int)Constant.PDAResult.Fail;
  1787. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1788. }
  1789. }
  1790. catch (Exception ex)
  1791. {
  1792. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1793. OutputLog.TraceLog(LogPriority.Error,
  1794. this.ToString(),
  1795. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1796. ex.ToString(),
  1797. LocalPath.LogExePath);
  1798. actionResult.Status = (int)Constant.PDAResult.Exception;
  1799. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1800. }
  1801. return actionResult;
  1802. }
  1803. /// <summary>
  1804. /// 根据所选工号对应的工种,查出缺陷责任员工
  1805. /// </summary>
  1806. /// <param name="jobs">工种ID</param>
  1807. /// <returns></returns>
  1808. public ActionResult GetDutyStaffByUserIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  1809. {
  1810. ActionResult actionResult = new ActionResult();
  1811. try
  1812. {
  1813. // 验证请求头信息
  1814. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1815. // 验证失败
  1816. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1817. {
  1818. return actionResult;
  1819. }
  1820. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1821. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  1822. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1823. {
  1824. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1825. actionResult.Status = (int)Constant.PDAResult.Success;
  1826. }
  1827. else
  1828. {
  1829. actionResult.Status = (int)Constant.PDAResult.Fail;
  1830. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1831. }
  1832. }
  1833. catch (Exception ex)
  1834. {
  1835. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1836. OutputLog.TraceLog(LogPriority.Error,
  1837. this.ToString(),
  1838. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1839. ex.ToString(),
  1840. LocalPath.LogExePath);
  1841. actionResult.Status = (int)Constant.PDAResult.Exception;
  1842. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1843. }
  1844. return actionResult;
  1845. }
  1846. /// <summary>
  1847. /// 根据所选工号,查出漏检责任员工
  1848. /// </summary>
  1849. /// <param name="userid">工号</param>
  1850. /// <returns></returns>
  1851. public ActionResult GetMissedStaffByUserIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  1852. {
  1853. ActionResult actionResult = new ActionResult();
  1854. try
  1855. {
  1856. // 验证请求头信息
  1857. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1858. // 验证失败
  1859. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1860. {
  1861. return actionResult;
  1862. }
  1863. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1864. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  1865. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1866. {
  1867. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1868. actionResult.Status = (int)Constant.PDAResult.Success;
  1869. }
  1870. else
  1871. {
  1872. actionResult.Status = (int)Constant.PDAResult.Fail;
  1873. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1874. }
  1875. }
  1876. catch (Exception ex)
  1877. {
  1878. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1879. OutputLog.TraceLog(LogPriority.Error,
  1880. this.ToString(),
  1881. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1882. ex.ToString(),
  1883. LocalPath.LogExePath);
  1884. actionResult.Status = (int)Constant.PDAResult.Exception;
  1885. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1886. }
  1887. return actionResult;
  1888. }
  1889. /// <summary>
  1890. /// 获取用户列表
  1891. /// </summary>
  1892. /// <param name="requestEntity">用户实体</param>
  1893. /// <returns></returns>
  1894. public ActionResult SearchUserDataGet(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  1895. {
  1896. ActionResult actionResult = new ActionResult();
  1897. try
  1898. {
  1899. // 验证请求头信息
  1900. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1901. // 验证失败
  1902. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1903. {
  1904. return actionResult;
  1905. }
  1906. SUserEntity requestEntity = new SUserEntity();
  1907. requestEntity.IsWorker = IsWorker;
  1908. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1909. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  1910. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1911. {
  1912. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1913. actionResult.Status = (int)Constant.PDAResult.Success;
  1914. }
  1915. else
  1916. {
  1917. actionResult.Status = (int)Constant.PDAResult.Fail;
  1918. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1919. }
  1920. }
  1921. catch (Exception ex)
  1922. {
  1923. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1924. OutputLog.TraceLog(LogPriority.Error,
  1925. this.ToString(),
  1926. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1927. ex.ToString(),
  1928. LocalPath.LogExePath);
  1929. actionResult.Status = (int)Constant.PDAResult.Exception;
  1930. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1931. }
  1932. return actionResult;
  1933. }
  1934. /// <summary>
  1935. /// 获取数据字典管理的数据
  1936. /// </summary>
  1937. /// <param name="Pvalue">显示停用标识</param>
  1938. /// <param name="dictionaryType">字典类别</param>
  1939. /// <returns></returns>
  1940. /// <remarks>
  1941. /// 2014.12.03 新建
  1942. /// </remarks>
  1943. public ActionResult GetDictionaryDataGet(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  1944. {
  1945. ActionResult actionResult = new ActionResult();
  1946. try
  1947. {
  1948. // 验证请求头信息
  1949. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1950. // 验证失败
  1951. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1952. {
  1953. return actionResult;
  1954. }
  1955. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1956. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  1957. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1958. {
  1959. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1960. actionResult.Status = (int)Constant.PDAResult.Success;
  1961. }
  1962. else
  1963. {
  1964. actionResult.Status = (int)Constant.PDAResult.Fail;
  1965. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1966. }
  1967. }
  1968. catch (Exception ex)
  1969. {
  1970. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1971. OutputLog.TraceLog(LogPriority.Error,
  1972. this.ToString(),
  1973. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1974. ex.ToString(),
  1975. LocalPath.LogExePath);
  1976. actionResult.Status = (int)Constant.PDAResult.Exception;
  1977. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1978. }
  1979. return actionResult;
  1980. }
  1981. #endregion
  1982. #region 保存半检数据
  1983. /// <summary>
  1984. /// 保存半检数据
  1985. /// </summary>
  1986. /// <param name="accountCode">帐套code</param>
  1987. /// <param name="userCode">用户code</param>
  1988. /// <param name="userPassword">用户密码</param>
  1989. /// <param name="sessionKey">本次登陆密钥</param>
  1990. /// <param name="productionDataEntitys">半检信息</param>
  1991. /// <returns></returns>
  1992. public ActionResult AddSemiTestGet(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  1993. {
  1994. ActionResult actionResult = new ActionResult();
  1995. try
  1996. {
  1997. // 验证请求头信息
  1998. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1999. // 验证失败
  2000. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2001. {
  2002. return actionResult;
  2003. }
  2004. string err = ServiceInvoker.Invoke<string>(this,
  2005. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2006. if (err == null)
  2007. {
  2008. err = "";
  2009. }
  2010. actionResult.Result = JsonHelper.ToJson(err);
  2011. actionResult.Status = (int)Constant.PDAResult.Success;
  2012. }
  2013. catch (Exception ex)
  2014. {
  2015. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2016. OutputLog.TraceLog(LogPriority.Error,
  2017. this.ToString(),
  2018. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2019. ex.ToString(),
  2020. LocalPath.LogExePath);
  2021. actionResult.Status = (int)Constant.PDAResult.Exception;
  2022. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2023. }
  2024. return actionResult;
  2025. }
  2026. #endregion
  2027. /// <summary>
  2028. /// 获取产品列表
  2029. /// </summary>
  2030. /// <returns></returns>
  2031. public ActionResult SerachGoodsGet(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  2032. {
  2033. ActionResult actionResult = new ActionResult();
  2034. try
  2035. {
  2036. // 验证请求头信息
  2037. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2038. // 验证失败
  2039. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2040. {
  2041. return actionResult;
  2042. }
  2043. GoodsEntity goodsEntity = new GoodsEntity();
  2044. goodsEntity.ValueFlag = 1;//有效标记
  2045. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2046. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2047. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2048. {
  2049. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2050. actionResult.Status = (int)Constant.PDAResult.Success;
  2051. }
  2052. else
  2053. {
  2054. actionResult.Status = (int)Constant.PDAResult.Fail;
  2055. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2056. }
  2057. }
  2058. catch (Exception ex)
  2059. {
  2060. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2061. OutputLog.TraceLog(LogPriority.Error,
  2062. this.ToString(),
  2063. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2064. ex.ToString(),
  2065. LocalPath.LogExePath);
  2066. actionResult.Status = (int)Constant.PDAResult.Exception;
  2067. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2068. }
  2069. return actionResult;
  2070. }
  2071. /// <summary>
  2072. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2073. /// </summary>
  2074. /// <param name="searchEntity">生产数据实体类</param>
  2075. /// <returns>DataTable</returns>
  2076. public ActionResult GetProductionDataGet(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2077. {
  2078. ActionResult actionResult = new ActionResult();
  2079. try
  2080. {
  2081. // 验证请求头信息
  2082. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2083. // 验证失败
  2084. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2085. {
  2086. return actionResult;
  2087. }
  2088. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2089. searchEntity.ProcedureID = ProcedureID;
  2090. searchEntity.BarCode = BarCode;
  2091. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2092. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2093. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2094. {
  2095. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2096. actionResult.Status = (int)Constant.PDAResult.Success;
  2097. }
  2098. else
  2099. {
  2100. actionResult.Status = (int)Constant.PDAResult.Fail;
  2101. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2102. }
  2103. }
  2104. catch (Exception ex)
  2105. {
  2106. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2107. OutputLog.TraceLog(LogPriority.Error,
  2108. this.ToString(),
  2109. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2110. ex.ToString(),
  2111. LocalPath.LogExePath);
  2112. actionResult.Status = (int)Constant.PDAResult.Exception;
  2113. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2114. }
  2115. return actionResult;
  2116. }
  2117. /// <summary>
  2118. /// 根据所选生产数据ID,显示成检数据信息
  2119. /// </summary>
  2120. /// <param name="productionDataID">生产数据ID</param>
  2121. /// <returns>DataSet</returns>
  2122. public ActionResult GetProductionDataByIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2123. {
  2124. ActionResult actionResult = new ActionResult();
  2125. try
  2126. {
  2127. // 验证请求头信息
  2128. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2129. // 验证失败
  2130. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2131. {
  2132. return actionResult;
  2133. }
  2134. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2135. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2136. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2137. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2138. {
  2139. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2140. {
  2141. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2142. {
  2143. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2144. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2145. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2146. {
  2147. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2148. }
  2149. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2150. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2151. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2152. {
  2153. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2154. }
  2155. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2156. {
  2157. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2158. }
  2159. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2160. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2161. {
  2162. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2163. }
  2164. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2165. {
  2166. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2167. }
  2168. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2169. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2170. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2171. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2172. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2173. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2174. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2175. {
  2176. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2177. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2178. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2179. }
  2180. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2181. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2182. {
  2183. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2184. }
  2185. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2186. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2187. DataTable dtDefect = dvDefect.ToTable();
  2188. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2189. {
  2190. // 产品缺陷
  2191. PDADefectResult defect = new PDADefectResult();
  2192. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2193. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2194. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2195. {
  2196. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2197. }
  2198. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2199. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2200. {
  2201. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2202. }
  2203. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2204. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2205. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2206. {
  2207. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2208. }
  2209. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2210. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2211. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2212. {
  2213. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2214. }
  2215. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2216. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2217. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2218. {
  2219. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2220. }
  2221. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2222. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2223. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2224. {
  2225. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2226. }
  2227. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2228. {
  2229. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2230. }
  2231. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2232. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2233. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2234. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2235. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2236. {
  2237. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2238. }
  2239. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2240. {
  2241. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2242. }
  2243. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2244. {
  2245. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2246. }
  2247. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2248. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2249. //--------责任员工-------------------
  2250. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2251. if (drRow.Length > Constant.INT_IS_ZERO)
  2252. {
  2253. foreach (DataRow r in drRow)
  2254. {
  2255. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2256. if (r["ProductionDefectID"].ToString() != "")
  2257. {
  2258. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2259. }
  2260. if (r["StaffID"].ToString() != "")
  2261. {
  2262. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2263. }
  2264. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2265. defectResponsible.StaffName = r["StaffName"].ToString();
  2266. if (r["StaffStatus"].ToString() != "")
  2267. {
  2268. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2269. }
  2270. if (r["UJobsID"].ToString() != "")
  2271. {
  2272. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2273. }
  2274. if (r["SJobsID"].ToString() != "")
  2275. {
  2276. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2277. }
  2278. defect.PDADefectResponsibles.Add(defectResponsible);
  2279. }
  2280. }
  2281. //------------------------------
  2282. //--------漏检员工-------------------
  2283. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2284. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2285. {
  2286. foreach (DataRow r in drMissedRow)
  2287. {
  2288. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2289. if (r["ProductionDefectID"].ToString() != "")
  2290. {
  2291. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2292. }
  2293. if (r["StaffID"].ToString() != "")
  2294. {
  2295. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2296. }
  2297. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2298. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2299. if (r["StaffStatus"].ToString() != "")
  2300. {
  2301. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2302. }
  2303. if (r["UJobsID"].ToString() != "")
  2304. {
  2305. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2306. }
  2307. if (r["SJobsID"].ToString() != "")
  2308. {
  2309. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2310. }
  2311. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2312. }
  2313. }
  2314. //------------------------------
  2315. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2316. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2317. {
  2318. foreach (DataRow r in drImageRow)
  2319. {
  2320. PDADefectImageResult defectImage = new PDADefectImageResult();
  2321. if (r["ProductionDefectID"].ToString() != "")
  2322. {
  2323. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2324. }
  2325. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2326. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2327. //{
  2328. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2329. //}
  2330. defect.PDADefectImageResults.Add(defectImage);
  2331. }
  2332. }
  2333. productionData.PDADefects.Add(defect);
  2334. }
  2335. if (productionDatas.PDAProductionData == null)
  2336. {
  2337. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2338. }
  2339. productionDatas.PDAProductionData.Add(productionData);
  2340. //---------------------------------------------------------------------------------
  2341. }
  2342. }
  2343. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2344. actionResult.Status = (int)Constant.PDAResult.Success;
  2345. }
  2346. else
  2347. {
  2348. actionResult.Status = (int)Constant.PDAResult.Fail;
  2349. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2350. }
  2351. }
  2352. catch (Exception ex)
  2353. {
  2354. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2355. OutputLog.TraceLog(LogPriority.Error,
  2356. this.ToString(),
  2357. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2358. ex.ToString(),
  2359. LocalPath.LogExePath);
  2360. actionResult.Status = (int)Constant.PDAResult.Exception;
  2361. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2362. }
  2363. return actionResult;
  2364. }
  2365. /// <summary>
  2366. /// 编辑后删除生产数据
  2367. /// </summary>
  2368. /// <param name="productionDataID">生产数据ID</param>
  2369. /// <returns>int</returns>
  2370. public ActionResult DeleteProductionDataByIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2371. {
  2372. ActionResult actionResult = new ActionResult();
  2373. try
  2374. {
  2375. // 验证请求头信息
  2376. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2377. // 验证失败
  2378. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2379. {
  2380. return actionResult;
  2381. }
  2382. int row = ServiceInvoker.Invoke<int>(this,
  2383. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2384. actionResult.Result = JsonHelper.ToJson(row);
  2385. actionResult.Status = (int)Constant.PDAResult.Success;
  2386. }
  2387. catch (Exception ex)
  2388. {
  2389. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2390. OutputLog.TraceLog(LogPriority.Error,
  2391. this.ToString(),
  2392. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2393. ex.ToString(),
  2394. LocalPath.LogExePath);
  2395. actionResult.Status = (int)Constant.PDAResult.Exception;
  2396. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2397. }
  2398. return actionResult;
  2399. }
  2400. /// <summary>
  2401. /// 获取产品完成工序的ID
  2402. /// </summary>
  2403. /// <param name="barcode">产品条码</param>
  2404. /// <returns>int</returns>
  2405. public ActionResult GetCompleteProcedureIDGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2406. {
  2407. ActionResult actionResult = new ActionResult();
  2408. try
  2409. {
  2410. // 验证请求头信息
  2411. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2412. // 验证失败
  2413. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2414. {
  2415. return actionResult;
  2416. }
  2417. int row = ServiceInvoker.Invoke<int>(this,
  2418. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2419. actionResult.Result = JsonHelper.ToJson(row);
  2420. actionResult.Status = (int)Constant.PDAResult.Success;
  2421. }
  2422. catch (Exception ex)
  2423. {
  2424. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2425. OutputLog.TraceLog(LogPriority.Error,
  2426. this.ToString(),
  2427. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2428. ex.ToString(),
  2429. LocalPath.LogExePath);
  2430. actionResult.Status = (int)Constant.PDAResult.Exception;
  2431. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2432. }
  2433. return actionResult;
  2434. }
  2435. /// <summary>
  2436. /// 绑定图片
  2437. /// </summary>
  2438. /// <param name="accountCode">帐套code</param>
  2439. /// <param name="userCode">用户code</param>
  2440. /// <param name="userPassword">用户密码</param>
  2441. /// <param name="sessionKey">本次登陆密钥</param>
  2442. /// <param name="imagePath">图片路径</param>
  2443. /// <returns></returns>
  2444. public Stream BindDefectImageGet(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2445. {
  2446. try
  2447. {
  2448. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2449. }
  2450. catch (Exception ex)
  2451. {
  2452. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2453. OutputLog.TraceLog(LogPriority.Error,
  2454. this.ToString(),
  2455. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2456. ex.ToString(),
  2457. LocalPath.LogExePath);
  2458. return null;
  2459. }
  2460. }
  2461. /// <summary>
  2462. /// 根据所选工号对应的工种,查出缺陷责任员工
  2463. /// </summary>
  2464. /// <param name="jobs">工种ID</param>
  2465. /// <returns></returns>
  2466. public ActionResult GetDutyStaffByUserJobsIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2467. {
  2468. ActionResult actionResult = new ActionResult();
  2469. try
  2470. {
  2471. // 验证请求头信息
  2472. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2473. // 验证失败
  2474. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2475. {
  2476. return actionResult;
  2477. }
  2478. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2479. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2480. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2481. {
  2482. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2483. actionResult.Status = (int)Constant.PDAResult.Success;
  2484. }
  2485. else
  2486. {
  2487. actionResult.Status = (int)Constant.PDAResult.Fail;
  2488. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2489. }
  2490. }
  2491. catch (Exception ex)
  2492. {
  2493. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2494. OutputLog.TraceLog(LogPriority.Error,
  2495. this.ToString(),
  2496. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2497. ex.ToString(),
  2498. LocalPath.LogExePath);
  2499. actionResult.Status = (int)Constant.PDAResult.Exception;
  2500. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2501. }
  2502. return actionResult;
  2503. }
  2504. #region 产品报废
  2505. /// <summary>
  2506. /// 验证废弃产品唯一性
  2507. /// </summary>
  2508. /// <param name="barcode">产品条码</param>
  2509. /// <returns>int</returns>
  2510. public ActionResult ScrapProductChackGet(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2511. {
  2512. ActionResult actionResult = new ActionResult();
  2513. try
  2514. {
  2515. // 验证请求头信息
  2516. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2517. // 验证失败
  2518. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2519. {
  2520. return actionResult;
  2521. }
  2522. string row = ServiceInvoker.Invoke<string>(this,
  2523. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2524. string[] rm = row.Split(':');
  2525. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2526. if (rm.Length > 1)
  2527. {
  2528. actionResult.Message = rm[1];
  2529. }
  2530. actionResult.Status = (int)Constant.PDAResult.Success;
  2531. }
  2532. catch (Exception ex)
  2533. {
  2534. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2535. OutputLog.TraceLog(LogPriority.Error,
  2536. this.ToString(),
  2537. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2538. ex.ToString(),
  2539. LocalPath.LogExePath);
  2540. actionResult.Status = (int)Constant.PDAResult.Exception;
  2541. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2542. }
  2543. return actionResult;
  2544. }
  2545. /// <summary>
  2546. /// 根据条码获取该产品的在产信息以及生产数据
  2547. /// </summary>
  2548. /// <param name="Barcode">产品条码</param>
  2549. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2550. public ActionResult GetInProductionAndProductionDataGet(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2551. {
  2552. ActionResult actionResult = new ActionResult();
  2553. try
  2554. {
  2555. // 验证请求头信息
  2556. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2557. // 验证失败
  2558. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2559. {
  2560. return actionResult;
  2561. }
  2562. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2563. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2564. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2565. {
  2566. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2567. actionResult.Status = (int)Constant.PDAResult.Success;
  2568. }
  2569. else
  2570. {
  2571. actionResult.Status = (int)Constant.PDAResult.Fail;
  2572. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2573. }
  2574. }
  2575. catch (Exception ex)
  2576. {
  2577. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2578. OutputLog.TraceLog(LogPriority.Error,
  2579. this.ToString(),
  2580. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2581. ex.ToString(),
  2582. LocalPath.LogExePath);
  2583. actionResult.Status = (int)Constant.PDAResult.Exception;
  2584. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2585. }
  2586. return actionResult;
  2587. }
  2588. /// <summary>
  2589. /// 根据工号查询员工档案信息
  2590. /// </summary>
  2591. /// <param name="accountCode"></param>
  2592. /// <param name="userCode"></param>
  2593. /// <param name="userPassword"></param>
  2594. /// <param name="sessionKey"></param>
  2595. /// <param name="userId"></param>
  2596. /// <returns></returns>
  2597. public ActionResult SearchHrStaffInfoGet(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2598. {
  2599. ActionResult actionResult = new ActionResult();
  2600. try
  2601. {
  2602. // 验证请求头信息
  2603. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2604. // 验证失败
  2605. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2606. {
  2607. return actionResult;
  2608. }
  2609. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2610. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2611. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2612. {
  2613. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2614. actionResult.Status = (int)Constant.PDAResult.Success;
  2615. }
  2616. else
  2617. {
  2618. actionResult.Status = (int)Constant.PDAResult.Fail;
  2619. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2620. }
  2621. }
  2622. catch (Exception ex)
  2623. {
  2624. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2625. OutputLog.TraceLog(LogPriority.Error,
  2626. this.ToString(),
  2627. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2628. ex.ToString(),
  2629. LocalPath.LogExePath);
  2630. actionResult.Status = (int)Constant.PDAResult.Exception;
  2631. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2632. }
  2633. return actionResult;
  2634. }
  2635. /// <summary>
  2636. /// 添加废弃产品记录
  2637. /// </summary>
  2638. /// <param name="SProductEntity">废弃产品实体</param>
  2639. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2640. /// <param name="SResponsibleList">责任者集合</param>
  2641. /// <param name="userInfo">用户基本信息</param>
  2642. /// <returns>int结果返回值</returns>
  2643. /// <remarks>
  2644. /// 庄天威 2014.09.24 新建
  2645. /// </remarks>
  2646. public ActionResult AddScrapProductGet(string accountCode, string userCode, string userPassword, string sessionKey,
  2647. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2648. ScrapResponsibleEntity[] SResponsibleList)
  2649. {
  2650. ActionResult actionResult = new ActionResult();
  2651. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2652. {
  2653. actionResult.Status = (int)Constant.PDAResult.Fail;
  2654. actionResult.Message = "没有选择责任人";
  2655. }
  2656. try
  2657. {
  2658. // 验证请求头信息
  2659. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2660. // 验证失败
  2661. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2662. {
  2663. return actionResult;
  2664. }
  2665. int addRow = ServiceInvoker.Invoke<int>(this,
  2666. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  2667. actionResult.Result = JsonHelper.ToJson(addRow);
  2668. actionResult.Status = (int)Constant.PDAResult.Success;
  2669. }
  2670. catch (Exception ex)
  2671. {
  2672. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2673. OutputLog.TraceLog(LogPriority.Error,
  2674. this.ToString(),
  2675. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2676. ex.ToString(),
  2677. LocalPath.LogExePath);
  2678. actionResult.Status = (int)Constant.PDAResult.Exception;
  2679. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2680. // TODO 空指针异常问题检测
  2681. try
  2682. {
  2683. OutputLog.TraceLog(LogPriority.Error,
  2684. this.ToString(),
  2685. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2686. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  2687. LocalPath.LogExePath);
  2688. string json1 = JsonHelper.ToJson(SProductEntity);
  2689. OutputLog.TraceLog(LogPriority.Error,
  2690. this.ToString(),
  2691. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2692. "SProductEntity:" + json1,
  2693. LocalPath.LogExePath);
  2694. string json2 = JsonHelper.ToJson(RProcedureEntity);
  2695. OutputLog.TraceLog(LogPriority.Error,
  2696. this.ToString(),
  2697. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2698. "RProcedureEntity:" + json2,
  2699. LocalPath.LogExePath);
  2700. string json3 = JsonHelper.ToJson(SResponsibleList);
  2701. OutputLog.TraceLog(LogPriority.Error,
  2702. this.ToString(),
  2703. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2704. "SResponsibleList:" + json3,
  2705. LocalPath.LogExePath);
  2706. }
  2707. catch (Exception exc)
  2708. {
  2709. OutputLog.TraceLog(LogPriority.Error,
  2710. this.ToString(),
  2711. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2712. "参数输入异常:" + exc.Message,
  2713. LocalPath.LogExePath);
  2714. }
  2715. }
  2716. return actionResult;
  2717. }
  2718. /// <summary>
  2719. /// 获取产品分级的数据(根据ID)
  2720. /// </summary>
  2721. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  2722. /// <param name="GoodsLevelID">分类ID</param>
  2723. /// <param name="sUserInfo">用户基本信息</param>
  2724. /// <returns>DataSet</returns>
  2725. /// <remarks>
  2726. /// 2014.10.22 庄天威 新建
  2727. public ActionResult GetGoodsLevelDataByIdGet(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  2728. {
  2729. ActionResult actionResult = new ActionResult();
  2730. try
  2731. {
  2732. // 验证请求头信息
  2733. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2734. // 验证失败
  2735. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2736. {
  2737. return actionResult;
  2738. }
  2739. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2740. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  2741. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2742. {
  2743. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2744. actionResult.Status = (int)Constant.PDAResult.Success;
  2745. }
  2746. else
  2747. {
  2748. actionResult.Status = (int)Constant.PDAResult.Fail;
  2749. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2750. }
  2751. }
  2752. catch (Exception ex)
  2753. {
  2754. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2755. OutputLog.TraceLog(LogPriority.Error,
  2756. this.ToString(),
  2757. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2758. ex.ToString(),
  2759. LocalPath.LogExePath);
  2760. actionResult.Status = (int)Constant.PDAResult.Exception;
  2761. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2762. }
  2763. return actionResult;
  2764. }
  2765. /// <summary>
  2766. /// 获取账务日期
  2767. /// </summary>
  2768. /// <param name="accountCode"></param>
  2769. /// <param name="userCode"></param>
  2770. /// <param name="userPassword"></param>
  2771. /// <param name="sessionKey"></param>
  2772. /// <returns></returns>
  2773. public ActionResult GetAccountDateGet(string accountCode, string userCode, string userPassword, string sessionKey)
  2774. {
  2775. ActionResult actionResult = new ActionResult();
  2776. try
  2777. {
  2778. // 验证请求头信息
  2779. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2780. // 验证失败
  2781. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2782. {
  2783. return actionResult;
  2784. }
  2785. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  2786. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  2787. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2788. actionResult.Status = (int)Constant.PDAResult.Success;
  2789. }
  2790. catch (Exception ex)
  2791. {
  2792. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2793. OutputLog.TraceLog(LogPriority.Error,
  2794. this.ToString(),
  2795. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2796. ex.ToString(),
  2797. LocalPath.LogExePath);
  2798. actionResult.Status = (int)Constant.PDAResult.Exception;
  2799. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2800. }
  2801. return actionResult;
  2802. }
  2803. /// <summary>
  2804. /// 获取登陆帐户有无报损权限
  2805. /// </summary>
  2806. /// <param name="accountCode"></param>
  2807. /// <param name="userCode"></param>
  2808. /// <param name="userPassword"></param>
  2809. /// <param name="sessionKey"></param>
  2810. /// <param name="usercode">工号编码</param>
  2811. /// <returns></returns>
  2812. public ActionResult GetScrapFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  2813. {
  2814. ActionResult actionResult = new ActionResult();
  2815. try
  2816. {
  2817. // 验证请求头信息
  2818. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2819. // 验证失败
  2820. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2821. {
  2822. return actionResult;
  2823. }
  2824. int returnValue = ServiceInvoker.Invoke<int>(this,
  2825. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  2826. actionResult.Result = JsonHelper.ToJson(returnValue);
  2827. actionResult.Status = (int)Constant.PDAResult.Success;
  2828. }
  2829. catch (Exception ex)
  2830. {
  2831. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2832. OutputLog.TraceLog(LogPriority.Error,
  2833. this.ToString(),
  2834. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2835. ex.ToString(),
  2836. LocalPath.LogExePath);
  2837. actionResult.Status = (int)Constant.PDAResult.Exception;
  2838. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2839. }
  2840. return actionResult;
  2841. }
  2842. #endregion
  2843. /// <summary>
  2844. /// 获取是否存在报损未审核产品
  2845. /// </summary>
  2846. /// <param name="barcode">产品条码</param>
  2847. /// <returns>int</returns>
  2848. public ActionResult GetScrapProductAuditStatusGet(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2849. {
  2850. ActionResult actionResult = new ActionResult();
  2851. try
  2852. {
  2853. // 验证请求头信息
  2854. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2855. // 验证失败
  2856. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2857. {
  2858. return actionResult;
  2859. }
  2860. int row = ServiceInvoker.Invoke<int>(this,
  2861. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  2862. actionResult.Result = JsonHelper.ToJson(row);
  2863. actionResult.Status = (int)Constant.PDAResult.Success;
  2864. }
  2865. catch (Exception ex)
  2866. {
  2867. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2868. OutputLog.TraceLog(LogPriority.Error,
  2869. this.ToString(),
  2870. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2871. ex.ToString(),
  2872. LocalPath.LogExePath);
  2873. actionResult.Status = (int)Constant.PDAResult.Exception;
  2874. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2875. }
  2876. return actionResult;
  2877. }
  2878. /// <summary>
  2879. /// 查询报废产品信息
  2880. /// </summary>
  2881. /// <param name="accountCode"></param>
  2882. /// <param name="userCode"></param>
  2883. /// <param name="userPassword"></param>
  2884. /// <param name="sessionKey"></param>
  2885. /// <param name="barCode">产品条码</param>
  2886. /// <param name="scrapProductID">报废产品ID</param>
  2887. /// <returns></returns>
  2888. public ActionResult GetScrapProductGet(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  2889. {
  2890. ActionResult actionResult = new ActionResult();
  2891. try
  2892. {
  2893. // 验证请求头信息
  2894. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2895. // 验证失败
  2896. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2897. {
  2898. return actionResult;
  2899. }
  2900. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  2901. selectProEntity.BarCode = barCode;
  2902. selectProEntity.ScrapProductID = scrapProductID;
  2903. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2904. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  2905. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2906. {
  2907. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2908. actionResult.Status = (int)Constant.PDAResult.Success;
  2909. }
  2910. else
  2911. {
  2912. actionResult.Status = (int)Constant.PDAResult.Fail;
  2913. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2914. }
  2915. }
  2916. catch (Exception ex)
  2917. {
  2918. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2919. OutputLog.TraceLog(LogPriority.Error,
  2920. this.ToString(),
  2921. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2922. ex.ToString(),
  2923. LocalPath.LogExePath);
  2924. actionResult.Status = (int)Constant.PDAResult.Exception;
  2925. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2926. }
  2927. return actionResult;
  2928. }
  2929. /// <summary>
  2930. /// 根据废弃产品ID获取责任工序
  2931. /// </summary>
  2932. /// <param name="accountCode"></param>
  2933. /// <param name="userCode"></param>
  2934. /// <param name="userPassword"></param>
  2935. /// <param name="sessionKey"></param>
  2936. /// <param name="scrapProductID">报废产品ID</param>
  2937. /// <returns></returns>
  2938. public ActionResult GetResponProcedureBySPIdGet(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  2939. {
  2940. ActionResult actionResult = new ActionResult();
  2941. try
  2942. {
  2943. // 验证请求头信息
  2944. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2945. // 验证失败
  2946. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2947. {
  2948. return actionResult;
  2949. }
  2950. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2951. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  2952. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2953. {
  2954. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2955. actionResult.Status = (int)Constant.PDAResult.Success;
  2956. }
  2957. else
  2958. {
  2959. actionResult.Status = (int)Constant.PDAResult.Fail;
  2960. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2961. }
  2962. }
  2963. catch (Exception ex)
  2964. {
  2965. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2966. OutputLog.TraceLog(LogPriority.Error,
  2967. this.ToString(),
  2968. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2969. ex.ToString(),
  2970. LocalPath.LogExePath);
  2971. actionResult.Status = (int)Constant.PDAResult.Exception;
  2972. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2973. }
  2974. return actionResult;
  2975. }
  2976. /// <summary>
  2977. /// 根据废弃产品ID获取责任人列表
  2978. /// </summary>
  2979. /// <param name="accountCode"></param>
  2980. /// <param name="userCode"></param>
  2981. /// <param name="userPassword"></param>
  2982. /// <param name="sessionKey"></param>
  2983. /// <param name="scrapProductID">报废产品ID</param>
  2984. /// <returns></returns>
  2985. public ActionResult GetScrapResponsibleBySPIdGet(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  2986. {
  2987. ActionResult actionResult = new ActionResult();
  2988. try
  2989. {
  2990. // 验证请求头信息
  2991. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2992. // 验证失败
  2993. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2994. {
  2995. return actionResult;
  2996. }
  2997. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2998. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  2999. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3000. {
  3001. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3002. actionResult.Status = (int)Constant.PDAResult.Success;
  3003. }
  3004. else
  3005. {
  3006. actionResult.Status = (int)Constant.PDAResult.Fail;
  3007. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3008. }
  3009. }
  3010. catch (Exception ex)
  3011. {
  3012. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3013. OutputLog.TraceLog(LogPriority.Error,
  3014. this.ToString(),
  3015. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3016. ex.ToString(),
  3017. LocalPath.LogExePath);
  3018. actionResult.Status = (int)Constant.PDAResult.Exception;
  3019. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3020. }
  3021. return actionResult;
  3022. }
  3023. /// <summary>
  3024. /// 添加废弃产品记录
  3025. /// </summary>
  3026. /// <param name="SProductEntity">废弃产品实体</param>
  3027. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3028. /// <param name="SResponsibleList">责任者集合</param>
  3029. /// <param name="userInfo">用户基本信息</param>
  3030. /// <returns>int结果返回值</returns>
  3031. /// <remarks>
  3032. /// 庄天威 2014.09.24 新建
  3033. /// </remarks>
  3034. public ActionResult UpdateScrapProductGet(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3035. ResponProcedureEntity UpdateRProcedureEntity,
  3036. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3037. {
  3038. ActionResult actionResult = new ActionResult();
  3039. try
  3040. {
  3041. // 验证请求头信息
  3042. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3043. // 验证失败
  3044. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3045. {
  3046. return actionResult;
  3047. }
  3048. int addRow = ServiceInvoker.Invoke<int>(this,
  3049. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3050. actionResult.Result = JsonHelper.ToJson(addRow);
  3051. actionResult.Status = (int)Constant.PDAResult.Success;
  3052. }
  3053. catch (Exception ex)
  3054. {
  3055. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3056. OutputLog.TraceLog(LogPriority.Error,
  3057. this.ToString(),
  3058. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3059. ex.ToString(),
  3060. LocalPath.LogExePath);
  3061. actionResult.Status = (int)Constant.PDAResult.Exception;
  3062. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3063. }
  3064. return actionResult;
  3065. }
  3066. /// <summary>
  3067. /// 获取产品窑炉
  3068. /// </summary>
  3069. /// <param name="accountCode"></param>
  3070. /// <param name="userCode"></param>
  3071. /// <param name="userPassword"></param>
  3072. /// <param name="sessionKey"></param>
  3073. /// <returns>Datase</returns>
  3074. public ActionResult GetAllKilntInfoGet(string accountCode, string userCode, string userPassword, string sessionKey)
  3075. {
  3076. ActionResult actionResult = new ActionResult();
  3077. try
  3078. {
  3079. // 验证请求头信息
  3080. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3081. // 验证失败
  3082. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3083. {
  3084. return actionResult;
  3085. }
  3086. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3087. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3088. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3089. {
  3090. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3091. actionResult.Status = (int)Constant.PDAResult.Success;
  3092. }
  3093. else
  3094. {
  3095. actionResult.Status = (int)Constant.PDAResult.Fail;
  3096. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3097. }
  3098. }
  3099. catch (Exception ex)
  3100. {
  3101. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3102. OutputLog.TraceLog(LogPriority.Error,
  3103. this.ToString(),
  3104. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3105. ex.ToString(),
  3106. LocalPath.LogExePath);
  3107. actionResult.Status = (int)Constant.PDAResult.Exception;
  3108. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3109. }
  3110. return actionResult;
  3111. }
  3112. /// <summary>
  3113. /// 获取次品产品条码允许编辑
  3114. /// </summary>
  3115. /// <param name="accountCode"></param>
  3116. /// <param name="userCode"></param>
  3117. /// <param name="userPassword"></param>
  3118. /// <param name="sessionKey"></param>
  3119. /// <param name="barcode">产品条码</param>
  3120. /// <returns>Datase</returns>
  3121. public ActionResult GetSubstandardInfoGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3122. {
  3123. ActionResult actionResult = new ActionResult();
  3124. try
  3125. {
  3126. // 验证请求头信息
  3127. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3128. // 验证失败
  3129. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3130. {
  3131. return actionResult;
  3132. }
  3133. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3134. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3135. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3136. {
  3137. actionResult.Result = JsonHelper.ToJson(1);
  3138. actionResult.Status = (int)Constant.PDAResult.Success;
  3139. }
  3140. else
  3141. {
  3142. actionResult.Result = JsonHelper.ToJson(0);
  3143. actionResult.Status = (int)Constant.PDAResult.Fail;
  3144. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3145. }
  3146. }
  3147. catch (Exception ex)
  3148. {
  3149. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3150. OutputLog.TraceLog(LogPriority.Error,
  3151. this.ToString(),
  3152. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3153. ex.ToString(),
  3154. LocalPath.LogExePath);
  3155. actionResult.Status = (int)Constant.PDAResult.Exception;
  3156. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3157. }
  3158. return actionResult;
  3159. }
  3160. /// <summary>
  3161. /// 获取产品条码是否重烧
  3162. /// </summary>
  3163. /// <param name="accountCode"></param>
  3164. /// <param name="userCode"></param>
  3165. /// <param name="userPassword"></param>
  3166. /// <param name="sessionKey"></param>
  3167. /// <param name="barcode">产品条码</param>
  3168. /// <returns>Datase</returns>
  3169. public ActionResult GetReFineGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3170. {
  3171. ActionResult actionResult = new ActionResult();
  3172. try
  3173. {
  3174. // 验证请求头信息
  3175. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3176. // 验证失败
  3177. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3178. {
  3179. return actionResult;
  3180. }
  3181. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3182. () => PDAModuleLogic.GetReFine(barcode));
  3183. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3184. {
  3185. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3186. }
  3187. else
  3188. {
  3189. actionResult.Result = JsonHelper.ToJson(0);
  3190. }
  3191. actionResult.Status = (int)Constant.PDAResult.Success;
  3192. }
  3193. catch (Exception ex)
  3194. {
  3195. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3196. OutputLog.TraceLog(LogPriority.Error,
  3197. this.ToString(),
  3198. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3199. ex.ToString(),
  3200. LocalPath.LogExePath);
  3201. actionResult.Status = (int)Constant.PDAResult.Exception;
  3202. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3203. }
  3204. return actionResult;
  3205. }
  3206. /// <summary>
  3207. /// 获取登陆帐户有无成检编辑权限
  3208. /// </summary>
  3209. /// <param name="accountCode"></param>
  3210. /// <param name="userCode"></param>
  3211. /// <param name="userPassword"></param>
  3212. /// <param name="sessionKey"></param>
  3213. /// <param name="usercode">工号编码</param>
  3214. /// <returns></returns>
  3215. public ActionResult GetFinishedProductEditFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  3216. {
  3217. ActionResult actionResult = new ActionResult();
  3218. try
  3219. {
  3220. // 验证请求头信息
  3221. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3222. // 验证失败
  3223. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3224. {
  3225. return actionResult;
  3226. }
  3227. int returnValue = ServiceInvoker.Invoke<int>(this,
  3228. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3229. actionResult.Result = JsonHelper.ToJson(returnValue);
  3230. actionResult.Status = (int)Constant.PDAResult.Success;
  3231. }
  3232. catch (Exception ex)
  3233. {
  3234. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3235. OutputLog.TraceLog(LogPriority.Error,
  3236. this.ToString(),
  3237. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3238. ex.ToString(),
  3239. LocalPath.LogExePath);
  3240. actionResult.Status = (int)Constant.PDAResult.Exception;
  3241. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3242. }
  3243. return actionResult;
  3244. }
  3245. /// <summary>
  3246. /// 根据条码及工序判断是否漏扫
  3247. /// </summary>
  3248. /// <param name="accountCode"></param>
  3249. /// <param name="userCode"></param>
  3250. /// <param name="userPassword"></param>
  3251. /// <param name="sessionKey"></param>
  3252. /// <param name="usercode">工号编码</param>
  3253. /// <param name="barcode">产品条码</param>
  3254. /// <param name="produceid">工序ID</param>
  3255. /// <returns></returns>
  3256. public ActionResult AddBarCodeMissingGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3257. {
  3258. ActionResult actionResult = new ActionResult();
  3259. try
  3260. {
  3261. // 验证请求头信息
  3262. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3263. // 验证失败
  3264. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3265. {
  3266. return actionResult;
  3267. }
  3268. int returnValue = 1;
  3269. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3270. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3271. actionResult.Result = JsonHelper.ToJson(returnValue);
  3272. actionResult.Status = (int)Constant.PDAResult.Success;
  3273. }
  3274. catch (Exception ex)
  3275. {
  3276. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3277. OutputLog.TraceLog(LogPriority.Error,
  3278. this.ToString(),
  3279. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3280. ex.ToString(),
  3281. LocalPath.LogExePath);
  3282. actionResult.Status = (int)Constant.PDAResult.Exception;
  3283. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3284. }
  3285. return actionResult;
  3286. }
  3287. /// <summary>
  3288. /// 获取登陆帐户有无报损审批权限
  3289. /// </summary>
  3290. /// <param name="accountCode"></param>
  3291. /// <param name="userCode"></param>
  3292. /// <param name="userPassword"></param>
  3293. /// <param name="sessionKey"></param>
  3294. /// <param name="usercode">工号编码</param>
  3295. /// <returns></returns>
  3296. public ActionResult GetScrapProductFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  3297. {
  3298. ActionResult actionResult = new ActionResult();
  3299. try
  3300. {
  3301. // 验证请求头信息
  3302. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3303. // 验证失败
  3304. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3305. {
  3306. return actionResult;
  3307. }
  3308. int returnValue = ServiceInvoker.Invoke<int>(this,
  3309. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3310. actionResult.Result = JsonHelper.ToJson(returnValue);
  3311. actionResult.Status = (int)Constant.PDAResult.Success;
  3312. }
  3313. catch (Exception ex)
  3314. {
  3315. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3316. OutputLog.TraceLog(LogPriority.Error,
  3317. this.ToString(),
  3318. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3319. ex.ToString(),
  3320. LocalPath.LogExePath);
  3321. actionResult.Status = (int)Constant.PDAResult.Exception;
  3322. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3323. }
  3324. return actionResult;
  3325. }
  3326. /// <summary>
  3327. /// 获取登陆帐户有无报损审批权限
  3328. /// </summary>
  3329. /// <param name="accountCode"></param>
  3330. /// <param name="userCode"></param>
  3331. /// <param name="userPassword"></param>
  3332. /// <param name="sessionKey"></param>
  3333. /// <param name="usercode">工号编码</param>
  3334. /// <returns></returns>
  3335. public ActionResult GetSpecialRepairflagByBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3336. {
  3337. ActionResult actionResult = new ActionResult();
  3338. try
  3339. {
  3340. // 验证请求头信息
  3341. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3342. // 验证失败
  3343. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3344. {
  3345. return actionResult;
  3346. }
  3347. int returnValue = ServiceInvoker.Invoke<int>(this,
  3348. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3349. actionResult.Result = JsonHelper.ToJson(returnValue);
  3350. actionResult.Status = (int)Constant.PDAResult.Success;
  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="KilnCarID">窑车ID</param>
  3373. /// <returns>Dataset</returns>
  3374. public ActionResult GetKilnCarGoodsByKilnCarIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  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. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3388. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3389. {
  3390. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3391. actionResult.Status = (int)Constant.PDAResult.Success;
  3392. }
  3393. else
  3394. {
  3395. actionResult.Status = (int)Constant.PDAResult.Fail;
  3396. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3397. }
  3398. }
  3399. catch (Exception ex)
  3400. {
  3401. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3402. OutputLog.TraceLog(LogPriority.Error,
  3403. this.ToString(),
  3404. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3405. ex.ToString(),
  3406. LocalPath.LogExePath);
  3407. actionResult.Status = (int)Constant.PDAResult.Exception;
  3408. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3409. }
  3410. return actionResult;
  3411. }
  3412. /// <summary>
  3413. /// 更换条码
  3414. /// </summary>
  3415. /// <param name="accountCode"></param>
  3416. /// <param name="userCode"></param>
  3417. /// <param name="userPassword"></param>
  3418. /// <param name="sessionKey"></param>
  3419. ///<param name="barcode">原条码</param>
  3420. /// <param name="newBarcode">新条码</param>
  3421. /// <param name="remarks">备注</param>
  3422. /// <returns>操作结果</returns>
  3423. public ActionResult SaveBarCodeChangeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  3424. {
  3425. ActionResult actionResult = new ActionResult();
  3426. try
  3427. {
  3428. // 验证请求头信息
  3429. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3430. // 验证失败
  3431. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3432. {
  3433. return actionResult;
  3434. }
  3435. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3436. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3437. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3438. {
  3439. actionResult.Result = 1;
  3440. actionResult.Status = (int)Constant.PDAResult.Success;
  3441. }
  3442. else
  3443. {
  3444. actionResult.Status = (int)Constant.PDAResult.Fail;
  3445. actionResult.Message = serviceResultEntity.Message;
  3446. }
  3447. }
  3448. catch (Exception ex)
  3449. {
  3450. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3451. OutputLog.TraceLog(LogPriority.Error,
  3452. this.ToString(),
  3453. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3454. ex.ToString(),
  3455. LocalPath.LogExePath);
  3456. actionResult.Status = (int)Constant.PDAResult.Exception;
  3457. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3458. }
  3459. return actionResult;
  3460. }
  3461. /// <summary>
  3462. /// 获取(注浆登记)的查询数据
  3463. /// </summary>
  3464. /// <param name="accountCode"></param>
  3465. /// <param name="userCode"></param>
  3466. /// <param name="userPassword"></param>
  3467. /// <param name="sessionKey"></param>
  3468. /// <param name="se">查询条件</param>
  3469. /// <returns>Dataset</returns>
  3470. public ActionResult GetGroutingListGet(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  3471. {
  3472. ActionResult actionResult = new ActionResult();
  3473. try
  3474. {
  3475. // 验证请求头信息
  3476. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3477. // 验证失败
  3478. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3479. {
  3480. return actionResult;
  3481. }
  3482. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3483. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3484. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3485. {
  3486. // PDA不显示的列删除掉
  3487. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3488. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3489. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3490. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3491. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3492. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3493. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3494. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3495. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3496. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3497. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3498. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3499. actionResult.Status = (int)Constant.PDAResult.Success;
  3500. }
  3501. else
  3502. {
  3503. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3504. actionResult.Message = "无查询数据";
  3505. }
  3506. }
  3507. catch (Exception ex)
  3508. {
  3509. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3510. OutputLog.TraceLog(LogPriority.Error,
  3511. this.ToString(),
  3512. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3513. ex.ToString(),
  3514. LocalPath.LogExePath);
  3515. actionResult.Status = (int)Constant.PDAResult.Exception;
  3516. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3517. }
  3518. return actionResult;
  3519. }
  3520. /// <summary>
  3521. /// 获取(注浆登记)的查询数据
  3522. /// </summary>
  3523. /// <param name="accountCode"></param>
  3524. /// <param name="userCode"></param>
  3525. /// <param name="userPassword"></param>
  3526. /// <param name="sessionKey"></param>
  3527. /// <param name="se">查询条件</param>
  3528. /// <returns>Dataset</returns>
  3529. public ActionResult GetGroutingListByBarCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3530. {
  3531. ActionResult actionResult = new ActionResult();
  3532. try
  3533. {
  3534. // 验证请求头信息
  3535. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3536. // 验证失败
  3537. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3538. {
  3539. return actionResult;
  3540. }
  3541. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3542. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3543. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3544. {
  3545. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3546. actionResult.Status = (int)Constant.PDAResult.Success;
  3547. }
  3548. else
  3549. {
  3550. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3551. actionResult.Message = "无查询数据";
  3552. }
  3553. }
  3554. catch (Exception ex)
  3555. {
  3556. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3557. OutputLog.TraceLog(LogPriority.Error,
  3558. this.ToString(),
  3559. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3560. ex.ToString(),
  3561. LocalPath.LogExePath);
  3562. actionResult.Status = (int)Constant.PDAResult.Exception;
  3563. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3564. }
  3565. return actionResult;
  3566. }
  3567. /// <summary>
  3568. ///获得成型线信息
  3569. /// </summary>
  3570. /// <param name="accountCode"></param>
  3571. /// <param name="userCode"></param>
  3572. /// <param name="userPassword"></param>
  3573. /// <param name="sessionKey"></param>
  3574. /// <param name="se">查询条件</param>
  3575. /// <returns>Dataset</returns>
  3576. public ActionResult GetGroutingLineGet(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3577. {
  3578. ActionResult actionResult = new ActionResult();
  3579. try
  3580. {
  3581. // 验证请求头信息
  3582. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3583. // 验证失败
  3584. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3585. {
  3586. return actionResult;
  3587. }
  3588. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3589. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3590. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3591. {
  3592. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3593. actionResult.Status = (int)Constant.PDAResult.Success;
  3594. }
  3595. else
  3596. {
  3597. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3598. actionResult.Message = "无查询数据";
  3599. }
  3600. }
  3601. catch (Exception ex)
  3602. {
  3603. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3604. OutputLog.TraceLog(LogPriority.Error,
  3605. this.ToString(),
  3606. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3607. ex.ToString(),
  3608. LocalPath.LogExePath);
  3609. actionResult.Status = (int)Constant.PDAResult.Exception;
  3610. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3611. }
  3612. return actionResult;
  3613. }
  3614. /// <summary>
  3615. ///获取在产产品的信息标识列表
  3616. /// </summary>
  3617. /// <param name="accountCode"></param>
  3618. /// <param name="userCode"></param>
  3619. /// <param name="userPassword"></param>
  3620. /// <param name="sessionKey"></param>
  3621. /// <param name="barcode">查询条件</param>
  3622. /// <returns>Dataset</returns>
  3623. public ActionResult GetInProductionDataListGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3624. {
  3625. ActionResult actionResult = new ActionResult();
  3626. try
  3627. {
  3628. // 验证请求头信息
  3629. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3630. // 验证失败
  3631. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3632. {
  3633. return actionResult;
  3634. }
  3635. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3636. () => PMModuleLogic.GetInProductionDataList(barcode));
  3637. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3638. {
  3639. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3640. actionResult.Status = (int)Constant.PDAResult.Success;
  3641. }
  3642. else
  3643. {
  3644. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3645. actionResult.Message = "无查询数据";
  3646. }
  3647. }
  3648. catch (Exception ex)
  3649. {
  3650. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3651. OutputLog.TraceLog(LogPriority.Error,
  3652. this.ToString(),
  3653. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3654. ex.ToString(),
  3655. LocalPath.LogExePath);
  3656. actionResult.Status = (int)Constant.PDAResult.Exception;
  3657. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3658. }
  3659. return actionResult;
  3660. }
  3661. /// <summary>
  3662. ///获取条码是否注浆登记过,0行无效
  3663. /// </summary>
  3664. /// <param name="accountCode"></param>
  3665. /// <param name="userCode"></param>
  3666. /// <param name="userPassword"></param>
  3667. /// <param name="sessionKey"></param>
  3668. /// <param name="barcode">查询条件</param>
  3669. /// <returns>Dataset</returns>
  3670. public ActionResult GetBarCodeInGroutingDailyDetailGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3671. {
  3672. ActionResult actionResult = new ActionResult();
  3673. try
  3674. {
  3675. // 验证请求头信息
  3676. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3677. // 验证失败
  3678. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3679. {
  3680. return actionResult;
  3681. }
  3682. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3683. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  3684. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3685. {
  3686. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3687. actionResult.Status = (int)Constant.PDAResult.Success;
  3688. }
  3689. else
  3690. {
  3691. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3692. actionResult.Message = "该产品条码无效,无法报损!";
  3693. }
  3694. }
  3695. catch (Exception ex)
  3696. {
  3697. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3698. OutputLog.TraceLog(LogPriority.Error,
  3699. this.ToString(),
  3700. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3701. ex.ToString(),
  3702. LocalPath.LogExePath);
  3703. actionResult.Status = (int)Constant.PDAResult.Exception;
  3704. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3705. }
  3706. return actionResult;
  3707. }
  3708. /// <summary>
  3709. /// 获取登陆帐户有变更条码权限
  3710. /// </summary>
  3711. /// <param name="accountCode"></param>
  3712. /// <param name="userCode"></param>
  3713. /// <param name="userPassword"></param>
  3714. /// <param name="sessionKey"></param>
  3715. /// <returns></returns>
  3716. public ActionResult GetBarCodeRecordFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  3717. {
  3718. ActionResult actionResult = new ActionResult();
  3719. try
  3720. {
  3721. // 验证请求头信息
  3722. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3723. // 验证失败
  3724. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3725. {
  3726. return actionResult;
  3727. }
  3728. int returnValue = ServiceInvoker.Invoke<int>(this,
  3729. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  3730. actionResult.Result = JsonHelper.ToJson(returnValue);
  3731. actionResult.Status = (int)Constant.PDAResult.Success;
  3732. }
  3733. catch (Exception ex)
  3734. {
  3735. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3736. OutputLog.TraceLog(LogPriority.Error,
  3737. this.ToString(),
  3738. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3739. ex.ToString(),
  3740. LocalPath.LogExePath);
  3741. actionResult.Status = (int)Constant.PDAResult.Exception;
  3742. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3743. }
  3744. return actionResult;
  3745. }
  3746. /// <summary>
  3747. /// 成检时获取此条码是否报损
  3748. /// </summary>
  3749. /// <param name="accountCode"></param>
  3750. /// <param name="userCode"></param>
  3751. /// <param name="userPassword"></param>
  3752. /// <param name="sessionKey"></param>
  3753. /// <param name="barcode">产品条码</param>
  3754. /// <returns></returns>
  3755. public ActionResult CheckScrapProductGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3756. {
  3757. ActionResult actionResult = new ActionResult();
  3758. try
  3759. {
  3760. // 验证请求头信息
  3761. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3762. // 验证失败
  3763. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3764. {
  3765. return actionResult;
  3766. }
  3767. int returnValue = ServiceInvoker.Invoke<int>(this,
  3768. () => PMModuleLogic.CheckScrapProduct(barcode));
  3769. if (returnValue == -100)
  3770. {
  3771. actionResult.Result = JsonHelper.ToJson(returnValue);
  3772. actionResult.Status = (int)Constant.PDAResult.Success;
  3773. }
  3774. else
  3775. {
  3776. actionResult.Status = (int)Constant.PDAResult.Fail;
  3777. if (returnValue == 0)
  3778. {
  3779. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  3780. }
  3781. else
  3782. {
  3783. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  3784. }
  3785. }
  3786. }
  3787. catch (Exception ex)
  3788. {
  3789. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3790. OutputLog.TraceLog(LogPriority.Error,
  3791. this.ToString(),
  3792. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3793. ex.ToString(),
  3794. LocalPath.LogExePath);
  3795. actionResult.Status = (int)Constant.PDAResult.Exception;
  3796. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3797. }
  3798. return actionResult;
  3799. }
  3800. /// <summary>
  3801. /// 获取产品完成工序的ID(PDA)
  3802. /// </summary>
  3803. /// <param name="barcode">产品条码</param>
  3804. /// <returns>int</returns>
  3805. public ActionResult GetCompleteProcedureIDPDAGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3806. {
  3807. ActionResult actionResult = new ActionResult();
  3808. try
  3809. {
  3810. // 验证请求头信息
  3811. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3812. // 验证失败
  3813. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3814. {
  3815. return actionResult;
  3816. }
  3817. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3818. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  3819. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3820. actionResult.Status = (int)Constant.PDAResult.Success;
  3821. }
  3822. catch (Exception ex)
  3823. {
  3824. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3825. OutputLog.TraceLog(LogPriority.Error,
  3826. this.ToString(),
  3827. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3828. ex.ToString(),
  3829. LocalPath.LogExePath);
  3830. actionResult.Status = (int)Constant.PDAResult.Exception;
  3831. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3832. }
  3833. return actionResult;
  3834. }
  3835. /// <summary>
  3836. /// 获取产品完成工序的ID(PDA)
  3837. /// </summary>
  3838. /// <param name="barcode">产品条码</param>
  3839. /// <returns>int</returns>
  3840. public ActionResult GetGoodsInfoBybarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3841. {
  3842. ActionResult actionResult = new ActionResult();
  3843. try
  3844. {
  3845. // 验证请求头信息
  3846. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3847. // 验证失败
  3848. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3849. {
  3850. return actionResult;
  3851. }
  3852. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3853. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  3854. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3855. actionResult.Status = (int)Constant.PDAResult.Success;
  3856. }
  3857. catch (Exception ex)
  3858. {
  3859. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3860. OutputLog.TraceLog(LogPriority.Error,
  3861. this.ToString(),
  3862. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3863. ex.ToString(),
  3864. LocalPath.LogExePath);
  3865. actionResult.Status = (int)Constant.PDAResult.Exception;
  3866. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3867. }
  3868. return actionResult;
  3869. }
  3870. /// <summary>
  3871. /// 成检-校验生产工号
  3872. /// </summary>
  3873. /// <param name="usercode">生产工号</param>
  3874. /// <returns>int</returns>
  3875. public ActionResult GetUserCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string usercodep)
  3876. {
  3877. ActionResult actionResult = new ActionResult();
  3878. try
  3879. {
  3880. // 验证请求头信息
  3881. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3882. // 验证失败
  3883. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3884. {
  3885. return actionResult;
  3886. }
  3887. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3888. () => PDAModuleLogic.GetUserCode(usercodep, sUserInfo));
  3889. actionResult.Result = JsonHelper.ToJson(ds);
  3890. actionResult.Status = (int)Constant.PDAResult.Success;
  3891. }
  3892. catch (Exception ex)
  3893. {
  3894. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3895. OutputLog.TraceLog(LogPriority.Error,
  3896. this.ToString(),
  3897. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3898. ex.ToString(),
  3899. LocalPath.LogExePath);
  3900. actionResult.Status = (int)Constant.PDAResult.Exception;
  3901. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3902. }
  3903. return actionResult;
  3904. }
  3905. /// <summary>
  3906. /// 更新漏扫的成型工号
  3907. /// </summary>
  3908. /// <param name="accountCode"></param>
  3909. /// <param name="userCode"></param>
  3910. /// <param name="userPassword"></param>
  3911. /// <param name="sessionKey"></param>
  3912. /// <param name="groutingUserCode">成型工号</param>
  3913. /// <param name="missingID">漏扫ID</param>
  3914. /// <returns></returns>
  3915. public ActionResult UpdateGroutingUserCodeByMissingIDGet(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  3916. {
  3917. ActionResult actionResult = new ActionResult();
  3918. try
  3919. {
  3920. // 验证请求头信息
  3921. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3922. // 验证失败
  3923. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3924. {
  3925. return actionResult;
  3926. }
  3927. int returnValue = ServiceInvoker.Invoke<int>(this,
  3928. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  3929. if (returnValue != -1)
  3930. {
  3931. actionResult.Result = JsonHelper.ToJson(returnValue);
  3932. actionResult.Status = (int)Constant.PDAResult.Success;
  3933. }
  3934. else
  3935. {
  3936. actionResult.Status = (int)Constant.PDAResult.Fail;
  3937. actionResult.Message = "存在无效的漏扫工号";
  3938. }
  3939. }
  3940. catch (Exception ex)
  3941. {
  3942. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3943. OutputLog.TraceLog(LogPriority.Error,
  3944. this.ToString(),
  3945. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3946. ex.ToString(),
  3947. LocalPath.LogExePath);
  3948. actionResult.Status = (int)Constant.PDAResult.Exception;
  3949. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3950. }
  3951. return actionResult;
  3952. }
  3953. /// <summary>
  3954. /// 在入窑工序检验窑车号是否存在
  3955. /// </summary>
  3956. /// <param name="accountCode"></param>
  3957. /// <param name="userCode"></param>
  3958. /// <param name="userPassword"></param>
  3959. /// <param name="sessionKey"></param>
  3960. /// <param name="kilncarcode">窑车编码</param>
  3961. /// <param name="procedureid">工序ID</param>
  3962. /// <returns></returns>
  3963. public ActionResult CheckKilnCarByIntoCarGet(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  3964. {
  3965. ActionResult actionResult = new ActionResult();
  3966. try
  3967. {
  3968. // 验证请求头信息
  3969. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3970. // 验证失败
  3971. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3972. {
  3973. return actionResult;
  3974. }
  3975. int returnValue = ServiceInvoker.Invoke<int>(this,
  3976. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  3977. if (returnValue == 1)
  3978. {
  3979. actionResult.Result = JsonHelper.ToJson(returnValue);
  3980. actionResult.Status = (int)Constant.PDAResult.Success;
  3981. }
  3982. else
  3983. {
  3984. actionResult.Status = (int)Constant.PDAResult.Fail;
  3985. if (returnValue == -99)
  3986. actionResult.Message = "窑炉车号无效";
  3987. else if (returnValue == -98)
  3988. actionResult.Message = "窑车己无产品";
  3989. else if (returnValue == -97)
  3990. actionResult.Message = "窑车没有入窑,不可以撤销";
  3991. else if (returnValue == -1)
  3992. actionResult.Message = "保存失败";
  3993. }
  3994. }
  3995. catch (Exception ex)
  3996. {
  3997. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3998. OutputLog.TraceLog(LogPriority.Error,
  3999. this.ToString(),
  4000. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4001. ex.ToString(),
  4002. LocalPath.LogExePath);
  4003. actionResult.Status = (int)Constant.PDAResult.Exception;
  4004. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4005. }
  4006. return actionResult;
  4007. }
  4008. /// <summary>
  4009. /// 获取盘点单列表
  4010. /// </summary>
  4011. /// <param name="sUserInfo"></param>
  4012. /// <returns></returns>
  4013. public ActionResult GetInCheckedListGet(string accountCode, string userCode, string userPassword, string sessionKey)
  4014. {
  4015. ActionResult actionResult = new ActionResult();
  4016. try
  4017. {
  4018. // 验证请求头信息
  4019. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4020. // 验证失败
  4021. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4022. {
  4023. return actionResult;
  4024. }
  4025. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4026. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  4027. actionResult.Result = JsonHelper.ToJson(ds);
  4028. actionResult.Status = (int)Constant.PDAResult.Success;
  4029. }
  4030. catch (Exception ex)
  4031. {
  4032. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4033. OutputLog.TraceLog(LogPriority.Error,
  4034. this.ToString(),
  4035. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4036. ex.ToString(),
  4037. LocalPath.LogExePath);
  4038. actionResult.Status = (int)Constant.PDAResult.Exception;
  4039. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4040. }
  4041. return actionResult;
  4042. }
  4043. /// <summary>
  4044. /// 进行盘点操作
  4045. /// </summary>
  4046. /// <param name="accountCode"></param>
  4047. /// <param name="userCode"></param>
  4048. /// <param name="userPassword"></param>
  4049. /// <param name="sessionKey"></param>
  4050. /// <param name="InCheckedID">盘点单ID</param>
  4051. /// <param name="BarCode">产品条码</param>
  4052. /// <returns></returns>
  4053. public ActionResult UpdateInCheckedGet(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4054. {
  4055. ActionResult actionResult = new ActionResult();
  4056. try
  4057. {
  4058. // 验证请求头信息
  4059. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4060. // 验证失败
  4061. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4062. {
  4063. return actionResult;
  4064. }
  4065. int returnValue = ServiceInvoker.Invoke<int>(this,
  4066. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4067. if (returnValue > 0)
  4068. {
  4069. actionResult.Result = JsonHelper.ToJson(returnValue);
  4070. actionResult.Status = (int)Constant.PDAResult.Success;
  4071. actionResult.Message = "产品" + BarCode + "盘点成功";
  4072. }
  4073. else if (returnValue == 10)
  4074. {
  4075. actionResult.Result = JsonHelper.ToJson(returnValue);
  4076. actionResult.Status = (int)Constant.PDAResult.Success;
  4077. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4078. }
  4079. else
  4080. {
  4081. actionResult.Status = (int)Constant.PDAResult.Fail;
  4082. if (returnValue == -2)
  4083. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4084. //if (returnValue == 10)
  4085. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4086. //if (returnValue > 0)
  4087. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4088. if (returnValue == -22)
  4089. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4090. if (returnValue == -23)
  4091. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4092. if (returnValue == -24)
  4093. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4094. if (returnValue == -25)
  4095. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4096. else if (returnValue == 0)
  4097. actionResult.Message = "盘点失败";
  4098. }
  4099. }
  4100. catch (Exception ex)
  4101. {
  4102. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4103. OutputLog.TraceLog(LogPriority.Error,
  4104. this.ToString(),
  4105. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4106. ex.ToString(),
  4107. LocalPath.LogExePath);
  4108. actionResult.Status = (int)Constant.PDAResult.Exception;
  4109. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4110. }
  4111. return actionResult;
  4112. }
  4113. #region 班次配置
  4114. /// <summary>
  4115. /// 班次配置-通过工号获取工种列表
  4116. /// </summary>
  4117. /// <param name="userId">工号ID</param>
  4118. /// <returns></returns>
  4119. public ActionResult BindUserJobsGet(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4120. {
  4121. ActionResult actionResult = new ActionResult();
  4122. try
  4123. {
  4124. // 验证请求头信息
  4125. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4126. // 验证失败
  4127. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4128. {
  4129. return actionResult;
  4130. }
  4131. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4132. () => SystemModuleLogic.GetJobByUserId(userId));
  4133. actionResult.Result = JsonHelper.ToJson(ds);
  4134. actionResult.Status = (int)Constant.PDAResult.Success;
  4135. }
  4136. catch (Exception ex)
  4137. {
  4138. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4139. OutputLog.TraceLog(LogPriority.Error,
  4140. this.ToString(),
  4141. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4142. ex.ToString(),
  4143. LocalPath.LogExePath);
  4144. actionResult.Status = (int)Constant.PDAResult.Exception;
  4145. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4146. }
  4147. return actionResult;
  4148. }
  4149. ///// <summary>
  4150. ///// 班次配置-根据工号查询员工档案信息
  4151. ///// </summary>
  4152. ///// <param name="userId">工号ID</param>
  4153. ///// <returns></returns>
  4154. //public ActionResult SearchHrStaffInfoGet(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4155. //{
  4156. // ActionResult actionResult = new ActionResult();
  4157. // try
  4158. // {
  4159. // // 验证请求头信息
  4160. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4161. // // 验证失败
  4162. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4163. // {
  4164. // return actionResult;
  4165. // }
  4166. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4167. // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
  4168. // actionResult.Result = JsonHelper.ToJson(ds);
  4169. // actionResult.Status = (int)Constant.PDAResult.Success;
  4170. // }
  4171. // catch (Exception ex)
  4172. // {
  4173. // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4174. // OutputLog.TraceLog(LogPriority.Error,
  4175. // this.ToString(),
  4176. // System.Reflection.MethodBase.GetCurrentMethod().Name,
  4177. // ex.ToString(),
  4178. // LocalPath.LogExePath);
  4179. // actionResult.Status = (int)Constant.PDAResult.Exception;
  4180. // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4181. // }
  4182. // return actionResult;
  4183. //}
  4184. /// <summary>
  4185. /// 班次配置-根据员工姓名查员工信息
  4186. /// </summary>
  4187. /// <param name="searchStaffEntity"></param>
  4188. /// <returns></returns>
  4189. public ActionResult SearchStaffInfoGet(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4190. {
  4191. ActionResult actionResult = new ActionResult();
  4192. try
  4193. {
  4194. // 验证请求头信息
  4195. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4196. // 验证失败
  4197. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4198. {
  4199. return actionResult;
  4200. }
  4201. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4202. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4203. actionResult.Result = JsonHelper.ToJson(ds);
  4204. actionResult.Status = (int)Constant.PDAResult.Success;
  4205. }
  4206. catch (Exception ex)
  4207. {
  4208. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4209. OutputLog.TraceLog(LogPriority.Error,
  4210. this.ToString(),
  4211. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4212. ex.ToString(),
  4213. LocalPath.LogExePath);
  4214. actionResult.Status = (int)Constant.PDAResult.Exception;
  4215. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4216. }
  4217. return actionResult;
  4218. }
  4219. /// <summary>
  4220. /// 获取班次配置信息
  4221. /// </summary>
  4222. /// <param name="searchEntity"></param>
  4223. /// <returns></returns>
  4224. public ActionResult SearchClassesSettingGet(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  4225. {
  4226. ActionResult actionResult = new ActionResult();
  4227. try
  4228. {
  4229. // 验证请求头信息
  4230. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4231. // 验证失败
  4232. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4233. {
  4234. return actionResult;
  4235. }
  4236. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4237. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4238. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4239. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4240. actionResult.Result = JsonHelper.ToJson(ds);
  4241. actionResult.Status = (int)Constant.PDAResult.Success;
  4242. }
  4243. catch (Exception ex)
  4244. {
  4245. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4246. OutputLog.TraceLog(LogPriority.Error,
  4247. this.ToString(),
  4248. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4249. ex.ToString(),
  4250. LocalPath.LogExePath);
  4251. actionResult.Status = (int)Constant.PDAResult.Exception;
  4252. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4253. }
  4254. return actionResult;
  4255. }
  4256. public ActionResult SaveClassesSettingGet(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4257. {
  4258. ActionResult actionResult = new ActionResult();
  4259. try
  4260. {
  4261. // 验证请求头信息
  4262. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4263. // 验证失败
  4264. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4265. {
  4266. return actionResult;
  4267. }
  4268. int returnValue = ServiceInvoker.Invoke<int>(this,
  4269. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4270. if (returnValue > 0)
  4271. {
  4272. actionResult.Result = JsonHelper.ToJson(returnValue);
  4273. actionResult.Status = (int)Constant.PDAResult.Success;
  4274. }
  4275. else
  4276. {
  4277. actionResult.Status = (int)Constant.PDAResult.Fail;
  4278. actionResult.Message = "保存失败";
  4279. }
  4280. }
  4281. catch (Exception ex)
  4282. {
  4283. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4284. OutputLog.TraceLog(LogPriority.Error,
  4285. this.ToString(),
  4286. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4287. ex.ToString(),
  4288. LocalPath.LogExePath);
  4289. actionResult.Status = (int)Constant.PDAResult.Exception;
  4290. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4291. }
  4292. return actionResult;
  4293. }
  4294. /// <summary>
  4295. /// 班次配置--获取详细信息
  4296. /// </summary>
  4297. /// <param name="searchEntity"></param>
  4298. /// <returns></returns>
  4299. public ActionResult SearchClassesDetailGet(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4300. {
  4301. ActionResult actionResult = new ActionResult();
  4302. try
  4303. {
  4304. // 验证请求头信息
  4305. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4306. // 验证失败
  4307. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4308. {
  4309. return actionResult;
  4310. }
  4311. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4312. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4313. actionResult.Result = JsonHelper.ToJson(ds);
  4314. actionResult.Status = (int)Constant.PDAResult.Success;
  4315. }
  4316. catch (Exception ex)
  4317. {
  4318. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4319. OutputLog.TraceLog(LogPriority.Error,
  4320. this.ToString(),
  4321. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4322. ex.ToString(),
  4323. LocalPath.LogExePath);
  4324. actionResult.Status = (int)Constant.PDAResult.Exception;
  4325. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4326. }
  4327. return actionResult;
  4328. }
  4329. /// <summary>
  4330. /// 获取用户是否有班次配置权限
  4331. /// </summary>
  4332. /// <param name="accountCode"></param>
  4333. /// <param name="userCode"></param>
  4334. /// <param name="userPassword"></param>
  4335. /// <param name="sessionKey"></param>
  4336. /// <returns></returns>
  4337. public ActionResult GetClassesSettingFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  4338. {
  4339. ActionResult actionResult = new ActionResult();
  4340. try
  4341. {
  4342. // 验证请求头信息
  4343. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4344. // 验证失败
  4345. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4346. {
  4347. return actionResult;
  4348. }
  4349. int returnValue = ServiceInvoker.Invoke<int>(this,
  4350. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4351. actionResult.Result = JsonHelper.ToJson(returnValue);
  4352. actionResult.Status = (int)Constant.PDAResult.Success;
  4353. }
  4354. catch (Exception ex)
  4355. {
  4356. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4357. OutputLog.TraceLog(LogPriority.Error,
  4358. this.ToString(),
  4359. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4360. ex.ToString(),
  4361. LocalPath.LogExePath);
  4362. actionResult.Status = (int)Constant.PDAResult.Exception;
  4363. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4364. }
  4365. return actionResult;
  4366. }
  4367. /// <summary>
  4368. /// 获取盘点单列表
  4369. /// </summary>
  4370. /// <param name="sUserInfo"></param>
  4371. /// <returns></returns>
  4372. public ActionResult GetAllInCheckedGet(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  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. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4385. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4386. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4387. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4388. actionResult.Result = JsonHelper.ToJson(ds);
  4389. actionResult.Status = (int)Constant.PDAResult.Success;
  4390. }
  4391. catch (Exception ex)
  4392. {
  4393. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4394. OutputLog.TraceLog(LogPriority.Error,
  4395. this.ToString(),
  4396. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4397. ex.ToString(),
  4398. LocalPath.LogExePath);
  4399. actionResult.Status = (int)Constant.PDAResult.Exception;
  4400. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4401. }
  4402. return actionResult;
  4403. }
  4404. #endregion
  4405. #region PDA报表
  4406. /// <summary>
  4407. /// 产品质量跟踪
  4408. /// </summary>
  4409. /// <param name="accountCode"></param>
  4410. /// <param name="userCode"></param>
  4411. /// <param name="userPassword"></param>
  4412. /// <param name="sessionKey"></param>
  4413. /// <param name="se"></param>
  4414. /// <returns></returns>
  4415. public ActionResult GetRPT040104SDataGet(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4416. {
  4417. ActionResult actionResult = new ActionResult();
  4418. try
  4419. {
  4420. // 验证请求头信息
  4421. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4422. // 验证失败
  4423. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4424. {
  4425. return actionResult;
  4426. }
  4427. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4428. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4429. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4430. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4431. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4432. {
  4433. actionResult.Status = (int)Constant.PDAResult.Fail;
  4434. actionResult.Message = Messages.MSG_CMN_I002;
  4435. }
  4436. else
  4437. {
  4438. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4439. actionResult.Status = (int)Constant.PDAResult.Success;
  4440. }
  4441. }
  4442. catch (Exception ex)
  4443. {
  4444. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4445. OutputLog.TraceLog(LogPriority.Error,
  4446. this.ToString(),
  4447. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4448. ex.ToString(),
  4449. LocalPath.LogExePath);
  4450. actionResult.Status = (int)Constant.PDAResult.Exception;
  4451. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4452. }
  4453. return actionResult;
  4454. }
  4455. /// <summary>
  4456. /// 工号产量质量分析表
  4457. /// </summary>
  4458. /// <param name="accountCode"></param>
  4459. /// <param name="userCode"></param>
  4460. /// <param name="userPassword"></param>
  4461. /// <param name="sessionKey"></param>
  4462. /// <param name="se"></param>
  4463. /// <returns></returns>
  4464. public ActionResult GetFP00002DataGet(string accountCode, string userCode, string userPassword, string sessionKey,
  4465. int rptSProcedureID, string workcode, string date)
  4466. {
  4467. ActionResult actionResult = new ActionResult();
  4468. try
  4469. {
  4470. // 验证请求头信息
  4471. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4472. // 验证失败
  4473. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4474. {
  4475. return actionResult;
  4476. }
  4477. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4478. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4479. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4480. {
  4481. actionResult.Status = (int)Constant.PDAResult.Fail;
  4482. actionResult.Message = Messages.MSG_CMN_I002;
  4483. }
  4484. else
  4485. {
  4486. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4487. actionResult.Status = (int)Constant.PDAResult.Success;
  4488. }
  4489. }
  4490. catch (Exception ex)
  4491. {
  4492. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4493. OutputLog.TraceLog(LogPriority.Error,
  4494. this.ToString(),
  4495. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4496. ex.ToString(),
  4497. LocalPath.LogExePath);
  4498. actionResult.Status = (int)Constant.PDAResult.Exception;
  4499. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4500. }
  4501. return actionResult;
  4502. }
  4503. /// <summary>
  4504. /// 半检数据统计表
  4505. /// </summary>
  4506. /// <param name="accountCode"></param>
  4507. /// <param name="userCode"></param>
  4508. /// <param name="userPassword"></param>
  4509. /// <param name="sessionKey"></param>
  4510. /// <param name="se"></param>
  4511. /// <returns></returns>
  4512. public ActionResult GetPDARPT000001DataGet(string accountCode, string userCode, string userPassword, string sessionKey,
  4513. string workcode, string datebegin, string dateend)
  4514. {
  4515. ActionResult actionResult = new ActionResult();
  4516. try
  4517. {
  4518. // 验证请求头信息
  4519. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4520. // 验证失败
  4521. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4522. {
  4523. return actionResult;
  4524. }
  4525. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4526. DateTime datetimeend = Convert.ToDateTime(dateend);
  4527. datetimebegin = datetimebegin.Date;
  4528. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4529. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4530. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4531. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4532. {
  4533. actionResult.Status = (int)Constant.PDAResult.Fail;
  4534. actionResult.Message = Messages.MSG_CMN_I002;
  4535. }
  4536. else
  4537. {
  4538. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4539. actionResult.Status = (int)Constant.PDAResult.Success;
  4540. }
  4541. }
  4542. catch (Exception ex)
  4543. {
  4544. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4545. OutputLog.TraceLog(LogPriority.Error,
  4546. this.ToString(),
  4547. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4548. ex.ToString(),
  4549. LocalPath.LogExePath);
  4550. actionResult.Status = (int)Constant.PDAResult.Exception;
  4551. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4552. }
  4553. return actionResult;
  4554. }
  4555. /// <summary>
  4556. /// 工号质量统计表
  4557. /// </summary>
  4558. /// <param name="accountCode"></param>
  4559. /// <param name="userCode"></param>
  4560. /// <param name="userPassword"></param>
  4561. /// <param name="sessionKey"></param>
  4562. /// <param name="se"></param>
  4563. /// <returns></returns>
  4564. public ActionResult GetPDARPT000002DataGet(string accountCode, string userCode, string userPassword, string sessionKey,
  4565. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4566. {
  4567. ActionResult actionResult = new ActionResult();
  4568. try
  4569. {
  4570. // 验证请求头信息
  4571. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4572. // 验证失败
  4573. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4574. {
  4575. return actionResult;
  4576. }
  4577. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4578. DateTime datetimeend = Convert.ToDateTime(dateend);
  4579. datetimebegin = datetimebegin.Date;
  4580. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4581. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4582. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4583. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4584. {
  4585. actionResult.Status = (int)Constant.PDAResult.Fail;
  4586. actionResult.Message = Messages.MSG_CMN_I002;
  4587. }
  4588. else
  4589. {
  4590. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4591. actionResult.Status = (int)Constant.PDAResult.Success;
  4592. }
  4593. }
  4594. catch (Exception ex)
  4595. {
  4596. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4597. OutputLog.TraceLog(LogPriority.Error,
  4598. this.ToString(),
  4599. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4600. ex.ToString(),
  4601. LocalPath.LogExePath);
  4602. actionResult.Status = (int)Constant.PDAResult.Exception;
  4603. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4604. }
  4605. return actionResult;
  4606. }
  4607. /// <summary>
  4608. /// 损坯数据统计表
  4609. /// </summary>
  4610. /// <param name="accountCode"></param>
  4611. /// <param name="userCode"></param>
  4612. /// <param name="userPassword"></param>
  4613. /// <param name="sessionKey"></param>
  4614. /// <param name="se"></param>
  4615. /// <returns></returns>
  4616. public ActionResult GetPDARPT000003DataGet(string accountCode, string userCode, string userPassword, string sessionKey,
  4617. string workcode, string datebegin, string dateend)
  4618. {
  4619. ActionResult actionResult = new ActionResult();
  4620. try
  4621. {
  4622. // 验证请求头信息
  4623. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4624. // 验证失败
  4625. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4626. {
  4627. return actionResult;
  4628. }
  4629. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4630. DateTime datetimeend = Convert.ToDateTime(dateend);
  4631. datetimebegin = datetimebegin.Date;
  4632. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4633. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4634. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4635. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4636. {
  4637. actionResult.Status = (int)Constant.PDAResult.Fail;
  4638. actionResult.Message = Messages.MSG_CMN_I002;
  4639. }
  4640. else
  4641. {
  4642. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4643. actionResult.Status = (int)Constant.PDAResult.Success;
  4644. }
  4645. }
  4646. catch (Exception ex)
  4647. {
  4648. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4649. OutputLog.TraceLog(LogPriority.Error,
  4650. this.ToString(),
  4651. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4652. ex.ToString(),
  4653. LocalPath.LogExePath);
  4654. actionResult.Status = (int)Constant.PDAResult.Exception;
  4655. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4656. }
  4657. return actionResult;
  4658. }
  4659. #endregion
  4660. /// <summary>
  4661. /// 取得报表数据源数据
  4662. /// </summary>
  4663. /// <param name="accountCode"></param>
  4664. /// <param name="userCode"></param>
  4665. /// <param name="userPassword"></param>
  4666. /// <param name="sessionKey"></param>
  4667. /// <returns></returns>
  4668. public ActionResult GetRptProcedureModuleGet(string accountCode, string userCode, string userPassword, string sessionKey)
  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. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4681. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4682. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4683. {
  4684. actionResult.Status = (int)Constant.PDAResult.Fail;
  4685. actionResult.Message = Messages.MSG_CMN_I002;
  4686. }
  4687. else
  4688. {
  4689. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4690. actionResult.Status = (int)Constant.PDAResult.Success;
  4691. }
  4692. }
  4693. catch (Exception ex)
  4694. {
  4695. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4696. OutputLog.TraceLog(LogPriority.Error,
  4697. this.ToString(),
  4698. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4699. ex.ToString(),
  4700. LocalPath.LogExePath);
  4701. actionResult.Status = (int)Constant.PDAResult.Exception;
  4702. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4703. }
  4704. return actionResult;
  4705. }
  4706. /// <summary>
  4707. /// 取得报表的查询数据源统计工序数据
  4708. /// </summary>
  4709. /// <param name="accountCode"></param>
  4710. /// <param name="userCode"></param>
  4711. /// <param name="userPassword"></param>
  4712. /// <param name="sessionKey"></param>
  4713. /// <param name="RptProcedureID"></param>
  4714. /// <returns></returns>
  4715. public ActionResult GetRptSourceProcedureModuleGet(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  4716. {
  4717. ActionResult actionResult = new ActionResult();
  4718. try
  4719. {
  4720. // 验证请求头信息
  4721. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4722. // 验证失败
  4723. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4724. {
  4725. return actionResult;
  4726. }
  4727. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4728. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  4729. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4730. {
  4731. actionResult.Status = (int)Constant.PDAResult.Fail;
  4732. actionResult.Message = Messages.MSG_CMN_I002;
  4733. }
  4734. else
  4735. {
  4736. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4737. actionResult.Status = (int)Constant.PDAResult.Success;
  4738. }
  4739. }
  4740. catch (Exception ex)
  4741. {
  4742. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4743. OutputLog.TraceLog(LogPriority.Error,
  4744. this.ToString(),
  4745. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4746. ex.ToString(),
  4747. LocalPath.LogExePath);
  4748. actionResult.Status = (int)Constant.PDAResult.Exception;
  4749. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4750. }
  4751. return actionResult;
  4752. }
  4753. /// <summary>
  4754. /// 获取用户是否有统计产成品权限
  4755. /// </summary>
  4756. /// <param name="accountCode"></param>
  4757. /// <param name="userCode"></param>
  4758. /// <param name="userPassword"></param>
  4759. /// <param name="sessionKey"></param>
  4760. /// <returns></returns>
  4761. public ActionResult GetStatisticsFinishedProductFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  4762. {
  4763. ActionResult actionResult = new ActionResult();
  4764. try
  4765. {
  4766. // 验证请求头信息
  4767. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4768. // 验证失败
  4769. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4770. {
  4771. return actionResult;
  4772. }
  4773. int returnValue = ServiceInvoker.Invoke<int>(this,
  4774. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  4775. actionResult.Result = JsonHelper.ToJson(returnValue);
  4776. actionResult.Status = (int)Constant.PDAResult.Success;
  4777. }
  4778. catch (Exception ex)
  4779. {
  4780. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4781. OutputLog.TraceLog(LogPriority.Error,
  4782. this.ToString(),
  4783. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4784. ex.ToString(),
  4785. LocalPath.LogExePath);
  4786. actionResult.Status = (int)Constant.PDAResult.Exception;
  4787. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4788. }
  4789. return actionResult;
  4790. }
  4791. /// <summary>
  4792. /// 获取用户是否有盘点权限
  4793. /// </summary>
  4794. /// <param name="accountCode"></param>
  4795. /// <param name="userCode"></param>
  4796. /// <param name="userPassword"></param>
  4797. /// <param name="sessionKey"></param>
  4798. /// <returns></returns>
  4799. public ActionResult GetInCheckedFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  4800. {
  4801. ActionResult actionResult = new ActionResult();
  4802. try
  4803. {
  4804. // 验证请求头信息
  4805. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4806. // 验证失败
  4807. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4808. {
  4809. return actionResult;
  4810. }
  4811. int returnValue = ServiceInvoker.Invoke<int>(this,
  4812. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  4813. actionResult.Result = JsonHelper.ToJson(returnValue);
  4814. actionResult.Status = (int)Constant.PDAResult.Success;
  4815. }
  4816. catch (Exception ex)
  4817. {
  4818. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4819. OutputLog.TraceLog(LogPriority.Error,
  4820. this.ToString(),
  4821. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4822. ex.ToString(),
  4823. LocalPath.LogExePath);
  4824. actionResult.Status = (int)Constant.PDAResult.Exception;
  4825. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4826. }
  4827. return actionResult;
  4828. }
  4829. /// <summary>
  4830. /// 根据条件查询是否存在班次配置
  4831. /// </summary>
  4832. /// <param name="accountCode"></param>
  4833. /// <param name="userCode"></param>
  4834. /// <param name="userPassword"></param>
  4835. /// <param name="sessionKey"></param>
  4836. /// <param name="userCode">工号编码</param>
  4837. /// <returns></returns>
  4838. public ActionResult GetClassesSettingGet(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  4839. {
  4840. ActionResult actionResult = new ActionResult();
  4841. try
  4842. {
  4843. // 验证请求头信息
  4844. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4845. // 验证失败
  4846. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4847. {
  4848. return actionResult;
  4849. }
  4850. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4851. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  4852. actionResult.Result = JsonHelper.ToJson(ds);
  4853. actionResult.Status = (int)Constant.PDAResult.Success;
  4854. }
  4855. catch (Exception ex)
  4856. {
  4857. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4858. OutputLog.TraceLog(LogPriority.Error,
  4859. this.ToString(),
  4860. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4861. ex.ToString(),
  4862. LocalPath.LogExePath);
  4863. actionResult.Status = (int)Constant.PDAResult.Exception;
  4864. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4865. }
  4866. return actionResult;
  4867. }
  4868. /// <summary>
  4869. /// 报损工序查出工号根据生产数据ID
  4870. /// </summary>
  4871. /// <param name="accountCode"></param>
  4872. /// <param name="userCode"></param>
  4873. /// <param name="userPassword"></param>
  4874. /// <param name="sessionKey"></param>
  4875. /// <param name="ProductionDataID">生产数据ID</param>
  4876. /// <returns></returns>
  4877. public ActionResult GetScrapProductUserCodeByProductionDataIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  4878. {
  4879. ActionResult actionResult = new ActionResult();
  4880. try
  4881. {
  4882. // 验证请求头信息
  4883. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4884. // 验证失败
  4885. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4886. {
  4887. return actionResult;
  4888. }
  4889. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  4890. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  4891. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  4892. {
  4893. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  4894. actionResult.Status = (int)Constant.PDAResult.Success;
  4895. }
  4896. else
  4897. {
  4898. actionResult.Status = (int)Constant.PDAResult.Fail;
  4899. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  4900. }
  4901. }
  4902. catch (Exception ex)
  4903. {
  4904. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4905. OutputLog.TraceLog(LogPriority.Error,
  4906. this.ToString(),
  4907. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4908. ex.ToString(),
  4909. LocalPath.LogExePath);
  4910. actionResult.Status = (int)Constant.PDAResult.Exception;
  4911. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4912. }
  4913. return actionResult;
  4914. }
  4915. /// <summary>
  4916. /// 在入窑工序检验窑车号是否存在
  4917. /// </summary>
  4918. /// <param name="accountCode"></param>
  4919. /// <param name="userCode"></param>
  4920. /// <param name="userPassword"></param>
  4921. /// <param name="sessionKey"></param>
  4922. /// <param name="kilncarcode">窑车编码</param>
  4923. /// <param name="procedureid">工序ID</param>
  4924. /// <returns></returns>
  4925. public ActionResult CheckKilnCarByIntoCar2Get(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4926. {
  4927. ActionResult actionResult = new ActionResult();
  4928. try
  4929. {
  4930. // 验证请求头信息
  4931. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4932. // 验证失败
  4933. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4934. {
  4935. return actionResult;
  4936. }
  4937. int returnValue = ServiceInvoker.Invoke<int>(this,
  4938. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  4939. if (returnValue == 1)
  4940. {
  4941. actionResult.Result = JsonHelper.ToJson(returnValue);
  4942. actionResult.Status = (int)Constant.PDAResult.Success;
  4943. }
  4944. else
  4945. {
  4946. actionResult.Status = (int)Constant.PDAResult.Fail;
  4947. if (returnValue == -99)
  4948. actionResult.Message = "窑炉车号无效";
  4949. else if (returnValue == -98)
  4950. actionResult.Message = "窑车己无产品";
  4951. else if (returnValue == -97)
  4952. actionResult.Message = "窑车没有入窑,不可以撤销";
  4953. else if (returnValue == -1)
  4954. actionResult.Message = "保存失败";
  4955. }
  4956. }
  4957. catch (Exception ex)
  4958. {
  4959. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4960. OutputLog.TraceLog(LogPriority.Error,
  4961. this.ToString(),
  4962. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4963. ex.ToString(),
  4964. LocalPath.LogExePath);
  4965. actionResult.Status = (int)Constant.PDAResult.Exception;
  4966. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4967. }
  4968. return actionResult;
  4969. }
  4970. /// <summary>
  4971. /// 撤销包装
  4972. /// </summary>
  4973. /// <param name="accountCode"></param>
  4974. /// <param name="userCode"></param>
  4975. /// <param name="userPassword"></param>
  4976. /// <param name="sessionKey"></param>
  4977. /// <param name="barcode"></param>
  4978. /// <returns></returns>
  4979. public ActionResult AddChancelFinishedproductGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  4980. {
  4981. ActionResult actionResult = new ActionResult();
  4982. try
  4983. {
  4984. // 验证请求头信息
  4985. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4986. // 验证失败
  4987. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4988. {
  4989. return actionResult;
  4990. }
  4991. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4992. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  4993. if (Convert.ToInt32(returnValue.Result) > 0)
  4994. {
  4995. actionResult.Result = JsonHelper.ToJson(returnValue);
  4996. actionResult.Status = (int)Constant.PDAResult.Success;
  4997. }
  4998. else
  4999. {
  5000. actionResult.Status = (int)Constant.PDAResult.Fail;
  5001. if (Convert.ToInt32(returnValue.Result) == -1)
  5002. actionResult.Message = "产品条码不存在包装记录";
  5003. else if (Convert.ToInt32(returnValue.Result) == -200)
  5004. actionResult.Message = returnValue.Message;
  5005. else
  5006. actionResult.Message = "成品撤销失败";
  5007. }
  5008. }
  5009. catch (Exception ex)
  5010. {
  5011. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5012. OutputLog.TraceLog(LogPriority.Error,
  5013. this.ToString(),
  5014. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5015. ex.ToString(),
  5016. LocalPath.LogExePath);
  5017. actionResult.Status = (int)Constant.PDAResult.Exception;
  5018. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5019. }
  5020. return actionResult;
  5021. }
  5022. /*
  5023. /// <summary>
  5024. /// 获取用户是否有撤销包装权限
  5025. /// </summary>
  5026. /// <param name="accountCode"></param>
  5027. /// <param name="userCode"></param>
  5028. /// <param name="userPassword"></param>
  5029. /// <param name="sessionKey"></param>
  5030. /// <returns></returns>
  5031. public ActionResult GetChancelFinishedproductFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5032. {
  5033. ActionResult actionResult = new ActionResult();
  5034. try
  5035. {
  5036. // 验证请求头信息
  5037. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5038. // 验证失败
  5039. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5040. {
  5041. return actionResult;
  5042. }
  5043. int returnValue = ServiceInvoker.Invoke<int>(this,
  5044. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5045. actionResult.Result = JsonHelper.ToJson(returnValue);
  5046. actionResult.Status = (int)Constant.PDAResult.Success;
  5047. }
  5048. catch (Exception ex)
  5049. {
  5050. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5051. OutputLog.TraceLog(LogPriority.Error,
  5052. this.ToString(),
  5053. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5054. ex.ToString(),
  5055. LocalPath.LogExePath);
  5056. actionResult.Status = (int)Constant.PDAResult.Exception;
  5057. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5058. }
  5059. return actionResult;
  5060. }
  5061. */
  5062. /// <summary>
  5063. /// 窑车状态明细表查询
  5064. /// </summary>
  5065. /// <param name="accountCode"></param>
  5066. /// <param name="userCode"></param>
  5067. /// <param name="userPassword"></param>
  5068. /// <param name="sessionKey"></param>
  5069. /// <param name="kilnCarCode"></param>
  5070. /// <returns></returns>
  5071. public ActionResult GetKilnCarStatusDetailByCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5072. {
  5073. ActionResult actionResult = new ActionResult();
  5074. try
  5075. {
  5076. // 验证请求头信息
  5077. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5078. // 验证失败
  5079. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5080. {
  5081. return actionResult;
  5082. }
  5083. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5084. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5085. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5086. {
  5087. actionResult.Status = (int)Constant.PDAResult.Fail;
  5088. actionResult.Message = Messages.MSG_CMN_I002;
  5089. }
  5090. else
  5091. {
  5092. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5093. actionResult.Status = (int)Constant.PDAResult.Success;
  5094. }
  5095. }
  5096. catch (Exception ex)
  5097. {
  5098. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5099. OutputLog.TraceLog(LogPriority.Error,
  5100. this.ToString(),
  5101. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5102. ex.ToString(),
  5103. LocalPath.LogExePath);
  5104. actionResult.Status = (int)Constant.PDAResult.Exception;
  5105. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5106. }
  5107. return actionResult;
  5108. }
  5109. /// <summary>
  5110. /// 损坯撤销
  5111. /// </summary>
  5112. /// <param name="accountCode"></param>
  5113. /// <param name="userCode"></param>
  5114. /// <param name="userPassword"></param>
  5115. /// <param name="sessionKey"></param>
  5116. /// <param name="barcode"></param>
  5117. /// <returns></returns>
  5118. public ActionResult AddCancelScrapProductionGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5119. {
  5120. ActionResult actionResult = new ActionResult();
  5121. try
  5122. {
  5123. // 验证请求头信息
  5124. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5125. // 验证失败
  5126. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5127. {
  5128. return actionResult;
  5129. }
  5130. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5131. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5132. if (Convert.ToInt32(returnValue.Result) > 0)
  5133. {
  5134. actionResult.Result = JsonHelper.ToJson(returnValue);
  5135. actionResult.Status = (int)Constant.PDAResult.Success;
  5136. }
  5137. else
  5138. {
  5139. actionResult.Status = (int)Constant.PDAResult.Fail;
  5140. if (Convert.ToInt32(returnValue.Result) == -1)
  5141. actionResult.Message = "此产品没有损坯,不能撤销";
  5142. else if (Convert.ToInt32(returnValue.Result) == -200)
  5143. actionResult.Message = returnValue.Message;
  5144. else
  5145. actionResult.Message = "损坯撤销失败";
  5146. }
  5147. }
  5148. catch (Exception ex)
  5149. {
  5150. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5151. OutputLog.TraceLog(LogPriority.Error,
  5152. this.ToString(),
  5153. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5154. ex.ToString(),
  5155. LocalPath.LogExePath);
  5156. actionResult.Status = (int)Constant.PDAResult.Exception;
  5157. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5158. }
  5159. return actionResult;
  5160. }
  5161. /*
  5162. /// <summary>
  5163. /// 获取用户是否有损坯撤销权限
  5164. /// </summary>
  5165. /// <param name="accountCode"></param>
  5166. /// <param name="userCode"></param>
  5167. /// <param name="userPassword"></param>
  5168. /// <param name="sessionKey"></param>
  5169. /// <returns></returns>
  5170. public ActionResult GetCancelScrapProductionFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5171. {
  5172. ActionResult actionResult = new ActionResult();
  5173. try
  5174. {
  5175. // 验证请求头信息
  5176. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5177. // 验证失败
  5178. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5179. {
  5180. return actionResult;
  5181. }
  5182. int returnValue = ServiceInvoker.Invoke<int>(this,
  5183. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5184. actionResult.Result = JsonHelper.ToJson(returnValue);
  5185. actionResult.Status = (int)Constant.PDAResult.Success;
  5186. }
  5187. catch (Exception ex)
  5188. {
  5189. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5190. OutputLog.TraceLog(LogPriority.Error,
  5191. this.ToString(),
  5192. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5193. ex.ToString(),
  5194. LocalPath.LogExePath);
  5195. actionResult.Status = (int)Constant.PDAResult.Exception;
  5196. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5197. }
  5198. return actionResult;
  5199. }
  5200. */
  5201. /// <summary>
  5202. /// 获取条码注浆信息
  5203. /// </summary>
  5204. /// <param name="accountCode"></param>
  5205. /// <param name="userCode"></param>
  5206. /// <param name="userPassword"></param>
  5207. /// <param name="sessionKey"></param>
  5208. /// <returns></returns>
  5209. public ActionResult GetGroutingInfoBybarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5210. {
  5211. ActionResult actionResult = new ActionResult();
  5212. try
  5213. {
  5214. // 验证请求头信息
  5215. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5216. // 验证失败
  5217. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5218. {
  5219. return actionResult;
  5220. }
  5221. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5222. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5223. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5224. {
  5225. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5226. actionResult.Status = (int)Constant.PDAResult.Success;
  5227. }
  5228. else
  5229. {
  5230. actionResult.Status = (int)Constant.PDAResult.Fail;
  5231. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5232. }
  5233. }
  5234. catch (Exception ex)
  5235. {
  5236. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5237. OutputLog.TraceLog(LogPriority.Error,
  5238. this.ToString(),
  5239. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5240. ex.ToString(),
  5241. LocalPath.LogExePath);
  5242. actionResult.Status = (int)Constant.PDAResult.Exception;
  5243. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5244. }
  5245. return actionResult;
  5246. }
  5247. /// <summary>
  5248. /// 获取条码注浆信息
  5249. /// </summary>
  5250. /// <param name="accountCode"></param>
  5251. /// <param name="userCode"></param>
  5252. /// <param name="userPassword"></param>
  5253. /// <param name="sessionKey"></param>
  5254. /// <returns></returns>
  5255. public ActionResult GetFinishedProductGroutingInfoBybarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5256. {
  5257. ActionResult actionResult = new ActionResult();
  5258. try
  5259. {
  5260. // 验证请求头信息
  5261. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5262. // 验证失败
  5263. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5264. {
  5265. return actionResult;
  5266. }
  5267. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5268. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5269. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5270. {
  5271. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5272. actionResult.Status = (int)Constant.PDAResult.Success;
  5273. }
  5274. else
  5275. {
  5276. actionResult.Status = (int)Constant.PDAResult.Fail;
  5277. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5278. }
  5279. }
  5280. catch (Exception ex)
  5281. {
  5282. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5283. OutputLog.TraceLog(LogPriority.Error,
  5284. this.ToString(),
  5285. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5286. ex.ToString(),
  5287. LocalPath.LogExePath);
  5288. actionResult.Status = (int)Constant.PDAResult.Exception;
  5289. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5290. }
  5291. return actionResult;
  5292. }
  5293. /// <summary>
  5294. /// 公坯设定
  5295. /// </summary>
  5296. /// <param name="accountCode"></param>
  5297. /// <param name="userCode"></param>
  5298. /// <param name="userPassword"></param>
  5299. /// <param name="sessionKey"></param>
  5300. /// <param name="barcode"></param>
  5301. /// <returns></returns>
  5302. public ActionResult AddPublicBodyProductGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5303. {
  5304. ActionResult actionResult = new ActionResult();
  5305. try
  5306. {
  5307. // 验证请求头信息
  5308. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5309. // 验证失败
  5310. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5311. {
  5312. return actionResult;
  5313. }
  5314. int returnValue = ServiceInvoker.Invoke<int>(this,
  5315. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5316. if (returnValue > 0)
  5317. {
  5318. actionResult.Result = JsonHelper.ToJson(returnValue);
  5319. actionResult.Status = (int)Constant.PDAResult.Success;
  5320. }
  5321. else
  5322. {
  5323. actionResult.Status = (int)Constant.PDAResult.Fail;
  5324. if (returnValue == -1)
  5325. actionResult.Message = "此产品不在生产线上";
  5326. else if (returnValue == -2)
  5327. actionResult.Message = "该产品已经标识为公坯";
  5328. else
  5329. actionResult.Message = "公坯设定失败";
  5330. }
  5331. }
  5332. catch (Exception ex)
  5333. {
  5334. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5335. OutputLog.TraceLog(LogPriority.Error,
  5336. this.ToString(),
  5337. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5338. ex.ToString(),
  5339. LocalPath.LogExePath);
  5340. actionResult.Status = (int)Constant.PDAResult.Exception;
  5341. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5342. }
  5343. return actionResult;
  5344. }
  5345. /*
  5346. /// <summary>
  5347. /// 获取用户是否有公坯设定
  5348. /// </summary>
  5349. /// <param name="accountCode"></param>
  5350. /// <param name="userCode"></param>
  5351. /// <param name="userPassword"></param>
  5352. /// <param name="sessionKey"></param>
  5353. /// <returns></returns>
  5354. public ActionResult GetPublicBodyProductFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5355. {
  5356. ActionResult actionResult = new ActionResult();
  5357. try
  5358. {
  5359. // 验证请求头信息
  5360. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5361. // 验证失败
  5362. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5363. {
  5364. return actionResult;
  5365. }
  5366. int returnValue = ServiceInvoker.Invoke<int>(this,
  5367. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5368. actionResult.Result = JsonHelper.ToJson(returnValue);
  5369. actionResult.Status = (int)Constant.PDAResult.Success;
  5370. }
  5371. catch (Exception ex)
  5372. {
  5373. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5374. OutputLog.TraceLog(LogPriority.Error,
  5375. this.ToString(),
  5376. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5377. ex.ToString(),
  5378. LocalPath.LogExePath);
  5379. actionResult.Status = (int)Constant.PDAResult.Exception;
  5380. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5381. }
  5382. return actionResult;
  5383. }
  5384. */
  5385. /// <summary>
  5386. /// 校验产品条码是否可以走到该工序
  5387. /// </summary>
  5388. /// <param name="accountCode">帐套code</param>
  5389. /// <param name="userCode">用户code</param>
  5390. /// <param name="userPassword">用户密码</param>
  5391. /// <param name="sessionKey">本次登陆密钥</param>
  5392. /// <param name="procedureID">工序ID</param>
  5393. /// <param name="barcode">条码</param>
  5394. /// <returns></returns>
  5395. /// <remarks>
  5396. /// 陈冰 2014.09.18 新建
  5397. /// </remarks>
  5398. public ActionResult CheckBarcodeDeliverMudGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5399. {
  5400. ActionResult actionResult = new ActionResult();
  5401. try
  5402. {
  5403. // 验证请求头信息
  5404. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5405. // 验证失败
  5406. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5407. {
  5408. return actionResult;
  5409. }
  5410. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5411. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5412. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5413. {
  5414. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5415. actionResult.Status = (int)Constant.PDAResult.Success;
  5416. }
  5417. else
  5418. {
  5419. actionResult.Status = (int)Constant.PDAResult.Fail;
  5420. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5421. }
  5422. }
  5423. catch (Exception ex)
  5424. {
  5425. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5426. OutputLog.TraceLog(LogPriority.Error,
  5427. this.ToString(),
  5428. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5429. ex.ToString(),
  5430. LocalPath.LogExePath);
  5431. actionResult.Status = (int)Constant.PDAResult.Exception;
  5432. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5433. }
  5434. return actionResult;
  5435. }
  5436. /// <summary>
  5437. /// 获取用户所有菜单权限
  5438. /// </summary>
  5439. /// <param name="accountCode"></param>
  5440. /// <param name="userCode"></param>
  5441. /// <param name="userPassword"></param>
  5442. /// <param name="sessionKey"></param>
  5443. /// <returns></returns>
  5444. public ActionResult GetUserAllFunctionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5445. {
  5446. ActionResult actionResult = new ActionResult();
  5447. try
  5448. {
  5449. // 验证请求头信息
  5450. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5451. // 验证失败
  5452. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5453. {
  5454. return actionResult;
  5455. }
  5456. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5457. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5458. actionResult.Result = JsonHelper.ToJson(returnValue);
  5459. actionResult.Status = (int)Constant.PDAResult.Success;
  5460. }
  5461. catch (Exception ex)
  5462. {
  5463. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5464. OutputLog.TraceLog(LogPriority.Error,
  5465. this.ToString(),
  5466. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5467. ex.ToString(),
  5468. LocalPath.LogExePath);
  5469. actionResult.Status = (int)Constant.PDAResult.Exception;
  5470. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5471. }
  5472. return actionResult;
  5473. }
  5474. public ActionResult AddChancelBarCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5475. {
  5476. ActionResult actionResult = new ActionResult();
  5477. try
  5478. {
  5479. // 验证请求头信息
  5480. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5481. // 验证失败
  5482. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5483. {
  5484. return actionResult;
  5485. }
  5486. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5487. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5488. if (Convert.ToInt32(returnValue.Result) > 0)
  5489. {
  5490. actionResult.Result = JsonHelper.ToJson(returnValue);
  5491. actionResult.Status = (int)Constant.PDAResult.Success;
  5492. }
  5493. else
  5494. {
  5495. actionResult.Status = (int)Constant.PDAResult.Fail;
  5496. if (Convert.ToInt32(returnValue.Result) == -1)
  5497. actionResult.Message = "无效条码";
  5498. else if (Convert.ToInt32(returnValue.Result) == -2)
  5499. actionResult.Message = "已经生产完成";
  5500. else if (Convert.ToInt32(returnValue.Result) == -3)
  5501. actionResult.Message = "条码已经申请报废";
  5502. else if (Convert.ToInt32(returnValue.Result) == -4)
  5503. actionResult.Message = "此条码当前工序不允许进行撤销";
  5504. else if (Convert.ToInt32(returnValue.Result) == -5)
  5505. actionResult.Message = "此条码没有生产数据";
  5506. else if (Convert.ToInt32(returnValue.Result) == -6)
  5507. actionResult.Message = "没有当前工序权限";
  5508. else if (Convert.ToInt32(returnValue.Result) == -7)
  5509. actionResult.Message = "条码不在生产线上";
  5510. else if (Convert.ToInt32(returnValue.Result) == -8)
  5511. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5512. else if (Convert.ToInt32(returnValue.Result) == -9)
  5513. actionResult.Message = "条码已经是返工状态";
  5514. else if (Convert.ToInt32(returnValue.Result) == -200)
  5515. actionResult.Message = returnValue.Message;
  5516. }
  5517. }
  5518. catch (Exception ex)
  5519. {
  5520. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5521. OutputLog.TraceLog(LogPriority.Error,
  5522. this.ToString(),
  5523. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5524. ex.ToString(),
  5525. LocalPath.LogExePath);
  5526. actionResult.Status = (int)Constant.PDAResult.Exception;
  5527. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5528. }
  5529. return actionResult;
  5530. }
  5531. public ActionResult AddChancelDeliverMudBarCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5532. {
  5533. ActionResult actionResult = new ActionResult();
  5534. try
  5535. {
  5536. // 验证请求头信息
  5537. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5538. // 验证失败
  5539. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5540. {
  5541. return actionResult;
  5542. }
  5543. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5544. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5545. if (Convert.ToInt32(returnValue.Result) > 0)
  5546. {
  5547. actionResult.Result = JsonHelper.ToJson(returnValue);
  5548. actionResult.Status = (int)Constant.PDAResult.Success;
  5549. }
  5550. else
  5551. {
  5552. actionResult.Status = (int)Constant.PDAResult.Fail;
  5553. if (Convert.ToInt32(returnValue.Result) == -1)
  5554. actionResult.Message = "无效条码";
  5555. else if (Convert.ToInt32(returnValue.Result) == -2)
  5556. actionResult.Message = "已经生产完成";
  5557. else if (Convert.ToInt32(returnValue.Result) == -3)
  5558. actionResult.Message = "条码已经申请报废";
  5559. else if (Convert.ToInt32(returnValue.Result) == -4)
  5560. actionResult.Message = "此条码当前工序不允许进行撤销";
  5561. else if (Convert.ToInt32(returnValue.Result) == -5)
  5562. actionResult.Message = "此条码没有生产数据";
  5563. else if (Convert.ToInt32(returnValue.Result) == -55)
  5564. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5565. else if (Convert.ToInt32(returnValue.Result) == -6)
  5566. actionResult.Message = "没有任何影响行";
  5567. else if (Convert.ToInt32(returnValue.Result) == -7)
  5568. actionResult.Message = "条码不在生产线上";
  5569. else if (Convert.ToInt32(returnValue.Result) == -8)
  5570. actionResult.Message = "条码已经是返工状态";
  5571. else if (Convert.ToInt32(returnValue.Result) == -200)
  5572. actionResult.Message = returnValue.Message;
  5573. }
  5574. }
  5575. catch (Exception ex)
  5576. {
  5577. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5578. OutputLog.TraceLog(LogPriority.Error,
  5579. this.ToString(),
  5580. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5581. ex.ToString(),
  5582. LocalPath.LogExePath);
  5583. actionResult.Status = (int)Constant.PDAResult.Exception;
  5584. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5585. }
  5586. return actionResult;
  5587. }
  5588. public ActionResult GetAllLogoInfoGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5589. {
  5590. ActionResult actionResult = new ActionResult();
  5591. try
  5592. {
  5593. // 验证请求头信息
  5594. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5595. // 验证失败
  5596. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5597. {
  5598. return actionResult;
  5599. }
  5600. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5601. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5602. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5603. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5604. {
  5605. //DataView dv = returnValue.Tables[0].DefaultView;
  5606. //dv.RowFilter = "ValueFlag=1";
  5607. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5608. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5609. actionResult.Status = (int)Constant.PDAResult.Success;
  5610. }
  5611. }
  5612. catch (Exception ex)
  5613. {
  5614. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5615. OutputLog.TraceLog(LogPriority.Error,
  5616. this.ToString(),
  5617. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5618. ex.ToString(),
  5619. LocalPath.LogExePath);
  5620. actionResult.Status = (int)Constant.PDAResult.Exception;
  5621. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5622. }
  5623. return actionResult;
  5624. }
  5625. public ActionResult GetLogoIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5626. {
  5627. ActionResult actionResult = new ActionResult();
  5628. try
  5629. {
  5630. // 验证请求头信息
  5631. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5632. // 验证失败
  5633. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5634. {
  5635. return actionResult;
  5636. }
  5637. int returnValue = ServiceInvoker.Invoke<int>(this,
  5638. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5639. actionResult.Result = JsonHelper.ToJson(returnValue);
  5640. actionResult.Status = (int)Constant.PDAResult.Success;
  5641. }
  5642. catch (Exception ex)
  5643. {
  5644. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5645. OutputLog.TraceLog(LogPriority.Error,
  5646. this.ToString(),
  5647. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5648. ex.ToString(),
  5649. LocalPath.LogExePath);
  5650. actionResult.Status = (int)Constant.PDAResult.Exception;
  5651. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5652. }
  5653. return actionResult;
  5654. }
  5655. public ActionResult SaveBarCodeLogoGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  5656. {
  5657. ActionResult actionResult = new ActionResult();
  5658. try
  5659. {
  5660. // 验证请求头信息
  5661. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5662. // 验证失败
  5663. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5664. {
  5665. return actionResult;
  5666. }
  5667. int returnValue = ServiceInvoker.Invoke<int>(this,
  5668. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo));
  5669. actionResult.Result = JsonHelper.ToJson(returnValue);
  5670. actionResult.Status = (int)Constant.PDAResult.Success;
  5671. }
  5672. catch (Exception ex)
  5673. {
  5674. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5675. OutputLog.TraceLog(LogPriority.Error,
  5676. this.ToString(),
  5677. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5678. ex.ToString(),
  5679. LocalPath.LogExePath);
  5680. actionResult.Status = (int)Constant.PDAResult.Exception;
  5681. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5682. }
  5683. return actionResult;
  5684. }
  5685. public ActionResult GetBarCodeLogoIDGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5686. {
  5687. ActionResult actionResult = new ActionResult();
  5688. try
  5689. {
  5690. // 验证请求头信息
  5691. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5692. // 验证失败
  5693. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5694. {
  5695. return actionResult;
  5696. }
  5697. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5698. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  5699. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5700. {
  5701. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5702. actionResult.Status = (int)Constant.PDAResult.Success;
  5703. }
  5704. }
  5705. catch (Exception ex)
  5706. {
  5707. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5708. OutputLog.TraceLog(LogPriority.Error,
  5709. this.ToString(),
  5710. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5711. ex.ToString(),
  5712. LocalPath.LogExePath);
  5713. actionResult.Status = (int)Constant.PDAResult.Exception;
  5714. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5715. }
  5716. return actionResult;
  5717. }
  5718. /// <summary>
  5719. /// 半检时,入窑前检验获取此条码是否报损为废品
  5720. /// </summary>
  5721. /// <param name="accountCode"></param>
  5722. /// <param name="userCode"></param>
  5723. /// <param name="userPassword"></param>
  5724. /// <param name="sessionKey"></param>
  5725. /// <param name="barcode">产品条码</param>
  5726. /// <returns></returns>
  5727. public ActionResult CheckWasteScrapProductGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5728. {
  5729. ActionResult actionResult = new ActionResult();
  5730. try
  5731. {
  5732. // 验证请求头信息
  5733. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5734. // 验证失败
  5735. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5736. {
  5737. return actionResult;
  5738. }
  5739. int returnValue = ServiceInvoker.Invoke<int>(this,
  5740. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  5741. if (returnValue != -100)
  5742. {
  5743. actionResult.Result = JsonHelper.ToJson(returnValue);
  5744. actionResult.Status = (int)Constant.PDAResult.Success;
  5745. }
  5746. else
  5747. {
  5748. actionResult.Status = (int)Constant.PDAResult.Fail;
  5749. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  5750. }
  5751. }
  5752. catch (Exception ex)
  5753. {
  5754. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5755. OutputLog.TraceLog(LogPriority.Error,
  5756. this.ToString(),
  5757. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5758. ex.ToString(),
  5759. LocalPath.LogExePath);
  5760. actionResult.Status = (int)Constant.PDAResult.Exception;
  5761. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5762. }
  5763. return actionResult;
  5764. }
  5765. /// <summary>
  5766. /// 获取登陆帐户有无入窑前检验数据编辑权限
  5767. /// </summary>
  5768. /// <param name="accountCode"></param>
  5769. /// <param name="userCode"></param>
  5770. /// <param name="userPassword"></param>
  5771. /// <param name="sessionKey"></param>
  5772. /// <param name="usercode">工号编码</param>
  5773. /// <returns></returns>
  5774. public ActionResult GetIntoKilnCheckEditFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5775. {
  5776. ActionResult actionResult = new ActionResult();
  5777. try
  5778. {
  5779. // 验证请求头信息
  5780. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5781. // 验证失败
  5782. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5783. {
  5784. return actionResult;
  5785. }
  5786. int returnValue = ServiceInvoker.Invoke<int>(this,
  5787. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  5788. actionResult.Result = JsonHelper.ToJson(returnValue);
  5789. actionResult.Status = (int)Constant.PDAResult.Success;
  5790. }
  5791. catch (Exception ex)
  5792. {
  5793. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5794. OutputLog.TraceLog(LogPriority.Error,
  5795. this.ToString(),
  5796. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5797. ex.ToString(),
  5798. LocalPath.LogExePath);
  5799. actionResult.Status = (int)Constant.PDAResult.Exception;
  5800. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5801. }
  5802. return actionResult;
  5803. }
  5804. /// <summary>
  5805. /// 获取登陆帐户有无半检验数据编辑权限
  5806. /// </summary>
  5807. /// <param name="accountCode"></param>
  5808. /// <param name="userCode"></param>
  5809. /// <param name="userPassword"></param>
  5810. /// <param name="sessionKey"></param>
  5811. /// <param name="usercode">工号编码</param>
  5812. /// <returns></returns>
  5813. public ActionResult GetNormalCheckEditFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5814. {
  5815. ActionResult actionResult = new ActionResult();
  5816. try
  5817. {
  5818. // 验证请求头信息
  5819. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5820. // 验证失败
  5821. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5822. {
  5823. return actionResult;
  5824. }
  5825. int returnValue = ServiceInvoker.Invoke<int>(this,
  5826. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  5827. actionResult.Result = JsonHelper.ToJson(returnValue);
  5828. actionResult.Status = (int)Constant.PDAResult.Success;
  5829. }
  5830. catch (Exception ex)
  5831. {
  5832. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5833. OutputLog.TraceLog(LogPriority.Error,
  5834. this.ToString(),
  5835. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5836. ex.ToString(),
  5837. LocalPath.LogExePath);
  5838. actionResult.Status = (int)Constant.PDAResult.Exception;
  5839. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5840. }
  5841. return actionResult;
  5842. }
  5843. /// <summary>
  5844. /// 获取缺陷扣罚管理的全部数据
  5845. /// </summary>
  5846. /// <param name="accountCode"></param>
  5847. /// <param name="userCode"></param>
  5848. /// <param name="userPassword"></param>
  5849. /// <param name="sessionKey"></param>
  5850. /// <returns></returns>
  5851. public ActionResult GetAllDefectFineGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5852. {
  5853. ActionResult actionResult = new ActionResult();
  5854. try
  5855. {
  5856. // 验证请求头信息
  5857. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5858. // 验证失败
  5859. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5860. {
  5861. return actionResult;
  5862. }
  5863. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5864. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  5865. if (ds != null && ds.Tables[0].Rows.Count > 0)
  5866. {
  5867. DataView dv = ds.Tables[0].DefaultView;
  5868. dv.RowFilter = "valueflag=1";
  5869. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5870. actionResult.Status = (int)Constant.PDAResult.Success;
  5871. }
  5872. else
  5873. {
  5874. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  5875. actionResult.Status = (int)Constant.PDAResult.Success;
  5876. }
  5877. }
  5878. catch (Exception ex)
  5879. {
  5880. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5881. OutputLog.TraceLog(LogPriority.Error,
  5882. this.ToString(),
  5883. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5884. ex.ToString(),
  5885. LocalPath.LogExePath);
  5886. actionResult.Status = (int)Constant.PDAResult.Exception;
  5887. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5888. }
  5889. return actionResult;
  5890. }
  5891. /// <summary>
  5892. /// 获取缺陷扣除数管理的全部数据
  5893. /// </summary>
  5894. /// <param name="accountCode"></param>
  5895. /// <param name="userCode"></param>
  5896. /// <param name="userPassword"></param>
  5897. /// <param name="sessionKey"></param>
  5898. /// <returns></returns>
  5899. public ActionResult GetAllDefectDeductionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5900. {
  5901. ActionResult actionResult = new ActionResult();
  5902. try
  5903. {
  5904. // 验证请求头信息
  5905. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5906. // 验证失败
  5907. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5908. {
  5909. return actionResult;
  5910. }
  5911. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5912. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  5913. if (ds != null && ds.Tables[0].Rows.Count > 0)
  5914. {
  5915. DataView dv = ds.Tables[0].DefaultView;
  5916. dv.RowFilter = "valueflag=1";
  5917. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5918. actionResult.Status = (int)Constant.PDAResult.Success;
  5919. }
  5920. else
  5921. {
  5922. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  5923. actionResult.Status = (int)Constant.PDAResult.Success;
  5924. }
  5925. }
  5926. catch (Exception ex)
  5927. {
  5928. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5929. OutputLog.TraceLog(LogPriority.Error,
  5930. this.ToString(),
  5931. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5932. ex.ToString(),
  5933. LocalPath.LogExePath);
  5934. actionResult.Status = (int)Constant.PDAResult.Exception;
  5935. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5936. }
  5937. return actionResult;
  5938. }
  5939. /// <summary>
  5940. /// 获取缺陷扣罚关系管理的全部数据
  5941. /// </summary>
  5942. /// <param name="accountCode"></param>
  5943. /// <param name="userCode"></param>
  5944. /// <param name="userPassword"></param>
  5945. /// <param name="sessionKey"></param>
  5946. /// <returns></returns>
  5947. public ActionResult GetAllDefectFineRelationGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5948. {
  5949. ActionResult actionResult = new ActionResult();
  5950. try
  5951. {
  5952. // 验证请求头信息
  5953. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5954. // 验证失败
  5955. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5956. {
  5957. return actionResult;
  5958. }
  5959. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5960. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  5961. DataTable dt = new DataTable();
  5962. dt.Columns.Add("DefectID");
  5963. dt.Columns.Add("DefectFineID");
  5964. DataView dv = ds.Tables[0].DefaultView;
  5965. DataTable dtFor = dv.ToTable("defectid", true);
  5966. for (int i = 0; i < dtFor.Rows.Count; i++)
  5967. {
  5968. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  5969. string substring = "";
  5970. foreach (DataRow r1 in r)
  5971. {
  5972. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  5973. }
  5974. if (substring != "")
  5975. {
  5976. DataRow drnew = dt.NewRow();
  5977. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  5978. drnew["DefectFineID"] = substring.TrimEnd(',');
  5979. dt.Rows.Add(drnew);
  5980. }
  5981. }
  5982. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  5983. actionResult.Status = (int)Constant.PDAResult.Success;
  5984. }
  5985. catch (Exception ex)
  5986. {
  5987. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5988. OutputLog.TraceLog(LogPriority.Error,
  5989. this.ToString(),
  5990. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5991. ex.ToString(),
  5992. LocalPath.LogExePath);
  5993. actionResult.Status = (int)Constant.PDAResult.Exception;
  5994. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5995. }
  5996. return actionResult;
  5997. }
  5998. /// <summary>
  5999. /// 获取缺陷扣除数关系管理的全部数据
  6000. /// </summary>
  6001. /// <param name="accountCode"></param>
  6002. /// <param name="userCode"></param>
  6003. /// <param name="userPassword"></param>
  6004. /// <param name="sessionKey"></param>
  6005. /// <returns></returns>
  6006. public ActionResult GetAllDefectDeductionRelationGet(string accountCode, string userCode, string userPassword, string sessionKey)
  6007. {
  6008. ActionResult actionResult = new ActionResult();
  6009. try
  6010. {
  6011. // 验证请求头信息
  6012. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6013. // 验证失败
  6014. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6015. {
  6016. return actionResult;
  6017. }
  6018. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6019. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6020. DataTable dt = new DataTable();
  6021. dt.Columns.Add("DefectID");
  6022. dt.Columns.Add("DefectDeductionNum");
  6023. DataView dv = ds.Tables[0].DefaultView;
  6024. DataTable dtFor = dv.ToTable("defectid", true);
  6025. for (int i = 0; i < dtFor.Rows.Count; i++)
  6026. {
  6027. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6028. string substring = "";
  6029. foreach (DataRow r1 in r)
  6030. {
  6031. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6032. }
  6033. if (substring != "")
  6034. {
  6035. DataRow drnew = dt.NewRow();
  6036. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6037. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6038. dt.Rows.Add(drnew);
  6039. }
  6040. }
  6041. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6042. actionResult.Status = (int)Constant.PDAResult.Success;
  6043. }
  6044. catch (Exception ex)
  6045. {
  6046. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6047. OutputLog.TraceLog(LogPriority.Error,
  6048. this.ToString(),
  6049. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6050. ex.ToString(),
  6051. LocalPath.LogExePath);
  6052. actionResult.Status = (int)Constant.PDAResult.Exception;
  6053. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6054. }
  6055. return actionResult;
  6056. }
  6057. /// <summary>
  6058. /// 获取盘点单明细
  6059. /// </summary>
  6060. /// <param name="sUserInfo"></param>
  6061. /// <returns></returns>
  6062. public ActionResult GetUpdateInCheckedInfoGet(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6063. {
  6064. ActionResult actionResult = new ActionResult();
  6065. try
  6066. {
  6067. // 验证请求头信息
  6068. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6069. // 验证失败
  6070. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6071. {
  6072. return actionResult;
  6073. }
  6074. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6075. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6076. actionResult.Result = JsonHelper.ToJson(ds);
  6077. actionResult.Status = (int)Constant.PDAResult.Success;
  6078. }
  6079. catch (Exception ex)
  6080. {
  6081. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6082. OutputLog.TraceLog(LogPriority.Error,
  6083. this.ToString(),
  6084. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6085. ex.ToString(),
  6086. LocalPath.LogExePath);
  6087. actionResult.Status = (int)Constant.PDAResult.Exception;
  6088. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6089. }
  6090. return actionResult;
  6091. }
  6092. /// <summary>
  6093. /// 半检检验条码
  6094. /// </summary>
  6095. /// <param name="sUserInfo"></param>
  6096. /// <returns></returns>
  6097. public ActionResult SemiCheckBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6098. {
  6099. ActionResult actionResult = new ActionResult();
  6100. try
  6101. {
  6102. // 验证请求头信息
  6103. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6104. // 验证失败
  6105. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6106. {
  6107. return actionResult;
  6108. }
  6109. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6110. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6111. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6112. if (Convert.ToInt32(resultEntity.Result) < 0)
  6113. {
  6114. actionResult.Status = (int)Constant.PDAResult.Fail;
  6115. }
  6116. else
  6117. {
  6118. actionResult.Status = (int)Constant.PDAResult.Success;
  6119. }
  6120. actionResult.Message = resultEntity.Message;
  6121. }
  6122. catch (Exception ex)
  6123. {
  6124. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6125. OutputLog.TraceLog(LogPriority.Error,
  6126. this.ToString(),
  6127. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6128. ex.ToString(),
  6129. LocalPath.LogExePath);
  6130. actionResult.Status = (int)Constant.PDAResult.Exception;
  6131. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6132. }
  6133. return actionResult;
  6134. }
  6135. /// <summary>
  6136. /// 根据条码获取经过的工序,用于绑定返工工序
  6137. /// </summary>
  6138. /// <param name="sUserInfo"></param>
  6139. /// <returns></returns>
  6140. public ActionResult GetSemiCheckPassProcedureGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6141. {
  6142. ActionResult actionResult = new ActionResult();
  6143. try
  6144. {
  6145. // 验证请求头信息
  6146. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6147. // 验证失败
  6148. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6149. {
  6150. return actionResult;
  6151. }
  6152. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6153. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6154. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6155. actionResult.Status = (int)Constant.PDAResult.Success;
  6156. }
  6157. catch (Exception ex)
  6158. {
  6159. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6160. OutputLog.TraceLog(LogPriority.Error,
  6161. this.ToString(),
  6162. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6163. ex.ToString(),
  6164. LocalPath.LogExePath);
  6165. actionResult.Status = (int)Constant.PDAResult.Exception;
  6166. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6167. }
  6168. return actionResult;
  6169. }
  6170. /// <summary>
  6171. /// 获取登陆帐户有无半检状态权限
  6172. /// </summary>
  6173. /// <param name="sUserInfo"></param>
  6174. /// <returns></returns>
  6175. public ActionResult GetSemiCheckStatusFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  6176. {
  6177. ActionResult actionResult = new ActionResult();
  6178. try
  6179. {
  6180. // 验证请求头信息
  6181. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6182. // 验证失败
  6183. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6184. {
  6185. return actionResult;
  6186. }
  6187. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6188. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6189. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6190. actionResult.Status = (int)Constant.PDAResult.Success;
  6191. }
  6192. catch (Exception ex)
  6193. {
  6194. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6195. OutputLog.TraceLog(LogPriority.Error,
  6196. this.ToString(),
  6197. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6198. ex.ToString(),
  6199. LocalPath.LogExePath);
  6200. actionResult.Status = (int)Constant.PDAResult.Exception;
  6201. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6202. }
  6203. return actionResult;
  6204. }
  6205. /// <summary>
  6206. /// 复检状态数据源
  6207. /// </summary>
  6208. /// <param name="sUserInfo"></param>
  6209. /// <returns></returns>
  6210. public ActionResult GetSemiCheckTypeGet(string accountCode, string userCode, string userPassword, string sessionKey)
  6211. {
  6212. ActionResult actionResult = new ActionResult();
  6213. try
  6214. {
  6215. // 验证请求头信息
  6216. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6217. // 验证失败
  6218. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6219. {
  6220. return actionResult;
  6221. }
  6222. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6223. () => SystemModuleLogic.GetSemiCheckType());
  6224. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6225. actionResult.Status = (int)Constant.PDAResult.Success;
  6226. }
  6227. catch (Exception ex)
  6228. {
  6229. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6230. OutputLog.TraceLog(LogPriority.Error,
  6231. this.ToString(),
  6232. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6233. ex.ToString(),
  6234. LocalPath.LogExePath);
  6235. actionResult.Status = (int)Constant.PDAResult.Exception;
  6236. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6237. }
  6238. return actionResult;
  6239. }
  6240. /// <summary>
  6241. /// 根据半成品检验数据ID,显示半成品数据信息
  6242. /// </summary>
  6243. /// <param name="sUserInfo"></param>
  6244. /// <returns></returns>
  6245. public ActionResult GetSemiCheckByIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6246. {
  6247. ActionResult actionResult = new ActionResult();
  6248. try
  6249. {
  6250. // 验证请求头信息
  6251. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6252. // 验证失败
  6253. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6254. {
  6255. return actionResult;
  6256. }
  6257. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6258. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6259. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6260. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6261. {
  6262. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6263. {
  6264. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6265. {
  6266. SemiCheckEntity productionData = new SemiCheckEntity();
  6267. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6268. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6269. {
  6270. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6271. }
  6272. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6273. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6274. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6275. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6276. productionData.ReFine = 0;
  6277. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6278. {
  6279. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6280. }
  6281. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6282. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6283. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6284. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6285. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6286. {
  6287. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6288. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6289. }
  6290. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6291. {
  6292. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6293. }
  6294. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6295. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6296. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6297. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6298. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6299. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6300. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6301. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6302. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6303. {
  6304. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6305. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6306. }
  6307. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6308. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6309. {
  6310. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6311. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6312. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6313. }
  6314. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6315. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6316. {
  6317. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6318. }
  6319. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6320. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6321. DataTable dtDefect = dvDefect.ToTable();
  6322. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6323. {
  6324. // 产品缺陷
  6325. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6326. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6327. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6328. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6329. //{
  6330. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6331. //}
  6332. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6333. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6334. {
  6335. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6336. }
  6337. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6338. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6339. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6340. {
  6341. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6342. }
  6343. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6344. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6345. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6346. {
  6347. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6348. }
  6349. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6350. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6351. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6352. {
  6353. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6354. }
  6355. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6356. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6357. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6358. //{
  6359. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6360. //}
  6361. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6362. //{
  6363. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6364. //}
  6365. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6366. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6367. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6368. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6369. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6370. {
  6371. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6372. }
  6373. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6374. {
  6375. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6376. }
  6377. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6378. //{
  6379. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6380. //}
  6381. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6382. //--------责任员工-------------------
  6383. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6384. if (drRow.Length > Constant.INT_IS_ZERO)
  6385. {
  6386. if (defect.DefectResponsibles == null)
  6387. {
  6388. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6389. }
  6390. foreach (DataRow r in drRow)
  6391. {
  6392. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6393. if (r["SemiCheckDefectID"].ToString() != "")
  6394. {
  6395. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6396. }
  6397. if (r["StaffID"].ToString() != "")
  6398. {
  6399. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6400. }
  6401. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6402. defectResponsible.StaffName = r["StaffName"].ToString();
  6403. if (r["StaffStatus"].ToString() != "")
  6404. {
  6405. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6406. }
  6407. if (r["UJobsID"].ToString() != "")
  6408. {
  6409. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6410. }
  6411. if (r["SJobsID"].ToString() != "")
  6412. {
  6413. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6414. }
  6415. defect.DefectResponsibles.Add(defectResponsible);
  6416. }
  6417. }
  6418. //------------------------------
  6419. if (productionData.SemiCheckDefects == null)
  6420. {
  6421. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6422. }
  6423. productionData.SemiCheckDefects.Add(defect);
  6424. }
  6425. //if (productionDatas.PDAProductionData == null)
  6426. //{
  6427. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6428. //}
  6429. productionDatas[0] = productionData;
  6430. //---------------------------------------------------------------------------------
  6431. }
  6432. }
  6433. }
  6434. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6435. actionResult.Status = (int)Constant.PDAResult.Success;
  6436. }
  6437. catch (Exception ex)
  6438. {
  6439. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6440. OutputLog.TraceLog(LogPriority.Error,
  6441. this.ToString(),
  6442. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6443. ex.ToString(),
  6444. LocalPath.LogExePath);
  6445. actionResult.Status = (int)Constant.PDAResult.Exception;
  6446. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6447. }
  6448. return actionResult;
  6449. }
  6450. /// <summary>
  6451. /// 保存半检登记
  6452. /// </summary>
  6453. /// <param name="accountCode">帐套code</param>
  6454. /// <param name="userCode">用户code</param>
  6455. /// <param name="userPassword">用户密码</param>
  6456. /// <param name="sessionKey">本次登陆密钥</param>
  6457. /// <param name="entity">半检实体类</param>
  6458. /// <param name="sUserInfo">用户基本信息</param>
  6459. /// <returns></returns>
  6460. public ActionResult AddSemiCheckGet(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6461. {
  6462. ActionResult actionResult = new ActionResult();
  6463. try
  6464. {
  6465. // 验证请求头信息
  6466. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6467. // 验证失败
  6468. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6469. {
  6470. return actionResult;
  6471. }
  6472. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6473. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6474. string err = string.Empty;
  6475. err = resultEntity.Message;
  6476. if (err == null)
  6477. {
  6478. err = "";
  6479. }
  6480. SemiCheckEntity entity = entityobj[0];
  6481. if (entity.SemiCheckCategory == 1) // 半检登记
  6482. {
  6483. }
  6484. else if (entity.SemiCheckCategory == 2)// 复检登记
  6485. {
  6486. err = JsonHelper.ToJson(err);
  6487. }
  6488. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6489. {
  6490. err = JsonHelper.ToJson(err);
  6491. }
  6492. //actionResult.Result = JsonHelper.ToJson(err);
  6493. actionResult.Result = err;//JsonHelper.ToJson(err);
  6494. actionResult.Status = (int)Constant.PDAResult.Success;
  6495. }
  6496. catch (Exception ex)
  6497. {
  6498. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6499. OutputLog.TraceLog(LogPriority.Error,
  6500. this.ToString(),
  6501. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6502. ex.ToString(),
  6503. LocalPath.LogExePath);
  6504. actionResult.Status = (int)Constant.PDAResult.Exception;
  6505. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6506. }
  6507. return actionResult;
  6508. }
  6509. /// <summary>
  6510. /// 根据所选工号,查出缺陷责任员工
  6511. /// </summary>
  6512. /// <param name="sUserInfo"></param>
  6513. /// <returns></returns>
  6514. public ActionResult GetSemiCheckDefectStaffByUserIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6515. {
  6516. ActionResult actionResult = new ActionResult();
  6517. try
  6518. {
  6519. // 验证请求头信息
  6520. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6521. // 验证失败
  6522. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6523. {
  6524. return actionResult;
  6525. }
  6526. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6527. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  6528. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6529. actionResult.Status = (int)Constant.PDAResult.Success;
  6530. }
  6531. catch (Exception ex)
  6532. {
  6533. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6534. OutputLog.TraceLog(LogPriority.Error,
  6535. this.ToString(),
  6536. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6537. ex.ToString(),
  6538. LocalPath.LogExePath);
  6539. actionResult.Status = (int)Constant.PDAResult.Exception;
  6540. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6541. }
  6542. return actionResult;
  6543. }
  6544. /// <summary>
  6545. /// 获取半成品缺陷管理的全部数据
  6546. /// </summary>
  6547. /// <param name="sUserInfo"></param>
  6548. /// <returns></returns>
  6549. public ActionResult GetAllSemicheckDefectGet(string accountCode, string userCode, string userPassword, string sessionKey)
  6550. {
  6551. ActionResult actionResult = new ActionResult();
  6552. try
  6553. {
  6554. // 验证请求头信息
  6555. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6556. // 验证失败
  6557. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6558. {
  6559. return actionResult;
  6560. }
  6561. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6562. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  6563. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6564. actionResult.Status = (int)Constant.PDAResult.Success;
  6565. }
  6566. catch (Exception ex)
  6567. {
  6568. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6569. OutputLog.TraceLog(LogPriority.Error,
  6570. this.ToString(),
  6571. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6572. ex.ToString(),
  6573. LocalPath.LogExePath);
  6574. actionResult.Status = (int)Constant.PDAResult.Exception;
  6575. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6576. }
  6577. return actionResult;
  6578. }
  6579. /// <summary>
  6580. /// 获取半成品缺陷位置管理的全部数据
  6581. /// </summary>
  6582. /// <param name="sUserInfo"></param>
  6583. /// <returns></returns>
  6584. public ActionResult GetAllScdefectPositionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  6585. {
  6586. ActionResult actionResult = new ActionResult();
  6587. try
  6588. {
  6589. // 验证请求头信息
  6590. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6591. // 验证失败
  6592. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6593. {
  6594. return actionResult;
  6595. }
  6596. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6597. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  6598. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6599. actionResult.Status = (int)Constant.PDAResult.Success;
  6600. }
  6601. catch (Exception ex)
  6602. {
  6603. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6604. OutputLog.TraceLog(LogPriority.Error,
  6605. this.ToString(),
  6606. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6607. ex.ToString(),
  6608. LocalPath.LogExePath);
  6609. actionResult.Status = (int)Constant.PDAResult.Exception;
  6610. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6611. }
  6612. return actionResult;
  6613. }
  6614. /// <summary>
  6615. /// 复检验条码
  6616. /// </summary>
  6617. /// <param name="sUserInfo"></param>
  6618. /// <returns></returns>
  6619. public ActionResult ReSemiCheckBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6620. {
  6621. ActionResult actionResult = new ActionResult();
  6622. try
  6623. {
  6624. // 验证请求头信息
  6625. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6626. // 验证失败
  6627. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6628. {
  6629. return actionResult;
  6630. }
  6631. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6632. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  6633. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6634. if (Convert.ToInt32(resultEntity.Result) < 0)
  6635. {
  6636. actionResult.Status = (int)Constant.PDAResult.Fail;
  6637. }
  6638. else
  6639. {
  6640. actionResult.Status = (int)Constant.PDAResult.Success;
  6641. }
  6642. actionResult.Message = resultEntity.Message;
  6643. }
  6644. catch (Exception ex)
  6645. {
  6646. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6647. OutputLog.TraceLog(LogPriority.Error,
  6648. this.ToString(),
  6649. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6650. ex.ToString(),
  6651. LocalPath.LogExePath);
  6652. actionResult.Status = (int)Constant.PDAResult.Exception;
  6653. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6654. }
  6655. return actionResult;
  6656. }
  6657. /// <summary>
  6658. /// 撤销复检验条码
  6659. /// </summary>
  6660. /// <param name="sUserInfo"></param>
  6661. /// <returns></returns>
  6662. public ActionResult CancelSemiCheckBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6663. {
  6664. ActionResult actionResult = new ActionResult();
  6665. try
  6666. {
  6667. // 验证请求头信息
  6668. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6669. // 验证失败
  6670. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6671. {
  6672. return actionResult;
  6673. }
  6674. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6675. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  6676. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6677. if (Convert.ToInt32(resultEntity.Result) < 0)
  6678. {
  6679. actionResult.Status = (int)Constant.PDAResult.Fail;
  6680. }
  6681. else
  6682. {
  6683. actionResult.Status = (int)Constant.PDAResult.Success;
  6684. }
  6685. actionResult.Message = resultEntity.Message;
  6686. }
  6687. catch (Exception ex)
  6688. {
  6689. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6690. OutputLog.TraceLog(LogPriority.Error,
  6691. this.ToString(),
  6692. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6693. ex.ToString(),
  6694. LocalPath.LogExePath);
  6695. actionResult.Status = (int)Constant.PDAResult.Exception;
  6696. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6697. }
  6698. return actionResult;
  6699. }
  6700. /// <summary>
  6701. /// 恢复数据
  6702. /// </summary>
  6703. /// <param name="sUserInfo"></param>
  6704. /// <returns></returns>
  6705. public ActionResult ResetBarCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6706. {
  6707. ActionResult actionResult = new ActionResult();
  6708. try
  6709. {
  6710. // 验证请求头信息
  6711. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6712. // 验证失败
  6713. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6714. {
  6715. return actionResult;
  6716. }
  6717. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6718. () => PMModuleLogicDAL.ResetBarCode(barcode));
  6719. if (resultEntity > 0)
  6720. {
  6721. actionResult.Status = (int)Constant.PDAResult.Success;
  6722. actionResult.Message = "恢复数据成功";
  6723. }
  6724. else
  6725. {
  6726. actionResult.Status = (int)Constant.PDAResult.Fail;
  6727. if (resultEntity == -1)
  6728. {
  6729. actionResult.Message = "此条码没有清除,不能恢复";
  6730. }
  6731. else if (resultEntity == 0)
  6732. {
  6733. actionResult.Message = "没有可恢复的数据";
  6734. }
  6735. }
  6736. }
  6737. catch (Exception ex)
  6738. {
  6739. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6740. OutputLog.TraceLog(LogPriority.Error,
  6741. this.ToString(),
  6742. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6743. ex.ToString(),
  6744. LocalPath.LogExePath);
  6745. actionResult.Status = (int)Constant.PDAResult.Exception;
  6746. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6747. }
  6748. return actionResult;
  6749. }
  6750. /// <summary>
  6751. /// 通过SettingCode获取系统参数管理的数据
  6752. /// </summary>
  6753. /// <param name="accountCode"></param>
  6754. /// <param name="userCode"></param>
  6755. /// <param name="userPassword"></param>
  6756. /// <param name="sessionKey"></param>
  6757. /// <param name="settingcode">设置编码</param>
  6758. /// <returns></returns>
  6759. public ActionResult GetSystemSettingDataByCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  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.GetSystemSettingDataByCode(settingcode, sUserInfo));
  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. /// 校验条码是否允许撤销,如果不允许提示错误消息
  6791. /// </summary>
  6792. /// <param name="accountCode"></param>
  6793. /// <param name="userCode"></param>
  6794. /// <param name="userPassword"></param>
  6795. /// <param name="sessionKey"></param>
  6796. /// <param name="orgTime">原时间</param>
  6797. /// <param name="days">允许撤销天数</param>
  6798. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  6799. /// <returns></returns>
  6800. public ActionResult BarcodeAllowCancelGet(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  6801. {
  6802. ActionResult actionResult = new ActionResult();
  6803. try
  6804. {
  6805. // 验证请求头信息
  6806. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6807. // 验证失败
  6808. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6809. {
  6810. return actionResult;
  6811. }
  6812. string[] subOrgTime = orgTime.Split('-');
  6813. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  6814. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6815. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  6816. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6817. if (Convert.ToInt32(resultEntity.Result) < 0)
  6818. {
  6819. actionResult.Status = (int)Constant.PDAResult.Fail;
  6820. }
  6821. else
  6822. {
  6823. actionResult.Status = (int)Constant.PDAResult.Success;
  6824. }
  6825. actionResult.Message = resultEntity.Message;
  6826. }
  6827. catch (Exception ex)
  6828. {
  6829. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6830. OutputLog.TraceLog(LogPriority.Error,
  6831. this.ToString(),
  6832. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6833. ex.ToString(),
  6834. LocalPath.LogExePath);
  6835. actionResult.Status = (int)Constant.PDAResult.Exception;
  6836. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6837. }
  6838. return actionResult;
  6839. }
  6840. /// <summary>
  6841. /// 获取生产订单管理的全部数据
  6842. /// </summary>
  6843. /// <param name="sUserInfo"></param>
  6844. /// <returns></returns>
  6845. public ActionResult GetOrderListGet(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  6846. {
  6847. ActionResult actionResult = new ActionResult();
  6848. try
  6849. {
  6850. // 验证请求头信息
  6851. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6852. // 验证失败
  6853. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6854. {
  6855. return actionResult;
  6856. }
  6857. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6858. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  6859. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6860. actionResult.Status = (int)Constant.PDAResult.Success;
  6861. }
  6862. catch (Exception ex)
  6863. {
  6864. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6865. OutputLog.TraceLog(LogPriority.Error,
  6866. this.ToString(),
  6867. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6868. ex.ToString(),
  6869. LocalPath.LogExePath);
  6870. actionResult.Status = (int)Constant.PDAResult.Exception;
  6871. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6872. }
  6873. return actionResult;
  6874. }
  6875. public ActionResult FinishedHandoverBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6876. {
  6877. ActionResult actionResult = new ActionResult();
  6878. try
  6879. {
  6880. // 验证请求头信息
  6881. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6882. // 验证失败
  6883. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6884. {
  6885. return actionResult;
  6886. }
  6887. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6888. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  6889. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6890. if (Convert.ToInt32(resultEntity.Result) < 0)
  6891. {
  6892. actionResult.Status = (int)Constant.PDAResult.Fail;
  6893. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  6894. }
  6895. else
  6896. {
  6897. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  6898. actionResult.Status = (int)Constant.PDAResult.Success;
  6899. }
  6900. actionResult.Message = resultEntity.Message;
  6901. }
  6902. catch (Exception ex)
  6903. {
  6904. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6905. OutputLog.TraceLog(LogPriority.Error,
  6906. this.ToString(),
  6907. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6908. ex.ToString(),
  6909. LocalPath.LogExePath);
  6910. actionResult.Status = (int)Constant.PDAResult.Exception;
  6911. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6912. }
  6913. return actionResult;
  6914. }
  6915. public ActionResult GetSystemDataGet(string accountCode, string userCode, string userPassword, string sessionKey)
  6916. {
  6917. ActionResult actionResult = new ActionResult();
  6918. try
  6919. {
  6920. // 验证请求头信息
  6921. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6922. // 验证失败
  6923. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6924. {
  6925. return actionResult;
  6926. }
  6927. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6928. () => SystemModuleLogic.GetSystemData(sUserInfo));
  6929. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6930. actionResult.Status = (int)Constant.PDAResult.Success;
  6931. }
  6932. catch (Exception ex)
  6933. {
  6934. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6935. OutputLog.TraceLog(LogPriority.Error,
  6936. this.ToString(),
  6937. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6938. ex.ToString(),
  6939. LocalPath.LogExePath);
  6940. actionResult.Status = (int)Constant.PDAResult.Exception;
  6941. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6942. }
  6943. return actionResult;
  6944. }
  6945. public ActionResult SaveFinishedHandoverGet(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  6946. {
  6947. ActionResult actionResult = new ActionResult();
  6948. try
  6949. {
  6950. // 验证请求头信息
  6951. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6952. // 验证失败
  6953. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6954. {
  6955. return actionResult;
  6956. }
  6957. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  6958. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6959. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  6960. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6961. if (Convert.ToInt32(resultEntity.Result) < 0)
  6962. {
  6963. actionResult.Status = (int)Constant.PDAResult.Fail;
  6964. }
  6965. else
  6966. {
  6967. actionResult.Status = (int)Constant.PDAResult.Success;
  6968. }
  6969. actionResult.Message = resultEntity.Message;
  6970. }
  6971. catch (Exception ex)
  6972. {
  6973. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6974. OutputLog.TraceLog(LogPriority.Error,
  6975. this.ToString(),
  6976. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6977. ex.ToString(),
  6978. LocalPath.LogExePath);
  6979. actionResult.Status = (int)Constant.PDAResult.Exception;
  6980. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6981. }
  6982. return actionResult;
  6983. }
  6984. public ActionResult CancelFinishedHandoverBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6985. {
  6986. ActionResult actionResult = new ActionResult();
  6987. try
  6988. {
  6989. // 验证请求头信息
  6990. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6991. // 验证失败
  6992. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6993. {
  6994. return actionResult;
  6995. }
  6996. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6997. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  6998. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6999. if (Convert.ToInt32(resultEntity.Result) < 0)
  7000. {
  7001. actionResult.Status = (int)Constant.PDAResult.Fail;
  7002. }
  7003. else
  7004. {
  7005. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7006. actionResult.Status = (int)Constant.PDAResult.Success;
  7007. }
  7008. actionResult.Message = resultEntity.Message;
  7009. }
  7010. catch (Exception ex)
  7011. {
  7012. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7013. OutputLog.TraceLog(LogPriority.Error,
  7014. this.ToString(),
  7015. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7016. ex.ToString(),
  7017. LocalPath.LogExePath);
  7018. actionResult.Status = (int)Constant.PDAResult.Exception;
  7019. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7020. }
  7021. return actionResult;
  7022. }
  7023. public ActionResult SaveCancelFinishedHandoverByBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7024. {
  7025. ActionResult actionResult = new ActionResult();
  7026. try
  7027. {
  7028. // 验证请求头信息
  7029. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7030. // 验证失败
  7031. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7032. {
  7033. return actionResult;
  7034. }
  7035. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7036. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7037. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7038. if (Convert.ToInt32(resultEntity.Result) < 0)
  7039. {
  7040. actionResult.Status = (int)Constant.PDAResult.Fail;
  7041. }
  7042. else
  7043. {
  7044. actionResult.Status = (int)Constant.PDAResult.Success;
  7045. }
  7046. actionResult.Message = resultEntity.Message;
  7047. }
  7048. catch (Exception ex)
  7049. {
  7050. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7051. OutputLog.TraceLog(LogPriority.Error,
  7052. this.ToString(),
  7053. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7054. ex.ToString(),
  7055. LocalPath.LogExePath);
  7056. actionResult.Status = (int)Constant.PDAResult.Exception;
  7057. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7058. }
  7059. return actionResult;
  7060. }
  7061. public ActionResult SaveChangeFinishedHandoverByBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7062. {
  7063. ActionResult actionResult = new ActionResult();
  7064. try
  7065. {
  7066. // 验证请求头信息
  7067. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7068. // 验证失败
  7069. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7070. {
  7071. return actionResult;
  7072. }
  7073. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7074. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7075. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7076. if (Convert.ToInt32(resultEntity.Result) < 0)
  7077. {
  7078. actionResult.Status = (int)Constant.PDAResult.Fail;
  7079. }
  7080. else
  7081. {
  7082. actionResult.Status = (int)Constant.PDAResult.Success;
  7083. }
  7084. actionResult.Message = resultEntity.Message;
  7085. }
  7086. catch (Exception ex)
  7087. {
  7088. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7089. OutputLog.TraceLog(LogPriority.Error,
  7090. this.ToString(),
  7091. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7092. ex.ToString(),
  7093. LocalPath.LogExePath);
  7094. actionResult.Status = (int)Constant.PDAResult.Exception;
  7095. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7096. }
  7097. return actionResult;
  7098. }
  7099. #region PDA条码打印
  7100. /// <summary>
  7101. /// 获取条码打印机
  7102. /// </summary>
  7103. /// <param name="accountCode"></param>
  7104. /// <param name="userCode"></param>
  7105. /// <param name="userPassword"></param>
  7106. /// <param name="sessionKey"></param>
  7107. /// <returns></returns>
  7108. public ActionResult GetBarcodePrinterGet(string accountCode, string userCode, string userPassword, string sessionKey)
  7109. {
  7110. ActionResult actionResult = new ActionResult();
  7111. try
  7112. {
  7113. // 验证请求头信息
  7114. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7115. // 验证失败
  7116. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7117. {
  7118. return actionResult;
  7119. }
  7120. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo);
  7121. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7122. actionResult.Status = (int)Constant.PDAResult.Success;
  7123. }
  7124. catch (Exception ex)
  7125. {
  7126. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7127. OutputLog.TraceLog(LogPriority.Error,
  7128. this.ToString(),
  7129. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7130. ex.ToString(),
  7131. LocalPath.LogExePath);
  7132. actionResult.Status = (int)Constant.PDAResult.Exception;
  7133. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7134. }
  7135. return actionResult;
  7136. }
  7137. /// <summary>
  7138. /// 打印条码样式
  7139. /// </summary>
  7140. /// <param name="accountCode"></param>
  7141. /// <param name="userCode"></param>
  7142. /// <param name="userPassword"></param>
  7143. /// <param name="sessionKey"></param>
  7144. /// <returns></returns>
  7145. public ActionResult PrintBarcodeLayoutGet(string accountCode, string userCode, string userPassword, string sessionKey
  7146. , string barcode, int copies, int printerID)
  7147. {
  7148. ActionResult actionResult = new ActionResult();
  7149. try
  7150. {
  7151. // 验证请求头信息
  7152. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7153. // 验证失败
  7154. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7155. {
  7156. return actionResult;
  7157. }
  7158. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7159. copies, printerID, sUserInfo);
  7160. if (sre.Status != Constant.ServiceResultStatus.Success)
  7161. {
  7162. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7163. actionResult.Message = sre.Message;
  7164. return actionResult;
  7165. }
  7166. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7167. actionResult.Status = (int)Constant.PDAResult.Success;
  7168. }
  7169. catch (Exception ex)
  7170. {
  7171. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7172. OutputLog.TraceLog(LogPriority.Error,
  7173. this.ToString(),
  7174. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7175. ex.ToString(),
  7176. LocalPath.LogExePath);
  7177. actionResult.Status = (int)Constant.PDAResult.Exception;
  7178. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7179. }
  7180. return actionResult;
  7181. }
  7182. #endregion PDA条码打印
  7183. #region 统计报表
  7184. /// <summary>
  7185. /// 成型结算报表
  7186. /// </summary>
  7187. /// <param name="accountCode"></param>
  7188. /// <param name="userCode"></param>
  7189. /// <param name="userPassword"></param>
  7190. /// <param name="sessionKey"></param>
  7191. /// <returns></returns>
  7192. public ActionResult GetGroutingSettlementInfoGet(string accountCode, string userCode, string userPassword, string sessionKey,
  7193. int currentMonth)
  7194. {
  7195. ActionResult actionResult = new ActionResult();
  7196. try
  7197. {
  7198. // 验证请求头信息
  7199. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7200. // 验证失败
  7201. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7202. {
  7203. return actionResult;
  7204. }
  7205. DateTime date = DateTime.Now;
  7206. if (currentMonth != 1)
  7207. {
  7208. date = date.AddMonths(-1);
  7209. }
  7210. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7211. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7212. if (resultEntity == null || resultEntity.Data == null)
  7213. {
  7214. actionResult.Status = (int)Constant.PDAResult.Fail;
  7215. actionResult.Message = "查询失败";
  7216. return actionResult;
  7217. }
  7218. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7219. {
  7220. actionResult.Status = (int)Constant.PDAResult.Fail;
  7221. actionResult.Message = resultEntity.Message;
  7222. return actionResult;
  7223. }
  7224. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7225. actionResult.Status = (int)Constant.PDAResult.Success;
  7226. }
  7227. catch (Exception ex)
  7228. {
  7229. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7230. OutputLog.TraceLog(LogPriority.Error,
  7231. this.ToString(),
  7232. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7233. ex.ToString(),
  7234. LocalPath.LogExePath);
  7235. actionResult.Status = (int)Constant.PDAResult.Exception;
  7236. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7237. }
  7238. return actionResult;
  7239. }
  7240. #endregion
  7241. #region 设置当期用户默认打印机配置
  7242. /// <summary>
  7243. /// 设置当期用户默认打印机配置
  7244. /// </summary>
  7245. /// <param name="accountCode"></param>
  7246. /// <param name="userCode"></param>
  7247. /// <param name="userPassword"></param>
  7248. /// <param name="sessionKey"></param>
  7249. /// <param name="printerID"></param>
  7250. /// <returns></returns>
  7251. public ActionResult SetCurrentUserPrinterGet(string accountCode, string userCode, string userPassword, string sessionKey,
  7252. int printerID)
  7253. {
  7254. ActionResult actionResult = new ActionResult();
  7255. try
  7256. {
  7257. // 验证请求头信息
  7258. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7259. // 验证失败
  7260. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7261. {
  7262. return actionResult;
  7263. }
  7264. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7265. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7266. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7267. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7268. {
  7269. actionResult.Status = (int)Constant.PDAResult.Fail;
  7270. }
  7271. else
  7272. {
  7273. actionResult.Status = (int)Constant.PDAResult.Success;
  7274. }
  7275. actionResult.Message = resultEntity.Message;
  7276. }
  7277. catch (Exception ex)
  7278. {
  7279. OutputLog.TraceLog(LogPriority.Error,
  7280. this.ToString(),
  7281. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7282. ex.ToString(),
  7283. LocalPath.LogExePath);
  7284. actionResult.Status = (int)Constant.PDAResult.Exception;
  7285. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7286. }
  7287. return actionResult;
  7288. }
  7289. /// <summary>
  7290. /// 校验产品条码是否可以进行回收
  7291. /// </summary>
  7292. /// <param name="accountCode">帐套code</param>
  7293. /// <param name="userCode">用户code</param>
  7294. /// <param name="userPassword">用户密码</param>
  7295. /// <param name="sessionKey">本次登陆密钥</param>
  7296. /// <param name="procedureID">工序ID</param>
  7297. /// <param name="barcode">条码</param>
  7298. /// <returns></returns>
  7299. /// <remarks>
  7300. /// 王鑫 2017.7.21 新建
  7301. /// </remarks>
  7302. public ActionResult CheckRecydingFlagBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7303. {
  7304. ActionResult actionResult = new ActionResult();
  7305. try
  7306. {
  7307. // 验证请求头信息
  7308. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7309. // 验证失败
  7310. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7311. {
  7312. return actionResult;
  7313. }
  7314. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7315. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7316. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7317. {
  7318. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7319. actionResult.Status = (int)Constant.PDAResult.Success;
  7320. }
  7321. else
  7322. {
  7323. actionResult.Status = (int)Constant.PDAResult.Fail;
  7324. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7325. }
  7326. }
  7327. catch (Exception ex)
  7328. {
  7329. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7330. OutputLog.TraceLog(LogPriority.Error,
  7331. this.ToString(),
  7332. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7333. ex.ToString(),
  7334. LocalPath.LogExePath);
  7335. actionResult.Status = (int)Constant.PDAResult.Exception;
  7336. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7337. }
  7338. return actionResult;
  7339. }
  7340. /// <summary>
  7341. /// 获取回收标识
  7342. /// </summary>
  7343. /// <param name="accountCode"></param>
  7344. /// <param name="userCode"></param>
  7345. /// <param name="userPassword"></param>
  7346. /// <param name="sessionKey"></param>
  7347. /// <param name="usercode">工号编码</param>
  7348. /// <returns></returns>
  7349. public ActionResult GetRecyclingflagByBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7350. {
  7351. ActionResult actionResult = new ActionResult();
  7352. try
  7353. {
  7354. // 验证请求头信息
  7355. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7356. // 验证失败
  7357. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7358. {
  7359. return actionResult;
  7360. }
  7361. int returnValue = ServiceInvoker.Invoke<int>(this,
  7362. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7363. actionResult.Result = JsonHelper.ToJson(returnValue);
  7364. actionResult.Status = (int)Constant.PDAResult.Success;
  7365. }
  7366. catch (Exception ex)
  7367. {
  7368. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7369. OutputLog.TraceLog(LogPriority.Error,
  7370. this.ToString(),
  7371. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7372. ex.ToString(),
  7373. LocalPath.LogExePath);
  7374. actionResult.Status = (int)Constant.PDAResult.Exception;
  7375. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7376. }
  7377. return actionResult;
  7378. }
  7379. #endregion
  7380. #region 注浆盘点
  7381. /// <summary>
  7382. /// 获取注浆盘点单列表
  7383. /// </summary>
  7384. /// <param name="sUserInfo"></param>
  7385. /// <returns></returns>
  7386. public ActionResult GetAllGBCheckedGet(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7387. {
  7388. ActionResult actionResult = new ActionResult();
  7389. try
  7390. {
  7391. // 验证请求头信息
  7392. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7393. // 验证失败
  7394. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7395. {
  7396. return actionResult;
  7397. }
  7398. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7399. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7400. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7401. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7402. actionResult.Result = JsonHelper.ToJson(ds);
  7403. actionResult.Status = (int)Constant.PDAResult.Success;
  7404. }
  7405. catch (Exception ex)
  7406. {
  7407. string json = JsonHelper.ToJson(entity);
  7408. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7409. OutputLog.TraceLog(LogPriority.Error,
  7410. this.ToString(),
  7411. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7412. ex.ToString(),
  7413. LocalPath.LogExePath);
  7414. actionResult.Status = (int)Constant.PDAResult.Exception;
  7415. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7416. }
  7417. return actionResult;
  7418. }
  7419. /// <summary>
  7420. /// 进行盘点操作
  7421. /// </summary>
  7422. /// <param name="accountCode"></param>
  7423. /// <param name="userCode"></param>
  7424. /// <param name="userPassword"></param>
  7425. /// <param name="sessionKey"></param>
  7426. /// <param name="InCheckedID">盘点单ID</param>
  7427. /// <param name="BarCode">产品条码</param>
  7428. /// <returns></returns>
  7429. public ActionResult UpdateGBCheckedGet(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7430. {
  7431. ActionResult actionResult = new ActionResult();
  7432. try
  7433. {
  7434. // 验证请求头信息
  7435. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7436. // 验证失败
  7437. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7438. {
  7439. return actionResult;
  7440. }
  7441. ClientRequestEntity cre = new ClientRequestEntity();
  7442. cre.Properties["CheckedID"] = CheckedID;
  7443. cre.Properties["Barcode"] = BarCode;
  7444. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7445. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7446. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7447. {
  7448. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7449. actionResult.Status = (int)Constant.PDAResult.Success;
  7450. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7451. }
  7452. else
  7453. {
  7454. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7455. actionResult.Status = (int)Constant.PDAResult.Fail;
  7456. actionResult.Message = returnValue.Message;
  7457. }
  7458. }
  7459. catch (Exception ex)
  7460. {
  7461. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7462. OutputLog.TraceLog(LogPriority.Error,
  7463. this.ToString(),
  7464. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7465. ex.ToString(),
  7466. LocalPath.LogExePath);
  7467. actionResult.Status = (int)Constant.PDAResult.Exception;
  7468. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7469. }
  7470. return actionResult;
  7471. }
  7472. /// <summary>
  7473. /// 获取盘点单明细
  7474. /// </summary>
  7475. /// <param name="sUserInfo"></param>
  7476. /// <returns></returns>
  7477. public ActionResult GetUpdateGBCheckedInfoGet(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7478. {
  7479. ActionResult actionResult = new ActionResult();
  7480. try
  7481. {
  7482. // 验证请求头信息
  7483. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7484. // 验证失败
  7485. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7486. {
  7487. return actionResult;
  7488. }
  7489. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7490. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  7491. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  7492. actionResult.Result = JsonHelper.ToJson(ds);
  7493. actionResult.Status = (int)Constant.PDAResult.Success;
  7494. }
  7495. catch (Exception ex)
  7496. {
  7497. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7498. OutputLog.TraceLog(LogPriority.Error,
  7499. this.ToString(),
  7500. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7501. ex.ToString(),
  7502. LocalPath.LogExePath);
  7503. actionResult.Status = (int)Constant.PDAResult.Exception;
  7504. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7505. }
  7506. return actionResult;
  7507. }
  7508. #endregion
  7509. #region 模具盘点
  7510. /// <summary>
  7511. /// 获取模具盘点单列表
  7512. /// </summary>
  7513. /// <param name="sUserInfo"></param>
  7514. /// <returns></returns>
  7515. public ActionResult GetAllMouldCheckedGet(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7516. {
  7517. ActionResult actionResult = new ActionResult();
  7518. try
  7519. {
  7520. // 验证请求头信息
  7521. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7522. // 验证失败
  7523. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7524. {
  7525. return actionResult;
  7526. }
  7527. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7528. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7529. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7530. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  7531. actionResult.Result = JsonHelper.ToJson(ds);
  7532. actionResult.Status = (int)Constant.PDAResult.Success;
  7533. }
  7534. catch (Exception ex)
  7535. {
  7536. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7537. OutputLog.TraceLog(LogPriority.Error,
  7538. this.ToString(),
  7539. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7540. ex.ToString(),
  7541. LocalPath.LogExePath);
  7542. actionResult.Status = (int)Constant.PDAResult.Exception;
  7543. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7544. }
  7545. return actionResult;
  7546. }
  7547. /// <summary>
  7548. /// 进行盘点操作
  7549. /// </summary>
  7550. /// <param name="accountCode"></param>
  7551. /// <param name="userCode"></param>
  7552. /// <param name="userPassword"></param>
  7553. /// <param name="sessionKey"></param>
  7554. /// <param name="InCheckedID">盘点单ID</param>
  7555. /// <param name="BarCode">产品条码</param>
  7556. /// <returns></returns>
  7557. public ActionResult UpdateMouldCheckedGet(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7558. {
  7559. ActionResult actionResult = new ActionResult();
  7560. try
  7561. {
  7562. // 验证请求头信息
  7563. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7564. // 验证失败
  7565. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7566. {
  7567. return actionResult;
  7568. }
  7569. ClientRequestEntity cre = new ClientRequestEntity();
  7570. cre.Properties["CheckedID"] = CheckedID;
  7571. cre.Properties["Barcode"] = BarCode;
  7572. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7573. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  7574. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7575. {
  7576. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7577. actionResult.Status = (int)Constant.PDAResult.Success;
  7578. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7579. }
  7580. else
  7581. {
  7582. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7583. actionResult.Status = (int)Constant.PDAResult.Fail;
  7584. actionResult.Message = returnValue.Message;
  7585. }
  7586. }
  7587. catch (Exception ex)
  7588. {
  7589. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7590. OutputLog.TraceLog(LogPriority.Error,
  7591. this.ToString(),
  7592. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7593. ex.ToString(),
  7594. LocalPath.LogExePath);
  7595. actionResult.Status = (int)Constant.PDAResult.Exception;
  7596. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7597. }
  7598. return actionResult;
  7599. }
  7600. /// <summary>
  7601. /// 获取盘点单明细
  7602. /// </summary>
  7603. /// <param name="sUserInfo"></param>
  7604. /// <returns></returns>
  7605. public ActionResult GetUpdateMouldCheckedInfoGet(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7606. {
  7607. ActionResult actionResult = new ActionResult();
  7608. try
  7609. {
  7610. // 验证请求头信息
  7611. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7612. // 验证失败
  7613. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7614. {
  7615. return actionResult;
  7616. }
  7617. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7618. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  7619. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  7620. actionResult.Result = JsonHelper.ToJson(ds);
  7621. actionResult.Status = (int)Constant.PDAResult.Success;
  7622. }
  7623. catch (Exception ex)
  7624. {
  7625. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7626. OutputLog.TraceLog(LogPriority.Error,
  7627. this.ToString(),
  7628. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7629. ex.ToString(),
  7630. LocalPath.LogExePath);
  7631. actionResult.Status = (int)Constant.PDAResult.Exception;
  7632. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7633. }
  7634. return actionResult;
  7635. }
  7636. #endregion
  7637. #region 通用接口
  7638. /// <summary>
  7639. /// PDA调用通用接口
  7640. /// </summary>
  7641. /// <param name="accountCode"></param>
  7642. /// <param name="userCode"></param>
  7643. /// <param name="userPassword"></param>
  7644. /// <param name="sessionKey"></param>
  7645. /// <param name="module"></param>
  7646. /// <param name="action"></param>
  7647. /// <param name="data"></param>
  7648. /// <returns></returns>
  7649. public ActionResult DoActionGet(string accountCode, string userCode, string userPassword, string sessionKey,
  7650. string module, string action, string jsonData)
  7651. {
  7652. ActionResult actionResult = null;
  7653. try
  7654. {
  7655. // 验证请求头信息
  7656. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7657. // 验证失败
  7658. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7659. {
  7660. return actionResult;
  7661. }
  7662. actionResult.Status = (int)Constant.PDAResult.Fail;
  7663. Dictionary<string, object> data = null;
  7664. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  7665. {
  7666. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  7667. }
  7668. #region PDA报表
  7669. if (module == "Report")
  7670. {
  7671. // 成型月度结算
  7672. if (action == "GetGroutingSettlementInfo")
  7673. {
  7674. DateTime month = DateTime.Now;
  7675. month = new DateTime(month.Year, month.Month, 1);
  7676. //month = new DateTime(2017, 6, 1);
  7677. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7678. if (currentMonth != 1)
  7679. {
  7680. month = month.AddMonths(-1);
  7681. }
  7682. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  7683. if (sre.Status == Constant.ServiceResultStatus.Success)
  7684. {
  7685. actionResult.Status = (int)Constant.PDAResult.Success;
  7686. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7687. }
  7688. else
  7689. {
  7690. actionResult.Status = (int)Constant.PDAResult.Fail;
  7691. actionResult.Message = sre.Message;
  7692. }
  7693. return actionResult;
  7694. }
  7695. // 成型月度结算-明细
  7696. if (action == "GetGroutingSettlementDetail")
  7697. {
  7698. DateTime month = DateTime.Now;
  7699. month = new DateTime(month.Year, month.Month, 1);
  7700. //month = new DateTime(2017, 6, 1);
  7701. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7702. if (currentMonth != 1)
  7703. {
  7704. month = month.AddMonths(-1);
  7705. }
  7706. string goodsCode = data["GoodsCode"].ToString();
  7707. string detailDate = data["DetailDate"].ToString();
  7708. DateTime? date = null;
  7709. if (detailDate != "合计")
  7710. {
  7711. date = DateTime.Parse(detailDate);
  7712. }
  7713. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  7714. if (sre.Status == Constant.ServiceResultStatus.Success)
  7715. {
  7716. actionResult.Status = (int)Constant.PDAResult.Success;
  7717. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7718. }
  7719. else
  7720. {
  7721. actionResult.Status = (int)Constant.PDAResult.Fail;
  7722. actionResult.Message = sre.Message;
  7723. }
  7724. return actionResult;
  7725. }
  7726. // 产成品交接汇总
  7727. if (action == "GetFinishedProductHandoverSum")
  7728. {
  7729. DateTime date = DateTime.Parse(data["date"].ToString());
  7730. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  7731. data["goodscode"] as string, sUserInfo);
  7732. if (sre.Status == Constant.ServiceResultStatus.Success)
  7733. {
  7734. actionResult.Status = (int)Constant.PDAResult.Success;
  7735. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7736. }
  7737. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  7738. {
  7739. actionResult.Status = (int)Constant.PDAResult.Success;
  7740. }
  7741. else
  7742. {
  7743. actionResult.Status = (int)Constant.PDAResult.Fail;
  7744. actionResult.Message = sre.Message;
  7745. }
  7746. return actionResult;
  7747. }
  7748. //xuwei add 2019-10-21
  7749. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  7750. if (action == "GetSemiReworkDayCount")
  7751. {
  7752. //不指定参数查询当天
  7753. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  7754. //dateStr = "2019-10-17";
  7755. //指定参数查询特定日期
  7756. if(data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  7757. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  7758. if (sre.Status == Constant.ServiceResultStatus.Success)
  7759. {
  7760. actionResult.Status = (int)Constant.PDAResult.Success;
  7761. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7762. }
  7763. else
  7764. {
  7765. actionResult.Status = (int)Constant.PDAResult.Fail;
  7766. actionResult.Message = sre.Message;
  7767. }
  7768. return actionResult;
  7769. }
  7770. //xuwe end
  7771. return actionResult;
  7772. }
  7773. #endregion
  7774. #region 模具管理
  7775. if (module == "PC_Mould")
  7776. {
  7777. #region 模具新建画面数据初始化
  7778. if (action == "GetMouldAddInit")
  7779. {
  7780. ClientRequestEntity cre = new ClientRequestEntity();
  7781. cre.Properties["MouldID"] = 0;
  7782. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  7783. if (sre.Status == Constant.ServiceResultStatus.Success)
  7784. {
  7785. actionResult.Status = (int)Constant.PDAResult.Success;
  7786. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7787. }
  7788. else
  7789. {
  7790. actionResult.Status = (int)Constant.PDAResult.Fail;
  7791. actionResult.Message = sre.Message;
  7792. }
  7793. return actionResult;
  7794. }
  7795. #endregion
  7796. #region 验证模具产品型号
  7797. if (action == "CheckGoodsCodeOnMould")
  7798. {
  7799. ClientRequestEntity cre = new ClientRequestEntity();
  7800. cre.Properties["GoodsCode"] = data["GoodsCode"];
  7801. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  7802. if (sre.Status == Constant.ServiceResultStatus.Success &&
  7803. sre.Data.Tables[0].Rows.Count > 0)
  7804. {
  7805. actionResult.Status = (int)Constant.PDAResult.Success;
  7806. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7807. }
  7808. else
  7809. {
  7810. actionResult.Status = (int)Constant.PDAResult.Fail;
  7811. actionResult.Message = "无效产品型号";
  7812. }
  7813. return actionResult;
  7814. }
  7815. #endregion
  7816. #region 验证模具生产工号
  7817. if (action == "CheckUserCodeOnMould")
  7818. {
  7819. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  7820. if (sre != null && sre.Rows.Count > 0)
  7821. {
  7822. actionResult.Status = (int)Constant.PDAResult.Success;
  7823. actionResult.Result = JsonHelper.ToJson(sre);
  7824. }
  7825. else
  7826. {
  7827. actionResult.Status = (int)Constant.PDAResult.Fail;
  7828. actionResult.Message = "无效生产工号";
  7829. }
  7830. return actionResult;
  7831. }
  7832. #endregion
  7833. #region 新建保存
  7834. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  7835. {
  7836. ClientRequestEntity cre = new ClientRequestEntity();
  7837. foreach (string item in data.Keys)
  7838. {
  7839. if (item == "ProductionDate")
  7840. {
  7841. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  7842. }
  7843. else
  7844. {
  7845. cre.Properties.Add(item, data[item]);
  7846. }
  7847. }
  7848. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  7849. if (sre.Status == Constant.ServiceResultStatus.Success)
  7850. {
  7851. actionResult.Status = (int)Constant.PDAResult.Success;
  7852. }
  7853. else
  7854. {
  7855. actionResult.Status = (int)Constant.PDAResult.Fail;
  7856. actionResult.Result = sre.OtherStatus;
  7857. actionResult.Message = sre.Message;
  7858. }
  7859. return actionResult;
  7860. }
  7861. #endregion
  7862. #region 模具编辑画面数据初始化
  7863. if (action == "GetMouldEditInfo")
  7864. {
  7865. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  7866. if (sre != null && sre.Rows.Count > 0)
  7867. {
  7868. actionResult.Status = (int)Constant.PDAResult.Success;
  7869. actionResult.Result = JsonHelper.ToJson(sre);
  7870. }
  7871. else
  7872. {
  7873. actionResult.Status = (int)Constant.PDAResult.Fail;
  7874. actionResult.Message = "无效模具条码";
  7875. }
  7876. return actionResult;
  7877. }
  7878. #endregion
  7879. #region 模具操作-画面初始化
  7880. if (action == "GetMouldOperationInit")
  7881. {
  7882. ClientRequestEntity cre = new ClientRequestEntity();
  7883. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  7884. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  7885. if (sre.Status == Constant.ServiceResultStatus.Success)
  7886. {
  7887. actionResult.Status = (int)Constant.PDAResult.Success;
  7888. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7889. }
  7890. else
  7891. {
  7892. actionResult.Status = (int)Constant.PDAResult.Fail;
  7893. actionResult.Result = sre.OtherStatus;
  7894. actionResult.Message = sre.Message;
  7895. }
  7896. return actionResult;
  7897. }
  7898. #endregion
  7899. #region 模具操作-验证模具条码
  7900. if (action == "CheckMouldBarcode")
  7901. {
  7902. ClientRequestEntity cre = new ClientRequestEntity();
  7903. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  7904. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  7905. if (sre.Status == Constant.ServiceResultStatus.Success)
  7906. {
  7907. if (sre.Data.Tables[0].Rows.Count == 0)
  7908. {
  7909. actionResult.Status = (int)Constant.PDAResult.Fail;
  7910. actionResult.Result = -1;
  7911. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  7912. return actionResult;
  7913. }
  7914. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  7915. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  7916. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  7917. #region 报损
  7918. if (mouldOperationType == 2)
  7919. {
  7920. if (mouldStatusID == 1 || mouldStatusID == 3)
  7921. {
  7922. actionResult.Status = (int)Constant.PDAResult.Success;
  7923. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7924. }
  7925. else
  7926. {
  7927. actionResult.Status = (int)Constant.PDAResult.Fail;
  7928. actionResult.Result = -2;
  7929. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  7930. }
  7931. return actionResult;
  7932. }
  7933. #endregion
  7934. #region 撤销
  7935. if (mouldOperationType == 3)
  7936. {
  7937. if (mouldStatusID == 4)
  7938. {
  7939. actionResult.Status = (int)Constant.PDAResult.Success;
  7940. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7941. }
  7942. else
  7943. {
  7944. actionResult.Status = (int)Constant.PDAResult.Fail;
  7945. actionResult.Result = -2;
  7946. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  7947. }
  7948. return actionResult;
  7949. }
  7950. #endregion
  7951. #region 领用
  7952. if (mouldOperationType == 4)
  7953. {
  7954. if (mouldStatusID == 1)
  7955. {
  7956. actionResult.Status = (int)Constant.PDAResult.Success;
  7957. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7958. }
  7959. else
  7960. {
  7961. actionResult.Status = (int)Constant.PDAResult.Fail;
  7962. actionResult.Result = -2;
  7963. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  7964. }
  7965. return actionResult;
  7966. }
  7967. #endregion
  7968. #region 回收
  7969. if (mouldOperationType == 5)
  7970. {
  7971. if (mouldStatusID == 3)
  7972. {
  7973. actionResult.Status = (int)Constant.PDAResult.Success;
  7974. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7975. }
  7976. else
  7977. {
  7978. actionResult.Status = (int)Constant.PDAResult.Fail;
  7979. actionResult.Result = -2;
  7980. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  7981. }
  7982. return actionResult;
  7983. }
  7984. #endregion
  7985. #region 变更型号
  7986. if (mouldOperationType == -1)
  7987. {
  7988. if (mouldStatusID != 4)
  7989. {
  7990. actionResult.Status = (int)Constant.PDAResult.Success;
  7991. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7992. }
  7993. else
  7994. {
  7995. actionResult.Status = (int)Constant.PDAResult.Fail;
  7996. actionResult.Result = -2;
  7997. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  7998. }
  7999. return actionResult;
  8000. }
  8001. #endregion
  8002. #region 替换条码
  8003. if (mouldOperationType == -2)
  8004. {
  8005. actionResult.Status = (int)Constant.PDAResult.Success;
  8006. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8007. return actionResult;
  8008. }
  8009. #endregion
  8010. return actionResult;
  8011. }
  8012. }
  8013. #endregion
  8014. #region 模具操作-保存
  8015. if (action == "SetMouldOperation")
  8016. {
  8017. ClientRequestEntity cre = new ClientRequestEntity();
  8018. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8019. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8020. cre.Properties["Remarks"] = data["Remarks"];
  8021. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8022. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8023. {
  8024. cre.Properties["GoodsID"] = data["GoodsID"];
  8025. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8026. }
  8027. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8028. {
  8029. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8030. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8031. }
  8032. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8033. if (sre.Status == Constant.ServiceResultStatus.Success)
  8034. {
  8035. actionResult.Status = (int)Constant.PDAResult.Success;
  8036. }
  8037. else
  8038. {
  8039. actionResult.Status = (int)Constant.PDAResult.Fail;
  8040. }
  8041. return actionResult;
  8042. }
  8043. #endregion
  8044. #region 模具操作-替换条码
  8045. if (action == "ChangedMouldBarcode")
  8046. {
  8047. ClientRequestEntity cre = new ClientRequestEntity();
  8048. cre.Properties["MouldID"] = data["MouldID"];
  8049. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8050. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8051. cre.Properties["Remarks"] = data["Remarks"];
  8052. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8053. if (sre.Status == Constant.ServiceResultStatus.Success)
  8054. {
  8055. actionResult.Status = (int)Constant.PDAResult.Success;
  8056. }
  8057. else
  8058. {
  8059. actionResult.Status = (int)Constant.PDAResult.Fail;
  8060. actionResult.Result = sre.OtherStatus;
  8061. actionResult.Message = sre.Message;
  8062. }
  8063. return actionResult;
  8064. }
  8065. #endregion
  8066. #region 模具跟踪表
  8067. if (action == "GetMoldTracking")
  8068. {
  8069. ClientRequestEntity cre = new ClientRequestEntity();
  8070. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8071. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8072. if (sre.Status == Constant.ServiceResultStatus.Success)
  8073. {
  8074. actionResult.Status = (int)Constant.PDAResult.Success;
  8075. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8076. }
  8077. else
  8078. {
  8079. actionResult.Status = (int)Constant.PDAResult.Fail;
  8080. actionResult.Message = "此模具条码不存在";
  8081. }
  8082. return actionResult;
  8083. }
  8084. #endregion
  8085. return actionResult;
  8086. }
  8087. #endregion
  8088. #region 成型线模具管理
  8089. if (module == "PC_GroutingLineMould")
  8090. {
  8091. #region 获取当前用户成型线模具管理权限
  8092. if (action == "GetGMouldStatusRight")
  8093. {
  8094. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8095. actionResult.Status = (int)Constant.PDAResult.Success;
  8096. if (right != null && right.Rows.Count > 0)
  8097. {
  8098. actionResult.Result = JsonHelper.ToJson(right);
  8099. }
  8100. return actionResult;
  8101. }
  8102. #endregion
  8103. #region 获取成型线状态等信息,和成型模具信息
  8104. if (action == "GetGroutingLineMould")
  8105. {
  8106. int? groutingLineID = null;
  8107. string groutingLineCode = null;
  8108. if (data.ContainsKey("GroutingLineID"))
  8109. {
  8110. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8111. }
  8112. else
  8113. {
  8114. groutingLineCode = data["GroutingLineCode"] + "";
  8115. }
  8116. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8117. if (lineInfo == null)
  8118. {
  8119. actionResult.Status = (int)Constant.PDAResult.Fail;
  8120. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8121. }
  8122. else
  8123. {
  8124. actionResult.Status = (int)Constant.PDAResult.Success;
  8125. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8126. }
  8127. return actionResult;
  8128. }
  8129. #endregion
  8130. #region 模具操作-画面初始化
  8131. if (action == "GetMouldOperationInit")
  8132. {
  8133. ClientRequestEntity cre = new ClientRequestEntity();
  8134. cre.Properties["MouldOperationType"] = 2;
  8135. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8136. if (sre.Status == Constant.ServiceResultStatus.Success)
  8137. {
  8138. actionResult.Status = (int)Constant.PDAResult.Success;
  8139. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8140. }
  8141. else
  8142. {
  8143. actionResult.Status = (int)Constant.PDAResult.Fail;
  8144. actionResult.Result = sre.OtherStatus;
  8145. actionResult.Message = sre.Message;
  8146. }
  8147. return actionResult;
  8148. }
  8149. #endregion
  8150. #region 成型模具操作-画面初始化
  8151. if (action == "GetGroutingMouldOperationInit")
  8152. {
  8153. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8154. if (initData != null && initData.Rows.Count > 0)
  8155. {
  8156. actionResult.Status = (int)Constant.PDAResult.Success;
  8157. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8158. foreach (DataRow item in initData.Rows)
  8159. {
  8160. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8161. }
  8162. actionResult.Result = JsonHelper.ToJson(syssetting);
  8163. }
  8164. else
  8165. {
  8166. actionResult.Status = (int)Constant.PDAResult.Fail;
  8167. }
  8168. return actionResult;
  8169. }
  8170. #endregion
  8171. #region 模具操作-验证模具条码
  8172. if (action == "CheckMouldBarcode")
  8173. {
  8174. ClientRequestEntity cre = new ClientRequestEntity();
  8175. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8176. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8177. if (sre.Status == Constant.ServiceResultStatus.Success)
  8178. {
  8179. if (sre.Data.Tables[0].Rows.Count == 0)
  8180. {
  8181. actionResult.Status = (int)Constant.PDAResult.Fail;
  8182. actionResult.Result = -1;
  8183. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8184. return actionResult;
  8185. }
  8186. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8187. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8188. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8189. #region 上线
  8190. if (mouldOperationType == 6)
  8191. {
  8192. if (mouldStatusID == 1 || mouldStatusID == 3)
  8193. {
  8194. if (data.ContainsKey("GoodsID"))
  8195. {
  8196. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8197. {
  8198. actionResult.Status = (int)Constant.PDAResult.Fail;
  8199. actionResult.Result = -3;
  8200. actionResult.Message =
  8201. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8202. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8203. "】与当前不一致";
  8204. return actionResult;
  8205. }
  8206. }
  8207. actionResult.Status = (int)Constant.PDAResult.Success;
  8208. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8209. }
  8210. else
  8211. {
  8212. actionResult.Status = (int)Constant.PDAResult.Fail;
  8213. actionResult.Result = -2;
  8214. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8215. }
  8216. return actionResult;
  8217. }
  8218. #endregion
  8219. return actionResult;
  8220. }
  8221. }
  8222. #endregion
  8223. #region 停用
  8224. if (action == "StopGroutingLineDetail")
  8225. {
  8226. if (data == null || !data.ContainsKey("Details"))
  8227. {
  8228. actionResult.Status = (int)Constant.PDAResult.Fail;
  8229. actionResult.Message = "参数错误";
  8230. return actionResult;
  8231. }
  8232. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8233. DataTable gTable = new DataTable();
  8234. gTable.Columns.Add("GroutingLineID", typeof(int));
  8235. gTable.Columns.Add("GroutingLineCode");
  8236. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8237. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8238. gTable.Columns.Add("GroutingMouldCode");
  8239. gTable.Columns.Add("RecordRemarks");
  8240. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8241. gTable.Columns.Add("MouldID", typeof(int));
  8242. gTable.Columns.Add("MouldCode");
  8243. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8244. string groutingLineCode = data["GroutingLineCode"] + "";
  8245. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8246. foreach (Dictionary<string, object> item in details)
  8247. {
  8248. int? mouldID = null;
  8249. if (item.ContainsKey("MouldID"))
  8250. {
  8251. mouldID = Convert.ToInt32(item["MouldID"]);
  8252. if (mouldID == 0)
  8253. {
  8254. mouldID = null;
  8255. }
  8256. }
  8257. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8258. item["GLineDetailID"], item["GLineDetailCode"],
  8259. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8260. mouldID, item["MouldCode"]);
  8261. }
  8262. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8263. if (result > 0)
  8264. {
  8265. actionResult.Status = (int)Constant.PDAResult.Success;
  8266. }
  8267. else
  8268. {
  8269. actionResult.Status = (int)Constant.PDAResult.Fail;
  8270. actionResult.Result = result;
  8271. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8272. return actionResult;
  8273. }
  8274. return actionResult;
  8275. }
  8276. #endregion
  8277. #region 启用
  8278. if (action == "StartGroutingLineDetail")
  8279. {
  8280. if (data == null || !data.ContainsKey("Details"))
  8281. {
  8282. actionResult.Status = (int)Constant.PDAResult.Fail;
  8283. actionResult.Message = "参数错误";
  8284. return actionResult;
  8285. }
  8286. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8287. DataTable gTable = new DataTable();
  8288. gTable.Columns.Add("GroutingLineID", typeof(int));
  8289. gTable.Columns.Add("GroutingLineCode");
  8290. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8291. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8292. gTable.Columns.Add("GroutingMouldCode");
  8293. gTable.Columns.Add("RecordRemarks");
  8294. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8295. gTable.Columns.Add("MouldID", typeof(int));
  8296. gTable.Columns.Add("MouldCode");
  8297. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8298. string groutingLineCode = data["GroutingLineCode"] + "";
  8299. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8300. foreach (Dictionary<string, object> item in details)
  8301. {
  8302. int? mouldID = null;
  8303. if (item.ContainsKey("MouldID"))
  8304. {
  8305. mouldID = Convert.ToInt32(item["MouldID"]);
  8306. if (mouldID == 0)
  8307. {
  8308. mouldID = null;
  8309. }
  8310. }
  8311. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8312. item["GLineDetailID"], item["GLineDetailCode"],
  8313. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8314. mouldID, item["MouldCode"]);
  8315. }
  8316. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8317. if (result > 0)
  8318. {
  8319. actionResult.Status = (int)Constant.PDAResult.Success;
  8320. }
  8321. else
  8322. {
  8323. actionResult.Status = (int)Constant.PDAResult.Fail;
  8324. actionResult.Result = result;
  8325. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8326. return actionResult;
  8327. }
  8328. return actionResult;
  8329. }
  8330. #endregion
  8331. #region 维修
  8332. if (action == "RepairStartGroutingLineDetail")
  8333. {
  8334. if (data == null || !data.ContainsKey("Details"))
  8335. {
  8336. actionResult.Status = (int)Constant.PDAResult.Fail;
  8337. actionResult.Message = "参数错误";
  8338. return actionResult;
  8339. }
  8340. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8341. DataTable gTable = new DataTable();
  8342. gTable.Columns.Add("GroutingLineID", typeof(int));
  8343. gTable.Columns.Add("GroutingLineCode");
  8344. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8345. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8346. gTable.Columns.Add("GroutingMouldCode");
  8347. gTable.Columns.Add("RecordRemarks");
  8348. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8349. gTable.Columns.Add("MouldID", typeof(int));
  8350. gTable.Columns.Add("MouldCode");
  8351. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8352. string groutingLineCode = data["GroutingLineCode"] + "";
  8353. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8354. foreach (Dictionary<string, object> item in details)
  8355. {
  8356. int? mouldID = null;
  8357. if (item.ContainsKey("MouldID"))
  8358. {
  8359. mouldID = Convert.ToInt32(item["MouldID"]);
  8360. if (mouldID == 0)
  8361. {
  8362. mouldID = null;
  8363. }
  8364. }
  8365. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8366. item["GLineDetailID"], item["GLineDetailCode"],
  8367. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8368. mouldID, item["MouldCode"]);
  8369. }
  8370. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8371. if (result > 0)
  8372. {
  8373. actionResult.Status = (int)Constant.PDAResult.Success;
  8374. }
  8375. else
  8376. {
  8377. actionResult.Status = (int)Constant.PDAResult.Fail;
  8378. actionResult.Result = result;
  8379. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8380. return actionResult;
  8381. }
  8382. return actionResult;
  8383. }
  8384. #endregion
  8385. #region 结束维修
  8386. if (action == "RepairEndGroutingLineDetail")
  8387. {
  8388. if (data == null || !data.ContainsKey("Details"))
  8389. {
  8390. actionResult.Status = (int)Constant.PDAResult.Fail;
  8391. actionResult.Message = "参数错误";
  8392. return actionResult;
  8393. }
  8394. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8395. DataTable gTable = new DataTable();
  8396. gTable.Columns.Add("GroutingLineID", typeof(int));
  8397. gTable.Columns.Add("GroutingLineCode");
  8398. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8399. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8400. gTable.Columns.Add("GroutingMouldCode");
  8401. gTable.Columns.Add("RecordRemarks");
  8402. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8403. gTable.Columns.Add("MouldID", typeof(int));
  8404. gTable.Columns.Add("MouldCode");
  8405. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8406. string groutingLineCode = data["GroutingLineCode"] + "";
  8407. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8408. foreach (Dictionary<string, object> item in details)
  8409. {
  8410. int? mouldID = null;
  8411. if (item.ContainsKey("MouldID"))
  8412. {
  8413. mouldID = Convert.ToInt32(item["MouldID"]);
  8414. if (mouldID == 0)
  8415. {
  8416. mouldID = null;
  8417. }
  8418. }
  8419. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8420. item["GLineDetailID"], item["GLineDetailCode"],
  8421. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8422. mouldID, item["MouldCode"]);
  8423. }
  8424. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8425. if (result > 0)
  8426. {
  8427. actionResult.Status = (int)Constant.PDAResult.Success;
  8428. }
  8429. else
  8430. {
  8431. actionResult.Status = (int)Constant.PDAResult.Fail;
  8432. actionResult.Result = result;
  8433. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8434. return actionResult;
  8435. }
  8436. return actionResult;
  8437. }
  8438. #endregion
  8439. #region 换模
  8440. if (action == "ChangeGMouldStartGroutingLineDetail")
  8441. {
  8442. if (data == null || !data.ContainsKey("Details"))
  8443. {
  8444. actionResult.Status = (int)Constant.PDAResult.Fail;
  8445. actionResult.Message = "参数错误";
  8446. return actionResult;
  8447. }
  8448. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8449. DataTable gTable = new DataTable();
  8450. gTable.Columns.Add("GroutingLineID", typeof(int));
  8451. gTable.Columns.Add("GroutingLineCode");
  8452. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8453. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8454. gTable.Columns.Add("GroutingMouldCode");
  8455. gTable.Columns.Add("RecordRemarks");
  8456. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8457. gTable.Columns.Add("MouldID", typeof(int));
  8458. gTable.Columns.Add("MouldCode");
  8459. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8460. gTable.Columns.Add("MouldStatus", typeof(int));
  8461. gTable.Columns.Add("ScrapReason", typeof(int));
  8462. gTable.Columns.Add("ScrapResponsibility");
  8463. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8464. string groutingLineCode = data["GroutingLineCode"] + "";
  8465. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8466. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8467. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8468. string scrapResponsibility = data["ScrapRemarks"] + "";
  8469. foreach (Dictionary<string, object> item in details)
  8470. {
  8471. int? mouldID = null;
  8472. if (item.ContainsKey("MouldID"))
  8473. {
  8474. mouldID = Convert.ToInt32(item["MouldID"]);
  8475. if (mouldID == 0)
  8476. {
  8477. mouldID = null;
  8478. }
  8479. }
  8480. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8481. item["GLineDetailID"], item["GLineDetailCode"],
  8482. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8483. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8484. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8485. }
  8486. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  8487. if (result > 0)
  8488. {
  8489. actionResult.Status = (int)Constant.PDAResult.Success;
  8490. }
  8491. else
  8492. {
  8493. actionResult.Status = (int)Constant.PDAResult.Fail;
  8494. actionResult.Result = result;
  8495. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8496. return actionResult;
  8497. }
  8498. return actionResult;
  8499. }
  8500. #endregion
  8501. #region 变产
  8502. if (action == "UpdateLineStartGroutingLineDetail")
  8503. {
  8504. if (data == null || !data.ContainsKey("Details"))
  8505. {
  8506. actionResult.Status = (int)Constant.PDAResult.Fail;
  8507. actionResult.Message = "参数错误";
  8508. return actionResult;
  8509. }
  8510. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8511. DataTable gTable = new DataTable();
  8512. gTable.Columns.Add("GroutingLineID", typeof(int));
  8513. gTable.Columns.Add("GroutingLineCode");
  8514. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8515. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8516. gTable.Columns.Add("GroutingMouldCode");
  8517. gTable.Columns.Add("RecordRemarks");
  8518. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8519. gTable.Columns.Add("MouldID", typeof(int));
  8520. gTable.Columns.Add("MouldCode");
  8521. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8522. gTable.Columns.Add("MouldStatus", typeof(int));
  8523. gTable.Columns.Add("ScrapReason", typeof(int));
  8524. gTable.Columns.Add("ScrapResponsibility");
  8525. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8526. string groutingLineCode = data["GroutingLineCode"] + "";
  8527. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8528. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8529. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8530. string scrapResponsibility = data["ScrapRemarks"] + "";
  8531. foreach (Dictionary<string, object> item in details)
  8532. {
  8533. int? mouldID = null;
  8534. if (item.ContainsKey("MouldID"))
  8535. {
  8536. mouldID = Convert.ToInt32(item["MouldID"]);
  8537. if (mouldID == 0)
  8538. {
  8539. mouldID = null;
  8540. }
  8541. }
  8542. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8543. item["GLineDetailID"], item["GLineDetailCode"],
  8544. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8545. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8546. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8547. }
  8548. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  8549. if (result > 0)
  8550. {
  8551. actionResult.Status = (int)Constant.PDAResult.Success;
  8552. }
  8553. else
  8554. {
  8555. actionResult.Status = (int)Constant.PDAResult.Fail;
  8556. actionResult.Result = result;
  8557. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8558. return actionResult;
  8559. }
  8560. return actionResult;
  8561. }
  8562. #endregion
  8563. #region 整线变产
  8564. if (action == "UpdateAllLineStartGroutingLineDetail")
  8565. {
  8566. if (data == null || !data.ContainsKey("Details"))
  8567. {
  8568. actionResult.Status = (int)Constant.PDAResult.Fail;
  8569. actionResult.Message = "参数错误";
  8570. return actionResult;
  8571. }
  8572. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8573. DataTable gTable = new DataTable();
  8574. gTable.Columns.Add("GroutingLineID", typeof(int));
  8575. gTable.Columns.Add("GroutingLineCode");
  8576. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8577. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8578. gTable.Columns.Add("GroutingMouldCode");
  8579. gTable.Columns.Add("RecordRemarks");
  8580. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8581. gTable.Columns.Add("MouldID", typeof(int));
  8582. gTable.Columns.Add("MouldCode");
  8583. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8584. gTable.Columns.Add("MouldStatus", typeof(int));
  8585. gTable.Columns.Add("ScrapReason", typeof(int));
  8586. gTable.Columns.Add("ScrapResponsibility");
  8587. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8588. string groutingLineCode = data["GroutingLineCode"] + "";
  8589. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8590. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8591. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8592. string scrapResponsibility = data["ScrapRemarks"] + "";
  8593. foreach (Dictionary<string, object> item in details)
  8594. {
  8595. int? mouldID = null;
  8596. if (item.ContainsKey("MouldID"))
  8597. {
  8598. mouldID = Convert.ToInt32(item["MouldID"]);
  8599. if (mouldID == 0)
  8600. {
  8601. mouldID = null;
  8602. }
  8603. }
  8604. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8605. item["GLineDetailID"], item["GLineDetailCode"],
  8606. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8607. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8608. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8609. }
  8610. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  8611. if (result > 0)
  8612. {
  8613. actionResult.Status = (int)Constant.PDAResult.Success;
  8614. }
  8615. else
  8616. {
  8617. actionResult.Status = (int)Constant.PDAResult.Fail;
  8618. actionResult.Result = result;
  8619. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8620. return actionResult;
  8621. }
  8622. return actionResult;
  8623. }
  8624. #endregion
  8625. #region 卸模
  8626. if (action == "UnloadGroutingLineDetail")
  8627. {
  8628. if (data == null || !data.ContainsKey("Details"))
  8629. {
  8630. actionResult.Status = (int)Constant.PDAResult.Fail;
  8631. actionResult.Message = "参数错误";
  8632. return actionResult;
  8633. }
  8634. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8635. DataTable gTable = new DataTable();
  8636. gTable.Columns.Add("GroutingLineID", typeof(int));
  8637. gTable.Columns.Add("GroutingLineCode");
  8638. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8639. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8640. gTable.Columns.Add("GroutingMouldCode");
  8641. gTable.Columns.Add("RecordRemarks");
  8642. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8643. gTable.Columns.Add("MouldID", typeof(int));
  8644. gTable.Columns.Add("MouldCode");
  8645. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8646. gTable.Columns.Add("MouldStatus", typeof(int));
  8647. gTable.Columns.Add("ScrapReason", typeof(int));
  8648. gTable.Columns.Add("ScrapResponsibility");
  8649. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8650. string groutingLineCode = data["GroutingLineCode"] + "";
  8651. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8652. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8653. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8654. string scrapResponsibility = data["ScrapRemarks"] + "";
  8655. foreach (Dictionary<string, object> item in details)
  8656. {
  8657. int? mouldID = null;
  8658. if (item.ContainsKey("MouldID"))
  8659. {
  8660. mouldID = Convert.ToInt32(item["MouldID"]);
  8661. if (mouldID == 0)
  8662. {
  8663. mouldID = null;
  8664. }
  8665. }
  8666. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8667. item["GLineDetailID"], item["GLineDetailCode"],
  8668. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8669. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8670. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8671. }
  8672. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  8673. if (result > 0)
  8674. {
  8675. actionResult.Status = (int)Constant.PDAResult.Success;
  8676. }
  8677. else
  8678. {
  8679. actionResult.Status = (int)Constant.PDAResult.Fail;
  8680. actionResult.Result = result;
  8681. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8682. return actionResult;
  8683. }
  8684. return actionResult;
  8685. }
  8686. #endregion
  8687. #region 结束换模
  8688. if (action == "ChangeGMouldEndGroutingLineDetail")
  8689. {
  8690. if (data == null || !data.ContainsKey("Details"))
  8691. {
  8692. actionResult.Status = (int)Constant.PDAResult.Fail;
  8693. actionResult.Message = "参数错误";
  8694. return actionResult;
  8695. }
  8696. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8697. DataTable gTable = new DataTable();
  8698. gTable.Columns.Add("GroutingLineID", typeof(int));
  8699. gTable.Columns.Add("GroutingLineCode");
  8700. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8701. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8702. gTable.Columns.Add("GroutingMouldCode");
  8703. gTable.Columns.Add("RreasonRemarks");
  8704. gTable.Columns.Add("RecordRemarks");
  8705. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8706. gTable.Columns.Add("MouldID", typeof(int));
  8707. gTable.Columns.Add("MouldCode");
  8708. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8709. gTable.Columns.Add("GoodsID", typeof(int));
  8710. gTable.Columns.Add("GoodsCode");
  8711. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8712. gTable.Columns.Add("GroutingCount", typeof(int));
  8713. gTable.Columns.Add("MouldSource");
  8714. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8715. string groutingLineCode = data["GroutingLineCode"] + "";
  8716. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8717. foreach (Dictionary<string, object> item in details)
  8718. {
  8719. int? mouldID = null;
  8720. if (item.ContainsKey("MouldID"))
  8721. {
  8722. mouldID = Convert.ToInt32(item["MouldID"]);
  8723. if (mouldID == 0)
  8724. {
  8725. mouldID = null;
  8726. }
  8727. }
  8728. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8729. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8730. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8731. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8732. item["GoodsID"], item["GoodsCode"],
  8733. item["StandardGroutingCount"], item["GroutingCount"],
  8734. (mouldID == null ? "0" : "1"));
  8735. }
  8736. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  8737. if (result.Status == Constant.ServiceResultStatus.Success)
  8738. {
  8739. actionResult.Status = (int)Constant.PDAResult.Success;
  8740. }
  8741. else if (result.OtherStatus == -100)
  8742. {
  8743. actionResult.Status = (int)Constant.PDAResult.Fail;
  8744. actionResult.Result = -100;
  8745. actionResult.Message = result.Message;
  8746. return actionResult;
  8747. }
  8748. else
  8749. {
  8750. actionResult.Status = (int)Constant.PDAResult.Fail;
  8751. actionResult.Result = -500;
  8752. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8753. return actionResult;
  8754. }
  8755. return actionResult;
  8756. }
  8757. #endregion
  8758. #region 结束变产
  8759. if (action == "UpdateLineEndGroutingLineDetail")
  8760. {
  8761. if (data == null || !data.ContainsKey("Details"))
  8762. {
  8763. actionResult.Status = (int)Constant.PDAResult.Fail;
  8764. actionResult.Message = "参数错误";
  8765. return actionResult;
  8766. }
  8767. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8768. DataTable gTable = new DataTable();
  8769. gTable.Columns.Add("GroutingLineID", typeof(int));
  8770. gTable.Columns.Add("GroutingLineCode");
  8771. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8772. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8773. gTable.Columns.Add("GroutingMouldCode");
  8774. gTable.Columns.Add("RreasonRemarks");
  8775. gTable.Columns.Add("RecordRemarks");
  8776. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8777. gTable.Columns.Add("MouldID", typeof(int));
  8778. gTable.Columns.Add("MouldCode");
  8779. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8780. gTable.Columns.Add("GoodsID", typeof(int));
  8781. gTable.Columns.Add("GoodsCode");
  8782. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8783. gTable.Columns.Add("GroutingCount", typeof(int));
  8784. gTable.Columns.Add("MouldSource");
  8785. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8786. string groutingLineCode = data["GroutingLineCode"] + "";
  8787. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8788. foreach (Dictionary<string, object> item in details)
  8789. {
  8790. int? mouldID = null;
  8791. if (item.ContainsKey("MouldID"))
  8792. {
  8793. mouldID = Convert.ToInt32(item["MouldID"]);
  8794. if (mouldID == 0)
  8795. {
  8796. mouldID = null;
  8797. }
  8798. }
  8799. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8800. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8801. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8802. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8803. item["GoodsID"], item["GoodsCode"],
  8804. item["StandardGroutingCount"], item["GroutingCount"],
  8805. (mouldID == null ? "0" : "1"));
  8806. }
  8807. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  8808. if (result.Status == Constant.ServiceResultStatus.Success)
  8809. {
  8810. actionResult.Status = (int)Constant.PDAResult.Success;
  8811. }
  8812. else if (result.OtherStatus == -100)
  8813. {
  8814. actionResult.Status = (int)Constant.PDAResult.Fail;
  8815. actionResult.Result = -100;
  8816. actionResult.Message = result.Message;
  8817. return actionResult;
  8818. }
  8819. else
  8820. {
  8821. actionResult.Status = (int)Constant.PDAResult.Fail;
  8822. actionResult.Result = -500;
  8823. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8824. return actionResult;
  8825. }
  8826. return actionResult;
  8827. }
  8828. #endregion
  8829. #region 结束整线变产
  8830. if (action == "UpdateAllLineEndGroutingLineDetail")
  8831. {
  8832. if (data == null || !data.ContainsKey("Details"))
  8833. {
  8834. actionResult.Status = (int)Constant.PDAResult.Fail;
  8835. actionResult.Message = "参数错误";
  8836. return actionResult;
  8837. }
  8838. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8839. DataTable gTable = new DataTable();
  8840. gTable.Columns.Add("GroutingLineID", typeof(int));
  8841. gTable.Columns.Add("GroutingLineCode");
  8842. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8843. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8844. gTable.Columns.Add("GroutingMouldCode");
  8845. gTable.Columns.Add("Remarks");
  8846. gTable.Columns.Add("RecordRemarks");
  8847. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8848. gTable.Columns.Add("MouldID", typeof(int));
  8849. gTable.Columns.Add("MouldCode");
  8850. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8851. gTable.Columns.Add("GoodsID", typeof(int));
  8852. gTable.Columns.Add("GoodsCode");
  8853. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8854. gTable.Columns.Add("GroutingCount", typeof(int));
  8855. gTable.Columns.Add("MouldSource");
  8856. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8857. string groutingLineCode = data["GroutingLineCode"] + "";
  8858. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8859. foreach (Dictionary<string, object> item in details)
  8860. {
  8861. int? mouldID = null;
  8862. if (item.ContainsKey("MouldID"))
  8863. {
  8864. mouldID = Convert.ToInt32(item["MouldID"]);
  8865. if (mouldID == 0)
  8866. {
  8867. mouldID = null;
  8868. }
  8869. }
  8870. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8871. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8872. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  8873. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8874. item["GoodsID"], item["GoodsCode"],
  8875. item["StandardGroutingCount"], item["GroutingCount"],
  8876. (mouldID == null ? "0" : "1"));
  8877. }
  8878. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  8879. if (result.Status == Constant.ServiceResultStatus.Success)
  8880. {
  8881. actionResult.Status = (int)Constant.PDAResult.Success;
  8882. }
  8883. else if (result.OtherStatus == -100)
  8884. {
  8885. actionResult.Status = (int)Constant.PDAResult.Fail;
  8886. actionResult.Result = -100;
  8887. actionResult.Message = result.Message;
  8888. return actionResult;
  8889. }
  8890. else
  8891. {
  8892. actionResult.Status = (int)Constant.PDAResult.Fail;
  8893. actionResult.Result = -500;
  8894. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8895. return actionResult;
  8896. }
  8897. return actionResult;
  8898. }
  8899. #endregion
  8900. #region 上模
  8901. if (action == "UpdateGroutingLine_AddMould")
  8902. {
  8903. if (data == null || !data.ContainsKey("Details"))
  8904. {
  8905. actionResult.Status = (int)Constant.PDAResult.Fail;
  8906. actionResult.Message = "参数错误";
  8907. return actionResult;
  8908. }
  8909. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8910. DataTable gTable = new DataTable();
  8911. gTable.Columns.Add("GroutingLineID", typeof(int));
  8912. gTable.Columns.Add("GroutingLineCode");
  8913. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8914. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8915. gTable.Columns.Add("GroutingMouldCode");
  8916. gTable.Columns.Add("Remarks");
  8917. gTable.Columns.Add("RecordRemarks");
  8918. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8919. gTable.Columns.Add("MouldID", typeof(int));
  8920. gTable.Columns.Add("MouldCode");
  8921. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8922. gTable.Columns.Add("GoodsID", typeof(int));
  8923. gTable.Columns.Add("GoodsCode");
  8924. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8925. gTable.Columns.Add("GroutingCount", typeof(int));
  8926. gTable.Columns.Add("MouldSource");
  8927. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8928. string groutingLineCode = data["GroutingLineCode"] + "";
  8929. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8930. foreach (Dictionary<string, object> item in details)
  8931. {
  8932. int? mouldID = null;
  8933. if (item.ContainsKey("MouldID"))
  8934. {
  8935. mouldID = Convert.ToInt32(item["MouldID"]);
  8936. if (mouldID == 0)
  8937. {
  8938. mouldID = null;
  8939. }
  8940. }
  8941. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  8942. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8943. gldID, item["GLineDetailCode"],
  8944. item["DetailRemarks"], item["RecordRemarks"],
  8945. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  8946. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8947. item["GoodsID"], item["GoodsCode"],
  8948. item["StandardGroutingCount"], item["GroutingCount"],
  8949. (mouldID == null ? "0" : "1"));
  8950. }
  8951. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  8952. if (result.Status == Constant.ServiceResultStatus.Success)
  8953. {
  8954. actionResult.Status = (int)Constant.PDAResult.Success;
  8955. }
  8956. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  8957. {
  8958. actionResult.Status = (int)Constant.PDAResult.Fail;
  8959. actionResult.Result = result.OtherStatus;
  8960. actionResult.Message = result.Message;
  8961. return actionResult;
  8962. }
  8963. else
  8964. {
  8965. actionResult.Status = (int)Constant.PDAResult.Fail;
  8966. actionResult.Result = -500;
  8967. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8968. return actionResult;
  8969. }
  8970. return actionResult;
  8971. }
  8972. #endregion
  8973. return actionResult;
  8974. }
  8975. #endregion
  8976. #region 包装装板限制
  8977. if (module == "FinishedLoadingCar")
  8978. {
  8979. if (action == "GetSetting")
  8980. {
  8981. ClientRequestEntity cre = new ClientRequestEntity();
  8982. cre.Properties["GoodsID"] = data["GoodsID"];
  8983. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  8984. if (sre.Status == Constant.ServiceResultStatus.Success)
  8985. {
  8986. actionResult.Status = (int)Constant.PDAResult.Success;
  8987. foreach (DataRow item in sre.Data.Tables[0].Rows)
  8988. {
  8989. if (item["settingcode"].ToString() == "S_PM_011")
  8990. {
  8991. cre.Properties["S_PM_011"] = item["settingvalue"];
  8992. }
  8993. else if (item["settingcode"].ToString() == "S_PM_012")
  8994. {
  8995. cre.Properties["S_PM_012"] = item["settingvalue"];
  8996. }
  8997. else if (item["settingcode"].ToString() == "S_PM_013")
  8998. {
  8999. cre.Properties["S_PM_013"] = item["settingvalue"];
  9000. }
  9001. }
  9002. cre.Properties["PlatelitNum"] = sre.Result;
  9003. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9004. }
  9005. else
  9006. {
  9007. actionResult.Status = (int)Constant.PDAResult.Fail;
  9008. actionResult.Message = "";
  9009. }
  9010. return actionResult;
  9011. }
  9012. }
  9013. #endregion
  9014. #region 成型报损
  9015. if (module == "GroutingScrapProduct")
  9016. {
  9017. // 查询注浆日报明细表
  9018. if ("GetGroutingDailyDetail" == action)
  9019. {
  9020. ClientRequestEntity cre = new ClientRequestEntity();
  9021. cre.NameSpace = module;
  9022. cre.Name = action;
  9023. if (!string.IsNullOrEmpty(jsonData))
  9024. {
  9025. cre.Properties["BarCode"] = data["BarCode"];
  9026. }
  9027. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9028. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9029. actionResult.Status = (int)Constant.PDAResult.Success;
  9030. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9031. || sre.Data.Tables[0].Rows.Count == 0)
  9032. {
  9033. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9034. actionResult.Status = (int)Constant.PDAResult.Fail;
  9035. }
  9036. else
  9037. {
  9038. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9039. // 判断是否进行了注浆
  9040. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9041. {
  9042. actionResult.Message = "该产品还未进行注浆!";
  9043. actionResult.Status = (int)Constant.PDAResult.Fail;
  9044. }
  9045. // 判断是否进行了交坯
  9046. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9047. {
  9048. actionResult.Message = "该产品已经交坯!";
  9049. actionResult.Status = (int)Constant.PDAResult.Fail;
  9050. }
  9051. // 判断是否已经报损
  9052. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9053. {
  9054. actionResult.Message = "该产品已经报损!";
  9055. actionResult.Status = (int)Constant.PDAResult.Fail;
  9056. }
  9057. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9058. }
  9059. }
  9060. // 获取成型报损原因
  9061. else if ("GetScrapReasonData" == action)
  9062. {
  9063. ClientRequestEntity cre = new ClientRequestEntity();
  9064. cre.NameSpace = module;
  9065. cre.Name = action;
  9066. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo);
  9067. actionResult.Status = (int)Constant.PDAResult.Success;
  9068. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9069. }
  9070. // 保存成型报损
  9071. else if ("SaveGroutingScrapProduct" == action)
  9072. {
  9073. ClientRequestEntity cre = new ClientRequestEntity();
  9074. cre.NameSpace = module;
  9075. cre.Name = action;
  9076. if (!string.IsNullOrEmpty(jsonData))
  9077. {
  9078. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9079. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9080. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9081. if (dt != null && dt.Rows.Count > 0)
  9082. {
  9083. // 总单信息
  9084. DataRow properties = dt.Rows[0];
  9085. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9086. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9087. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9088. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9089. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9090. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9091. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9092. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9093. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9094. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9095. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9096. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9097. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9098. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9099. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9100. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9101. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9102. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9103. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9104. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9105. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9106. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9107. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9108. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9109. // 责任员工
  9110. cre.Data = new DataSet();
  9111. //DataTable returnTable = returnData.Tables[1].Copy();
  9112. cre.Data.Tables.Add(dtResponsible);
  9113. }
  9114. }
  9115. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9116. if (sre.Status == Constant.ServiceResultStatus.Success)
  9117. {
  9118. actionResult.Status = (int)Constant.PDAResult.Success;
  9119. actionResult.Result = sre.Result;
  9120. }
  9121. else
  9122. {
  9123. actionResult.Status = (int)Constant.PDAResult.Fail;
  9124. actionResult.Result = sre.OtherStatus;
  9125. actionResult.Message = sre.Message;
  9126. }
  9127. }
  9128. // 获取成型报损信息 用于撤销使用
  9129. else if ("GetGroutingScrapProduct" == action)
  9130. {
  9131. ClientRequestEntity cre = new ClientRequestEntity();
  9132. cre.NameSpace = module;
  9133. cre.Name = action;
  9134. if (!string.IsNullOrEmpty(jsonData))
  9135. {
  9136. cre.Properties["BarCode"] = data["BarCode"];
  9137. }
  9138. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9139. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9140. actionResult.Status = (int)Constant.PDAResult.Success;
  9141. }
  9142. // 撤销成型报损
  9143. else if ("ReverseGroutingScrapProduct" == action)
  9144. {
  9145. ClientRequestEntity cre = new ClientRequestEntity();
  9146. cre.NameSpace = module;
  9147. cre.Name = action;
  9148. if (!string.IsNullOrEmpty(jsonData))
  9149. {
  9150. cre.Properties["BarCode"] = data["BarCode"];
  9151. }
  9152. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9153. if (sre.Status == Constant.ServiceResultStatus.Success)
  9154. {
  9155. actionResult.Status = (int)Constant.PDAResult.Success;
  9156. actionResult.Result = sre.Result;
  9157. }
  9158. else
  9159. {
  9160. actionResult.Status = (int)Constant.PDAResult.Fail;
  9161. actionResult.Result = sre.OtherStatus;
  9162. actionResult.Message = sre.Message;
  9163. }
  9164. }
  9165. }
  9166. #endregion
  9167. #region 产品挂起
  9168. if (module == "ProductSuspend")
  9169. {
  9170. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9171. if (action == "GetSuspendProcedure")
  9172. {
  9173. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9174. if (sre.Status == Constant.ServiceResultStatus.Success)
  9175. {
  9176. actionResult.Status = (int)Constant.PDAResult.Success;
  9177. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9178. }
  9179. else
  9180. {
  9181. actionResult.Status = (int)Constant.PDAResult.Fail;
  9182. actionResult.Message = sre.Message;
  9183. }
  9184. return actionResult;
  9185. }
  9186. // 验证挂起条码
  9187. if (action == "CheckSuspendBarcode")
  9188. {
  9189. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9190. if (sre.Status == Constant.ServiceResultStatus.Success)
  9191. {
  9192. actionResult.Status = (int)Constant.PDAResult.Success;
  9193. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9194. }
  9195. else
  9196. {
  9197. actionResult.Status = (int)Constant.PDAResult.Fail;
  9198. actionResult.Message = sre.Message;
  9199. }
  9200. return actionResult;
  9201. }
  9202. // 挂起条码
  9203. if (action == "SaveSuspendProduct")
  9204. {
  9205. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9206. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9207. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9208. if (sre.Status == Constant.ServiceResultStatus.Success)
  9209. {
  9210. actionResult.Status = (int)Constant.PDAResult.Success;
  9211. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9212. }
  9213. else
  9214. {
  9215. actionResult.Status = (int)Constant.PDAResult.Fail;
  9216. actionResult.Message = sre.Message;
  9217. }
  9218. return actionResult;
  9219. }
  9220. // 撤销挂起条码
  9221. if (action == "DeleteSuspendProduct")
  9222. {
  9223. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9224. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9225. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9226. if (sre.Status == Constant.ServiceResultStatus.Success)
  9227. {
  9228. actionResult.Status = (int)Constant.PDAResult.Success;
  9229. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9230. }
  9231. else
  9232. {
  9233. actionResult.Status = (int)Constant.PDAResult.Fail;
  9234. actionResult.Message = sre.Message;
  9235. }
  9236. return actionResult;
  9237. }
  9238. // 查询挂起条码
  9239. if (action == "GetSuspendProduct")
  9240. {
  9241. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9242. if (sre.Status == Constant.ServiceResultStatus.Success)
  9243. {
  9244. if (sre.Data.Tables[0].Rows.Count == 0)
  9245. {
  9246. actionResult.Status = (int)Constant.PDAResult.Fail;
  9247. actionResult.Message = "此条码没有可撤销的挂起信息";
  9248. }
  9249. else
  9250. {
  9251. actionResult.Status = (int)Constant.PDAResult.Success;
  9252. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9253. }
  9254. }
  9255. else
  9256. {
  9257. actionResult.Status = (int)Constant.PDAResult.Fail;
  9258. actionResult.Message = sre.Message;
  9259. }
  9260. return actionResult;
  9261. }
  9262. }
  9263. #endregion
  9264. #region 品保抽查
  9265. if (module == "QASpotCheck")
  9266. {
  9267. if (action == "GetAllQASpotCheck")
  9268. {
  9269. ClientRequestEntity cre = new ClientRequestEntity();
  9270. cre.NameSpace = module;
  9271. cre.Name = action;
  9272. if (data != null && data.Count > 0)
  9273. {
  9274. foreach (string item in data.Keys)
  9275. {
  9276. if (item.StartsWith("checktime"))
  9277. {
  9278. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9279. }
  9280. else
  9281. {
  9282. cre.Properties.Add(item, data[item]);
  9283. }
  9284. }
  9285. }
  9286. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9287. if (sre.Status == Constant.ServiceResultStatus.Success)
  9288. {
  9289. actionResult.Status = (int)Constant.PDAResult.Success;
  9290. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9291. }
  9292. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9293. {
  9294. actionResult.Status = (int)Constant.PDAResult.Success;
  9295. }
  9296. else
  9297. {
  9298. actionResult.Status = (int)Constant.PDAResult.Fail;
  9299. actionResult.Message = sre.Message;
  9300. }
  9301. return actionResult;
  9302. }
  9303. if (action == "AutoSaveQASpotCheck")
  9304. {
  9305. string barcode = data["barcode"] + "";
  9306. string remarks = data["remarks"] + "";
  9307. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9308. if (sre.Status == Constant.ServiceResultStatus.Success)
  9309. {
  9310. actionResult.Status = (int)Constant.PDAResult.Success;
  9311. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9312. }
  9313. else
  9314. {
  9315. actionResult.Status = (int)Constant.PDAResult.Fail;
  9316. actionResult.Message = sre.Message;
  9317. }
  9318. return actionResult;
  9319. }
  9320. if (action == "CheckQASpotCheck")
  9321. {
  9322. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9323. if (sre.Status == Constant.ServiceResultStatus.Success)
  9324. {
  9325. actionResult.Status = (int)Constant.PDAResult.Success;
  9326. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9327. }
  9328. else
  9329. {
  9330. actionResult.Status = (int)Constant.PDAResult.Fail;
  9331. actionResult.Message = sre.Message;
  9332. }
  9333. return actionResult;
  9334. }
  9335. if (action == "SaveQASpotCheck")
  9336. {
  9337. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9338. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9339. if (sre.Status == Constant.ServiceResultStatus.Success)
  9340. {
  9341. actionResult.Status = (int)Constant.PDAResult.Success;
  9342. }
  9343. else
  9344. {
  9345. actionResult.Status = (int)Constant.PDAResult.Fail;
  9346. actionResult.Message = sre.Message;
  9347. }
  9348. return actionResult;
  9349. }
  9350. return null;
  9351. }
  9352. #endregion
  9353. #region 产成品交接
  9354. if (module == "FinishedProduct")
  9355. {
  9356. // 设定商标
  9357. if (action == "GetFinishedBarcode")
  9358. {
  9359. string barcode = data["barcode"].ToString();
  9360. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  9361. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9362. if (Convert.ToInt32(resultEntity.Result) < 0)
  9363. {
  9364. actionResult.Status = (int)Constant.PDAResult.Fail;
  9365. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9366. actionResult.Message = resultEntity.Message;
  9367. }
  9368. else
  9369. {
  9370. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9371. actionResult.Status = (int)Constant.PDAResult.Success;
  9372. actionResult.Message = resultEntity.Message;
  9373. }
  9374. return actionResult;
  9375. }
  9376. if (action == "GetHandoveredBarcode")
  9377. {
  9378. string barcode = data["barcode"].ToString();
  9379. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  9380. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9381. if (Convert.ToInt32(resultEntity.Result) < 0)
  9382. {
  9383. actionResult.Status = (int)Constant.PDAResult.Fail;
  9384. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9385. actionResult.Message = resultEntity.Message;
  9386. }
  9387. else
  9388. {
  9389. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9390. actionResult.Status = (int)Constant.PDAResult.Success;
  9391. actionResult.Message = resultEntity.Message;
  9392. }
  9393. return actionResult;
  9394. }
  9395. if (action == "SetFinishedLogo")
  9396. {
  9397. int logoid = Convert.ToInt32(data["logoid"]);
  9398. string[] barcodes = data["barcodes"].ToString().Split(',');
  9399. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo);
  9400. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9401. if (result < 0)
  9402. {
  9403. actionResult.Status = (int)Constant.PDAResult.Fail;
  9404. }
  9405. else
  9406. {
  9407. actionResult.Status = (int)Constant.PDAResult.Success;
  9408. }
  9409. return actionResult;
  9410. }
  9411. if (action == "SetHandoveredOrder")
  9412. {
  9413. int orderID = Convert.ToInt32(data["orderID"]);
  9414. string[] barcodes = data["barcodes"].ToString().Split(',');
  9415. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  9416. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9417. if (result < 0)
  9418. {
  9419. actionResult.Status = (int)Constant.PDAResult.Fail;
  9420. }
  9421. else
  9422. {
  9423. actionResult.Status = (int)Constant.PDAResult.Success;
  9424. }
  9425. return actionResult;
  9426. }
  9427. }
  9428. #endregion
  9429. #region 产成品装车
  9430. /*
  9431. if (module == "FinishedLoading")
  9432. {
  9433. // 设定商标
  9434. if (action == "GetMaxLoadingNo")
  9435. {
  9436. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  9437. actionResult.Status = (int)Constant.PDAResult.Success;
  9438. actionResult.Result = no;
  9439. return actionResult;
  9440. }
  9441. if (action == "CheckFinishedLaodingBarcode")
  9442. {
  9443. string barcode = data["barcode"].ToString();
  9444. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  9445. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  9446. {
  9447. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9448. actionResult.Status = (int)Constant.PDAResult.Success;
  9449. actionResult.Message = resultEntity.Message;
  9450. }
  9451. else
  9452. {
  9453. actionResult.Status = (int)Constant.PDAResult.Fail;
  9454. actionResult.Result = resultEntity.OtherStatus;
  9455. actionResult.Message = resultEntity.Message;
  9456. }
  9457. return actionResult;
  9458. }
  9459. if (action == "SaveFinishedLoading")
  9460. {
  9461. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  9462. string carLicense = data["carLicense"] + "";
  9463. int palletNum = Convert.ToInt32(data["palletNum"]);
  9464. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  9465. string remarks = data["remarks"] + "";
  9466. Dictionary<string, object>[] details =
  9467. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  9468. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  9469. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  9470. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  9471. if (result.Status == Constant.ServiceResultStatus.Success)
  9472. {
  9473. actionResult.Status = (int)Constant.PDAResult.Success;
  9474. actionResult.Message = result.Message;
  9475. }
  9476. else
  9477. {
  9478. actionResult.Status = (int)Constant.PDAResult.Fail;
  9479. actionResult.Result = result.OtherStatus;
  9480. actionResult.Message = result.Message;
  9481. }
  9482. return actionResult;
  9483. }
  9484. }
  9485. */
  9486. #endregion
  9487. #region 产成品质量改判
  9488. if (module == "FinishedProductTamper")
  9489. {
  9490. // 获取产成品信息及缺陷数据
  9491. if (action == "GetDefectData")
  9492. {
  9493. string barcode = data["barcode"].ToString();
  9494. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  9495. if (sre.Status == Constant.ServiceResultStatus.Success)
  9496. {
  9497. actionResult.Status = (int)Constant.PDAResult.Success;
  9498. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9499. actionResult.Message = sre.Message;
  9500. }
  9501. else
  9502. {
  9503. actionResult.Status = (int)Constant.PDAResult.Fail;
  9504. actionResult.Result = sre.OtherStatus;
  9505. actionResult.Message = sre.Message;
  9506. }
  9507. return actionResult;
  9508. }
  9509. // 获取产成品信息及缺陷数据
  9510. if (action == "SaveDefectData")
  9511. {
  9512. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  9513. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  9514. if (sre.Status == Constant.ServiceResultStatus.Success)
  9515. {
  9516. actionResult.Status = (int)Constant.PDAResult.Success;
  9517. actionResult.Message = sre.Message;
  9518. }
  9519. else
  9520. {
  9521. actionResult.Status = (int)Constant.PDAResult.Fail;
  9522. actionResult.Message = sre.Message;
  9523. }
  9524. return actionResult;
  9525. }
  9526. // 通过条码查出责任工序(成品改判用)
  9527. if (action == "GetDutyProcedureByBarCodeForTamper")
  9528. {
  9529. string barcode = data["barcode"] + "";
  9530. int defectid = int.Parse(data["defectid"] + "");
  9531. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  9532. if (sre.Status == Constant.ServiceResultStatus.Success)
  9533. {
  9534. actionResult.Status = (int)Constant.PDAResult.Success;
  9535. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9536. actionResult.Message = sre.Message;
  9537. }
  9538. else
  9539. {
  9540. actionResult.Status = (int)Constant.PDAResult.Fail;
  9541. actionResult.Result = sre.OtherStatus;
  9542. actionResult.Message = sre.Message;
  9543. }
  9544. return actionResult;
  9545. }
  9546. }
  9547. #endregion
  9548. #region PDA独立功能
  9549. #region 水效标识
  9550. if (module == "WaterEffect")
  9551. {
  9552. // 获取产成品信息及水效标识
  9553. if (action == "GetGoodsByBarCode")
  9554. {
  9555. string barcode = data["barcode"].ToString();
  9556. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  9557. if (sre.Status == Constant.ServiceResultStatus.Success)
  9558. {
  9559. actionResult.Status = (int)Constant.PDAResult.Success;
  9560. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9561. actionResult.Message = sre.Message;
  9562. }
  9563. else
  9564. {
  9565. actionResult.Status = (int)Constant.PDAResult.Fail;
  9566. actionResult.Result = sre.OtherStatus;
  9567. actionResult.Message = sre.Message;
  9568. }
  9569. return actionResult;
  9570. }
  9571. }
  9572. #endregion
  9573. #region 盖板型号
  9574. if (module == "SeatCoverType")
  9575. {
  9576. // 获取产成品信息及水效标识
  9577. if (action == "SendGoodsCodeToPLC")
  9578. {
  9579. string barcode = data["barcode"].ToString();
  9580. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  9581. if (sre == 0)
  9582. {
  9583. actionResult.Status = (int)Constant.PDAResult.Success;
  9584. }
  9585. else
  9586. {
  9587. actionResult.Status = (int)Constant.PDAResult.Fail;
  9588. actionResult.Result = sre;
  9589. switch (sre)
  9590. {
  9591. case 1:
  9592. case 2:
  9593. actionResult.Message = "无效条码";
  9594. break;
  9595. case 3:
  9596. actionResult.Message = "此产品型号没有设置盖板标识码";
  9597. break;
  9598. case 4:
  9599. actionResult.Message = "当前用户没有设置PLC参数";
  9600. break;
  9601. case 5:
  9602. actionResult.Message = "PLC参数设置不全";
  9603. break;
  9604. default:
  9605. actionResult.Message = "PLC通信异常";
  9606. break;
  9607. }
  9608. }
  9609. return actionResult;
  9610. }
  9611. }
  9612. #endregion
  9613. #region PDA PLC 相关功能
  9614. if (module == "PDA_FUN_PLC")
  9615. {
  9616. // PDA扫码发送到PLCServer
  9617. if (action == "SendBarcodeToPLCServer")
  9618. {
  9619. string barcode = data["barcode"].ToString();
  9620. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  9621. if (sre == 0)
  9622. {
  9623. actionResult.Status = (int)Constant.PDAResult.Success;
  9624. }
  9625. else
  9626. {
  9627. actionResult.Status = (int)Constant.PDAResult.Fail;
  9628. actionResult.Result = sre;
  9629. switch (sre)
  9630. {
  9631. case 1:
  9632. case 2:
  9633. actionResult.Message = "无效条码";
  9634. break;
  9635. case 3:
  9636. actionResult.Message = "PLC通信异常";
  9637. break;
  9638. case 4:
  9639. actionResult.Message = "当前用户没有设置PLC参数";
  9640. break;
  9641. case 5:
  9642. actionResult.Message = "PLC参数设置不全";
  9643. break;
  9644. default:
  9645. actionResult.Message = "PLC通信异常";
  9646. break;
  9647. }
  9648. }
  9649. return actionResult;
  9650. }
  9651. }
  9652. #endregion
  9653. #endregion
  9654. #region 半检返修
  9655. if (module == "SemiRework")
  9656. {
  9657. // 验证半检返修条码
  9658. if (action == "CheckSemiReworkBarcode")
  9659. {
  9660. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9661. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  9662. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9663. if (Convert.ToInt32(resultEntity.Result) < 0)
  9664. {
  9665. actionResult.Status = (int)Constant.PDAResult.Fail;
  9666. }
  9667. else
  9668. {
  9669. actionResult.Status = (int)Constant.PDAResult.Success;
  9670. }
  9671. actionResult.Message = resultEntity.Message;
  9672. return actionResult;
  9673. }
  9674. // 可以返修的工序
  9675. if (action == "GetSemiReworkProcedure")
  9676. {
  9677. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9678. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  9679. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9680. actionResult.Status = (int)Constant.PDAResult.Success;
  9681. return actionResult;
  9682. }
  9683. // 根据条码获取经过的工序,用于责任工序
  9684. if (action == "GetSemiReworkPassProcedure")
  9685. {
  9686. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9687. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  9688. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9689. actionResult.Status = (int)Constant.PDAResult.Success;
  9690. return actionResult;
  9691. }
  9692. // 根据所选生产工序(生产数据ID)查询责任员工
  9693. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  9694. {
  9695. int productionDataID = Convert.ToInt32(jsonData);
  9696. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9697. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  9698. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9699. actionResult.Status = (int)Constant.PDAResult.Success;
  9700. return actionResult;
  9701. }
  9702. // 根据所选工号,查出缺陷责任员工
  9703. if (action == "GetSemiReworkDefectStaffByUserID")
  9704. {
  9705. int userID = Convert.ToInt32(jsonData);
  9706. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9707. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  9708. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9709. actionResult.Status = (int)Constant.PDAResult.Success;
  9710. return actionResult;
  9711. }
  9712. // 新建半检返修
  9713. if (action == "AddSemiRework")
  9714. {
  9715. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"]+"");
  9716. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9717. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  9718. actionResult.Result = resultEntity.Result;
  9719. actionResult.Message = resultEntity.Message;
  9720. if (Convert.ToInt32(resultEntity.Result) > 0)
  9721. {
  9722. actionResult.Status = (int)Constant.PDAResult.Success;
  9723. }
  9724. else
  9725. {
  9726. actionResult.Status = (int)Constant.PDAResult.Fail;
  9727. }
  9728. return actionResult;
  9729. }
  9730. // 编辑半检返修
  9731. if (action == "EditSemiRework")
  9732. {
  9733. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9734. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9735. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  9736. actionResult.Result = resultEntity.Result;
  9737. actionResult.Message = resultEntity.Message;
  9738. if (Convert.ToInt32(resultEntity.Result) > 0)
  9739. {
  9740. actionResult.Status = (int)Constant.PDAResult.Success;
  9741. }
  9742. else
  9743. {
  9744. actionResult.Status = (int)Constant.PDAResult.Fail;
  9745. }
  9746. return actionResult;
  9747. }
  9748. // 撤销半检返修
  9749. if (action == "CancelSemiRework")
  9750. {
  9751. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9752. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9753. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  9754. actionResult.Result = resultEntity.Result;
  9755. actionResult.Message = resultEntity.Message;
  9756. if (Convert.ToInt32(resultEntity.Result) > 0)
  9757. {
  9758. actionResult.Status = (int)Constant.PDAResult.Success;
  9759. }
  9760. else
  9761. {
  9762. actionResult.Status = (int)Constant.PDAResult.Fail;
  9763. }
  9764. return actionResult;
  9765. }
  9766. // 获取半检返修数据(PDA编辑用)
  9767. if (action == "GetSemiReworkByID")
  9768. {
  9769. int id = Convert.ToInt32(jsonData);
  9770. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9771. PMModuleLogic.GetSemiReworkByID(id, sUserInfo.UserCode);
  9772. DataTable data1 = resultEntity.Data.Tables[0];
  9773. DataTable data2 = resultEntity.Data.Tables[1];
  9774. DataTable data3 = resultEntity.Data.Tables[2];
  9775. if (data1.Rows.Count == 0)
  9776. {
  9777. actionResult.Status = (int)Constant.PDAResult.Fail;
  9778. actionResult.Message = "半检返修信息不存在";
  9779. return actionResult;
  9780. }
  9781. SemiReworkEntity srEntity = new SemiReworkEntity();
  9782. srEntity.SemiReworkID = id;
  9783. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  9784. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  9785. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  9786. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  9787. foreach (DataRow row2 in data2.Rows)
  9788. {
  9789. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  9790. srEntity.SemiReworkDefects.Add(defectEntity);
  9791. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  9792. defectEntity.SemiReworkID = id;
  9793. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  9794. defectEntity.DefectCode = row2["DefectCode"] + "";
  9795. defectEntity.DefectName = row2["DefectName"] + "";
  9796. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  9797. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  9798. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  9799. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  9800. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  9801. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  9802. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  9803. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  9804. defectEntity.Remarks = row2["Remarks"] + "";
  9805. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  9806. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  9807. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  9808. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  9809. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  9810. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  9811. if (row3s.Length == 0)
  9812. {
  9813. continue;
  9814. }
  9815. foreach (DataRow row3 in row3s)
  9816. {
  9817. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  9818. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  9819. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  9820. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  9821. semiReworkRPS.StaffName = row3["StaffName"] + "";
  9822. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  9823. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  9824. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  9825. semiReworkRPS.UserCode = row3["UserCode"] + "";
  9826. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  9827. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  9828. }
  9829. }
  9830. actionResult.Message = JsonHelper.ToJson(data1);
  9831. actionResult.Result = JsonHelper.ToJson(srEntity);
  9832. actionResult.Status = (int)Constant.PDAResult.Success;
  9833. }
  9834. }
  9835. #endregion
  9836. return actionResult;
  9837. }
  9838. catch (Exception ex)
  9839. {
  9840. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  9841. OutputLog.TraceLog(LogPriority.Error,
  9842. this.ToString(),
  9843. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  9844. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  9845. " module:" + module + " action:" + action + " json:" + jsonData,
  9846. ex.ToString(),
  9847. LocalPath.LogExePath);
  9848. actionResult.Status = (int)Constant.PDAResult.Exception;
  9849. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  9850. }
  9851. return actionResult;
  9852. }
  9853. #endregion
  9854. }
  9855. }