PDAModuleServiceGet.cs 374 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658
  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 Dongke.IBOSS.PRD.Basics.BaseResources;
  20. using Dongke.IBOSS.PRD.Basics.Library;
  21. using Dongke.IBOSS.PRD.Service.BarcodePrintService;
  22. using Dongke.IBOSS.PRD.Service.CommonModuleLogic;
  23. using Dongke.IBOSS.PRD.Service.DataModels;
  24. using Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic;
  25. using Dongke.IBOSS.PRD.Service.PCModuleLogic;
  26. using Dongke.IBOSS.PRD.Service.PDAModuleLogic;
  27. using Dongke.IBOSS.PRD.Service.PMModuleLogic;
  28. using Dongke.IBOSS.PRD.Service.PublicModuleService;
  29. using Dongke.IBOSS.PRD.Service.ReportModuleLogic;
  30. using Dongke.IBOSS.PRD.Service.SmartDeviceService;
  31. using Dongke.IBOSS.PRD.Service.SystemModuleLogic;
  32. using Dongke.IBOSS.PRD.WCF.Contracts;
  33. using Dongke.IBOSS.PRD.WCF.DataModels;
  34. using Dongke.IBOSS.PRD.WCF.DataModels.ConfigModule;
  35. using Dongke.IBOSS.PRD.WCF.DataModels.HRModule;
  36. using Dongke.IBOSS.PRD.WCF.DataModels.PCModule;
  37. using Dongke.IBOSS.PRD.WCF.DataModels.PMModule;
  38. namespace Dongke.IBOSS.PRD.WCF.Services
  39. {
  40. // 服务实现类,继承服务声明接口
  41. // 该标签声明该服务可以在ASP.NET下运行
  42. public partial class PDAModuleService : IPDAModule
  43. {
  44. #region 验证
  45. /// <summary>
  46. /// 验证访问头
  47. /// </summary>
  48. /// <param name="accountCode">帐套编码</param>
  49. /// <param name="userCode">用户编码</param>
  50. /// <param name="userPassword">用户密码</param>
  51. /// <param name="sessionKey">访问密钥</param>
  52. /// <returns></returns>
  53. private ActionResult DoPDACheckGet(string accountCode, string userCode, string userPassword, string sessionKey)
  54. {
  55. try
  56. {
  57. ActionResult actionResult = new ActionResult();
  58. LoginRequestEntity requestEntity = new LoginRequestEntity();
  59. requestEntity.AccountCode = accountCode;
  60. requestEntity.UserCode = userCode;
  61. requestEntity.Password = userPassword;
  62. requestEntity.SessionKey = sessionKey;
  63. SUserInfo userInfo = null;
  64. string loginStatus = DKIBOSSPRDLogic.AuthenticateRepeatLogin(requestEntity, out userInfo);
  65. // 用户登录信息错误
  66. if (Constant.INT_IS_ONE.ToString().Equals(loginStatus))
  67. {
  68. actionResult.Status = (int)Constant.PDAResult.LoginInfoError;
  69. actionResult.Message = Constant.PDA_RESULT_LOGININFOERROR;
  70. }
  71. // 用户在其它终端登陆
  72. else if (Constant.INT_IS_TWO.ToString().Equals(loginStatus))
  73. {
  74. actionResult.Status = (int)Constant.PDAResult.RepeatLogin;
  75. actionResult.Message = Constant.PDA_RESULT_REPEATLOGIN;
  76. }
  77. // Lic错误
  78. else if ("3".Equals(loginStatus))
  79. {
  80. actionResult.Status = (int)Constant.PDAResult.LicInfoError;
  81. actionResult.Message = "授权信息错误,请联系管理员。";
  82. }
  83. else
  84. {
  85. actionResult.Status = (int)Constant.PDAResult.Success;
  86. }
  87. sUserInfo = userInfo;
  88. return actionResult;
  89. }
  90. catch (Exception ex)
  91. {
  92. throw ex;
  93. }
  94. }
  95. #endregion
  96. #region WCF服务
  97. /// <summary>
  98. /// 测试PDA连接WCF服务
  99. /// </summary>
  100. /// <param name="value">测试文本</param>
  101. /// <returns>返回文本</returns>
  102. public string TestConnectionExGet(string value)
  103. {
  104. return "连接成功!" + value;
  105. }
  106. public string TestConnectionGet()
  107. {
  108. return "连接成功!";
  109. }
  110. #endregion
  111. #region 系统登录
  112. /// <summary>
  113. /// 系统登录
  114. /// </summary>
  115. /// <param name="accountCode"></param>
  116. /// <param name="userCode"></param>
  117. /// <param name="userPassword"></param>
  118. /// <param name="macAddress"></param>
  119. /// <param name="ipAddress"></param>
  120. /// <param name="phoneCode"></param>
  121. /// <param name="phoneType"></param>
  122. /// <param name="appVersion"></param>
  123. /// <param name="systemType"></param>
  124. /// <param name="systemVersion"></param>
  125. /// <returns></returns>
  126. public PDALoginResult DoPDALoginGet(string accountCode, string userCode, string userPassword,
  127. string macAddress, string ipAddress, string phoneCode, string phoneType,
  128. string appVersion, string systemType, string systemVersion)
  129. {
  130. try
  131. {
  132. LoginRequestEntity requestEntity = new LoginRequestEntity();
  133. requestEntity.AccountCode = accountCode;
  134. requestEntity.UserCode = userCode;
  135. requestEntity.Password = userPassword;
  136. requestEntity.ComputerName = phoneCode;
  137. requestEntity.IPAddress = ipAddress;
  138. requestEntity.MACAddress = macAddress;
  139. PDALoginResult result = ServiceInvoker.Invoke<PDALoginResult>(this,
  140. () => PDAModuleLogic.DoPDALogin(requestEntity));
  141. return result;
  142. }
  143. catch (Exception ex)
  144. {
  145. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  146. OutputLog.TraceLog(LogPriority.Error,
  147. this.ToString(),
  148. System.Reflection.MethodBase.GetCurrentMethod().Name,
  149. ex.ToString(),
  150. LocalPath.LogExePath);
  151. PDALoginResult result = new PDALoginResult();
  152. result.Status = (int)Constant.PDAResult.Exception;
  153. result.Message = Constant.PDA_RESULT_EXCEPTION;
  154. return result;
  155. }
  156. }
  157. /// <summary>
  158. /// 退出
  159. /// </summary>
  160. /// <param name="accountCode">帐套code</param>
  161. /// <param name="userCode">用户code</param>
  162. /// <param name="userPassword">用户密码</param>
  163. /// <param name="sessionKey">本次登陆密钥</param>
  164. /// <returns></returns>
  165. public ActionResult DoPDAOutGet(string accountCode, string userCode, string userPassword, string sessionKey)
  166. {
  167. ActionResult actionResult = new ActionResult();
  168. try
  169. {
  170. // 验证请求头信息
  171. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  172. // 验证失败
  173. if (actionResult.Status != (int)Constant.PDAResult.Success)
  174. {
  175. return actionResult;
  176. }
  177. bool result = DKIBOSSPRDLogic.Logout(sUserInfo.UserID, "3", sUserInfo);
  178. actionResult.Result = JsonHelper.ToJson(result);
  179. actionResult.Status = (int)Constant.PDAResult.Success;
  180. }
  181. catch (Exception ex)
  182. {
  183. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  184. OutputLog.TraceLog(LogPriority.Error,
  185. this.ToString(),
  186. System.Reflection.MethodBase.GetCurrentMethod().Name,
  187. ex.ToString(),
  188. LocalPath.LogExePath);
  189. actionResult.Status = (int)Constant.PDAResult.Exception;
  190. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  191. }
  192. return actionResult;
  193. }
  194. /// <summary>
  195. /// 修改密码
  196. /// </summary>
  197. /// <param name="accountCode"></param>
  198. /// <param name="userCode"></param>
  199. /// <param name="userPassword"></param>
  200. /// <param name="sessionKey"></param>
  201. /// <returns></returns>
  202. public ActionResult ChangeUserPasswordGet(string accountCode, string userCode, string userPassword, string sessionKey,
  203. string newPassWord)
  204. {
  205. ActionResult actionResult = new ActionResult();
  206. try
  207. {
  208. // 验证请求头信息
  209. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  210. // 验证失败
  211. if (actionResult.Status != (int)Constant.PDAResult.Success)
  212. {
  213. return actionResult;
  214. }
  215. string result = ServiceInvoker.Invoke<string>(this,
  216. () => SystemModuleDAL.SaveUserPassWord(newPassWord, userCode, null, sUserInfo));
  217. actionResult.Status = (int)Constant.PDAResult.Success;
  218. }
  219. catch (Exception ex)
  220. {
  221. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  222. OutputLog.TraceLog(LogPriority.Error,
  223. this.ToString(),
  224. System.Reflection.MethodBase.GetCurrentMethod().Name,
  225. ex.ToString(),
  226. LocalPath.LogExePath);
  227. actionResult.Status = (int)Constant.PDAResult.Exception;
  228. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  229. }
  230. return actionResult;
  231. }
  232. #endregion
  233. #region 取得展示数据
  234. /// <summary>
  235. /// 获得生产线菜单
  236. /// </summary>
  237. /// <param name="accountCode">帐套code</param>
  238. /// <param name="userCode">用户code</param>
  239. /// <param name="userPassword">用户密码</param>
  240. /// <param name="sessionKey">本次登陆密钥</param>
  241. /// <returns></returns>
  242. /// <remarks>
  243. /// 陈冰 2014.09.18 新建
  244. /// </remarks>
  245. public ActionResult GetProductionLineMenuGet(string accountCode, string userCode, string userPassword, string sessionKey)
  246. {
  247. ActionResult actionResult = new ActionResult();
  248. try
  249. {
  250. // 验证请求头信息
  251. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  252. // 验证失败
  253. if (actionResult.Status != (int)Constant.PDAResult.Success)
  254. {
  255. return actionResult;
  256. }
  257. // 查询菜单
  258. DataTable dtPLM = ServiceInvoker.Invoke<DataTable>(this,
  259. () => PDAModuleLogic.GetProductionLineMenu(sUserInfo));
  260. PDAFunctionResult pdaFunction = new PDAFunctionResult();
  261. pdaFunction.MenuCode = "Root";
  262. DataRow[] navigationRows = dtPLM.Select("LEN(MenuCode) = " + Constant.INT_IS_TWO.ToString(), "MenuCode ASC"); // 编号2为一级菜单
  263. foreach (DataRow newRow in navigationRows)
  264. {
  265. #region 插入子节点数据
  266. int? intProcedureID = null;
  267. int? intModelType = null;
  268. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  269. {
  270. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  271. }
  272. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  273. {
  274. intModelType = Convert.ToInt32(newRow["ModelType"]);
  275. }
  276. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  277. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  278. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  279. pdaFunctionChild.ProcedureID = intProcedureID;
  280. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  281. pdaFunctionChild.ModelType = intModelType;
  282. pdaFunction.PDAFunctions.Add(pdaFunctionChild);
  283. #endregion
  284. InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild);
  285. }
  286. //actionResult.Result = JsonHelper.ToJson(dtPLM);
  287. actionResult.Result = JsonHelper.ToJson(pdaFunction);
  288. actionResult.Status = (int)Constant.PDAResult.Success;
  289. }
  290. catch (Exception ex)
  291. {
  292. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  293. OutputLog.TraceLog(LogPriority.Error,
  294. this.ToString(),
  295. System.Reflection.MethodBase.GetCurrentMethod().Name,
  296. ex.ToString(),
  297. LocalPath.LogExePath);
  298. actionResult.Status = (int)Constant.PDAResult.Exception;
  299. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  300. }
  301. return actionResult;
  302. }
  303. /// <summary>
  304. /// 初始化树形控件
  305. /// </summary>
  306. /// <param name="treeTable">菜单数据表</param>
  307. /// <param name="rows">待处理的菜单集合</param>
  308. /// <param name="node">当前树节点</param>
  309. private void InitTreeViewGet(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions)
  310. {
  311. string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = "
  312. + (pFuncCode.Length + Constant.INT_IS_TWO);
  313. DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC");
  314. //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC");
  315. foreach (DataRow newRow in subRows)
  316. {
  317. #region 插入子节点数据
  318. int? intProcedureID = null;
  319. int? intModelType = null;
  320. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  321. {
  322. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  323. }
  324. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  325. {
  326. intModelType = Convert.ToInt32(newRow["ModelType"]);
  327. }
  328. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  329. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  330. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  331. pdaFunctionChild.ProcedureID = intProcedureID;
  332. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  333. pdaFunctionChild.ModelType = intModelType;
  334. pFunctions.PDAFunctions.Add(pdaFunctionChild);
  335. #endregion
  336. // 递归方法
  337. InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild);
  338. }
  339. }
  340. #endregion
  341. #region 获得工序信息
  342. /// <summary>
  343. /// 获得工序信息
  344. /// </summary>
  345. /// <param name="accountCode">帐套code</param>
  346. /// <param name="userCode">用户code</param>
  347. /// <param name="userPassword">用户密码</param>
  348. /// <param name="sessionKey">本次登陆密钥</param>
  349. /// <param name="procedureID">工序ID</param>
  350. /// <returns></returns>
  351. /// <remarks>
  352. /// 陈冰 2014.09.18 新建
  353. /// </remarks>
  354. public ActionResult GetProcedureByIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  355. {
  356. ActionResult actionResult = new ActionResult();
  357. try
  358. {
  359. // 验证请求头信息
  360. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  361. // 验证失败
  362. if (actionResult.Status != (int)Constant.PDAResult.Success)
  363. {
  364. return actionResult;
  365. }
  366. ProcedureEntity procedureEntity = ServiceInvoker.Invoke<ProcedureEntity>(this,
  367. () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo));
  368. actionResult.Result = JsonHelper.ToJson(procedureEntity);
  369. actionResult.Status = (int)Constant.PDAResult.Success;
  370. }
  371. catch (Exception ex)
  372. {
  373. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  374. OutputLog.TraceLog(LogPriority.Error,
  375. this.ToString(),
  376. System.Reflection.MethodBase.GetCurrentMethod().Name,
  377. ex.ToString(),
  378. LocalPath.LogExePath);
  379. actionResult.Status = (int)Constant.PDAResult.Exception;
  380. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  381. }
  382. return actionResult;
  383. }
  384. #endregion
  385. #region 校验
  386. /// <summary>
  387. /// 校验产品条码是否可以走到该工序
  388. /// </summary>
  389. /// <param name="accountCode">帐套code</param>
  390. /// <param name="userCode">用户code</param>
  391. /// <param name="userPassword">用户密码</param>
  392. /// <param name="sessionKey">本次登陆密钥</param>
  393. /// <param name="procedureID">工序ID</param>
  394. /// <param name="barcode">条码</param>
  395. /// <returns></returns>
  396. /// <remarks>
  397. /// 陈冰 2014.09.18 新建
  398. /// </remarks>
  399. public ActionResult CheckBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  400. {
  401. ActionResult actionResult = new ActionResult();
  402. try
  403. {
  404. // 验证请求头信息
  405. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  406. // 验证失败
  407. if (actionResult.Status != (int)Constant.PDAResult.Success)
  408. {
  409. return actionResult;
  410. }
  411. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  412. () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo));
  413. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  414. {
  415. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  416. actionResult.Status = (int)Constant.PDAResult.Success;
  417. }
  418. else
  419. {
  420. actionResult.Status = (int)Constant.PDAResult.Fail;
  421. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  422. }
  423. }
  424. catch (Exception ex)
  425. {
  426. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  427. OutputLog.TraceLog(LogPriority.Error,
  428. this.ToString(),
  429. System.Reflection.MethodBase.GetCurrentMethod().Name,
  430. ex.ToString(),
  431. LocalPath.LogExePath);
  432. actionResult.Status = (int)Constant.PDAResult.Exception;
  433. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  434. }
  435. return actionResult;
  436. }
  437. /// <summary>
  438. /// 校验产品条码是否可以进行干补
  439. /// </summary>
  440. /// <param name="accountCode">帐套code</param>
  441. /// <param name="userCode">用户code</param>
  442. /// <param name="userPassword">用户密码</param>
  443. /// <param name="sessionKey">本次登陆密钥</param>
  444. /// <param name="procedureID">工序ID</param>
  445. /// <param name="barcode">条码</param>
  446. /// <returns></returns>
  447. /// <remarks>
  448. /// 袁新成 2015.4.1 新建
  449. /// </remarks>
  450. public ActionResult CheckDryRepairBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  451. {
  452. ActionResult actionResult = new ActionResult();
  453. try
  454. {
  455. // 验证请求头信息
  456. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  457. // 验证失败
  458. if (actionResult.Status != (int)Constant.PDAResult.Success)
  459. {
  460. return actionResult;
  461. }
  462. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  463. () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
  464. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  465. {
  466. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  467. actionResult.Status = (int)Constant.PDAResult.Success;
  468. }
  469. else
  470. {
  471. actionResult.Status = (int)Constant.PDAResult.Fail;
  472. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  473. }
  474. }
  475. catch (Exception ex)
  476. {
  477. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  478. OutputLog.TraceLog(LogPriority.Error,
  479. this.ToString(),
  480. System.Reflection.MethodBase.GetCurrentMethod().Name,
  481. ex.ToString(),
  482. LocalPath.LogExePath);
  483. actionResult.Status = (int)Constant.PDAResult.Exception;
  484. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  485. }
  486. return actionResult;
  487. }
  488. /// <summary>
  489. /// 检验生产工号
  490. /// </summary>
  491. /// <param name="accountCode">帐套code</param>
  492. /// <param name="userCode">用户code</param>
  493. /// <param name="userPassword">用户密码</param>
  494. /// <param name="sessionKey">本次登陆密钥</param>
  495. /// <param name="procedureID">工序ID</param>
  496. /// <param name="procedureUserCode">生产工号</param>
  497. /// <remarks>
  498. /// 陈冰 2014.09.18 新建
  499. /// </remarks>
  500. public ActionResult CheckProcedureUserGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
  501. {
  502. ActionResult actionResult = new ActionResult();
  503. try
  504. {
  505. // 验证请求头信息
  506. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  507. // 验证失败
  508. if (actionResult.Status != (int)Constant.PDAResult.Success)
  509. {
  510. return actionResult;
  511. }
  512. CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
  513. () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
  514. actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
  515. actionResult.Status = (int)Constant.PDAResult.Success;
  516. }
  517. catch (Exception ex)
  518. {
  519. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  520. OutputLog.TraceLog(LogPriority.Error,
  521. this.ToString(),
  522. System.Reflection.MethodBase.GetCurrentMethod().Name,
  523. ex.ToString(),
  524. LocalPath.LogExePath);
  525. actionResult.Status = (int)Constant.PDAResult.Exception;
  526. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  527. }
  528. return actionResult;
  529. }
  530. /// <summary>
  531. /// 校验窑车是否可装车并返回窑车信息
  532. /// </summary>
  533. /// <param name="accountCode">帐套code</param>
  534. /// <param name="userCode">用户code</param>
  535. /// <param name="userPassword">用户密码</param>
  536. /// <param name="sessionKey">本次登陆密钥</param>
  537. /// <param name="kilnCarCode">窑车号</param>
  538. /// <param name="modelType">工序类别</param>
  539. /// <returns></returns>
  540. /// <remarks>
  541. /// 陈冰 2014.10.04 新建
  542. /// </remarks>
  543. public ActionResult CheckKilnCarGet(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
  544. {
  545. ActionResult actionResult = new ActionResult();
  546. try
  547. {
  548. // 验证请求头信息
  549. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  550. // 验证失败
  551. if (actionResult.Status != (int)Constant.PDAResult.Success)
  552. {
  553. return actionResult;
  554. }
  555. CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
  556. () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
  557. actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
  558. actionResult.Status = (int)Constant.PDAResult.Success;
  559. }
  560. catch (Exception ex)
  561. {
  562. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  563. OutputLog.TraceLog(LogPriority.Error,
  564. this.ToString(),
  565. System.Reflection.MethodBase.GetCurrentMethod().Name,
  566. ex.ToString(),
  567. LocalPath.LogExePath);
  568. actionResult.Status = (int)Constant.PDAResult.Exception;
  569. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  570. }
  571. return actionResult;
  572. }
  573. #endregion
  574. #region 保存条码信息
  575. /// <summary>
  576. /// 保存条码信息
  577. /// </summary>
  578. /// <param name="accountCode">帐套code</param>
  579. /// <param name="userCode">用户code</param>
  580. /// <param name="userPassword">用户密码</param>
  581. /// <param name="sessionKey">本次登陆密钥</param>
  582. /// <param name="procedureID">工序ID</param>
  583. /// <param name="productionDataEntitys">条码信息</param>
  584. public ActionResult AddWorkPieceGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  585. {
  586. ActionResult actionResult = new ActionResult();
  587. try
  588. {
  589. // 验证请求头信息
  590. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  591. // 验证失败
  592. if (actionResult.Status != (int)Constant.PDAResult.Success)
  593. {
  594. return actionResult;
  595. }
  596. DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
  597. if (!dtProductionData.Columns.Contains("IsPDA"))
  598. {
  599. dtProductionData.Columns.Add("IsPDA");
  600. }
  601. ProcedureEntity procedureInfo = null;
  602. DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
  603. () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
  604. actionResult.Result = JsonHelper.ToJson(resultDT);
  605. actionResult.Status = (int)Constant.PDAResult.Success;
  606. if (resultDT != null)
  607. {
  608. DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
  609. if (drs != null && drs.Length > 0)
  610. {
  611. return actionResult;
  612. }
  613. }
  614. #region PDA条码打印
  615. if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
  616. procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
  617. {
  618. try
  619. {
  620. if (procedureInfo.CollectType == 1)
  621. {
  622. //foreach (DataRow item in dtProductionData.Rows)
  623. //{
  624. // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
  625. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  626. // if (sre.Status != Constant.ServiceResultStatus.Success)
  627. // {
  628. // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  629. // actionResult.Message = sre.Message;
  630. // return actionResult;
  631. // }
  632. //}
  633. }
  634. else
  635. {
  636. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
  637. procedureInfo.BarCodePrintCopies, null, sUserInfo);
  638. if (sre.Status != Constant.ServiceResultStatus.Success)
  639. {
  640. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  641. actionResult.Message = sre.Message;
  642. return actionResult;
  643. }
  644. }
  645. }
  646. catch (Exception ex)
  647. {
  648. OutputLog.TraceLog(LogPriority.Error,
  649. this.ToString(),
  650. System.Reflection.MethodBase.GetCurrentMethod().Name,
  651. ex.ToString(),
  652. LocalPath.LogExePath);
  653. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  654. actionResult.Message = "条码打印异常";
  655. return actionResult;
  656. }
  657. }
  658. #endregion PDA条码打印
  659. }
  660. catch (Exception ex)
  661. {
  662. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  663. OutputLog.TraceLog(LogPriority.Error,
  664. this.ToString(),
  665. System.Reflection.MethodBase.GetCurrentMethod().Name,
  666. ex.ToString(),
  667. LocalPath.LogExePath);
  668. actionResult.Status = (int)Constant.PDAResult.Exception;
  669. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  670. }
  671. return actionResult;
  672. }
  673. #endregion
  674. #region 获得系统/基数数据
  675. /// <summary>
  676. /// 获得数据字典
  677. /// </summary>
  678. /// <param name="accountCode">帐套code</param>
  679. /// <param name="userCode">用户code</param>
  680. /// <param name="userPassword">用户密码</param>
  681. /// <param name="sessionKey">本次登陆密钥</param>
  682. /// <param name="dicType">字典类型</param>
  683. /// <returns></returns>
  684. public ActionResult GetDataDictionaryByTypeGet(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  685. {
  686. ActionResult actionResult = new ActionResult();
  687. try
  688. {
  689. // 验证请求头信息
  690. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  691. // 验证失败
  692. if (actionResult.Status != (int)Constant.PDAResult.Success)
  693. {
  694. return actionResult;
  695. }
  696. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  697. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  698. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  699. actionResult.Status = (int)Constant.PDAResult.Success;
  700. }
  701. catch (Exception ex)
  702. {
  703. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  704. OutputLog.TraceLog(LogPriority.Error,
  705. this.ToString(),
  706. System.Reflection.MethodBase.GetCurrentMethod().Name,
  707. ex.ToString(),
  708. LocalPath.LogExePath);
  709. actionResult.Status = (int)Constant.PDAResult.Exception;
  710. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  711. }
  712. return actionResult;
  713. }
  714. #endregion
  715. #region 检验工序接口
  716. /// <summary>
  717. /// 获得检验标识
  718. /// </summary>
  719. /// <param name="accountCode">帐套code</param>
  720. /// <param name="userCode">用户code</param>
  721. /// <param name="userPassword">用户密码</param>
  722. /// <param name="sessionKey">本次登陆密钥</param>
  723. /// <returns></returns>
  724. /// <remarks>
  725. /// 陈冰 2014.10.04 新建
  726. /// </remarks>
  727. public ActionResult GetDefectFlagDataGet(string accountCode, string userCode, string userPassword, string sessionKey)
  728. {
  729. ActionResult actionResult = new ActionResult();
  730. try
  731. {
  732. // 验证请求头信息
  733. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  734. // 验证失败
  735. if (actionResult.Status != (int)Constant.PDAResult.Success)
  736. {
  737. return actionResult;
  738. }
  739. #region 构造缺陷标识的数据源
  740. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  741. #endregion
  742. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  743. actionResult.Status = (int)Constant.PDAResult.Success;
  744. }
  745. catch (Exception ex)
  746. {
  747. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  748. OutputLog.TraceLog(LogPriority.Error,
  749. this.ToString(),
  750. System.Reflection.MethodBase.GetCurrentMethod().Name,
  751. ex.ToString(),
  752. LocalPath.LogExePath);
  753. actionResult.Status = (int)Constant.PDAResult.Exception;
  754. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  755. }
  756. return actionResult;
  757. }
  758. /// <summary>
  759. /// 由条码和当前检验工序获取返工工序
  760. /// </summary>
  761. /// <param name="accountCode">帐套code</param>
  762. /// <param name="userCode">用户code</param>
  763. /// <param name="userPassword">用户密码</param>
  764. /// <param name="sessionKey">本次登陆密钥</param>
  765. /// <param name="procedureID">当前检验工序ID</param>
  766. /// <param name="barcode">条码</param>
  767. /// <returns></returns>
  768. /// <remarks>
  769. /// 陈冰 2014.10.04 新建
  770. /// </remarks>
  771. public ActionResult GetReworkProcedureByBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  772. {
  773. ActionResult actionResult = new ActionResult();
  774. try
  775. {
  776. // 验证请求头信息
  777. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  778. // 验证失败
  779. if (actionResult.Status != (int)Constant.PDAResult.Success)
  780. {
  781. return actionResult;
  782. }
  783. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  784. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  785. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  786. {
  787. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  788. actionResult.Status = (int)Constant.PDAResult.Success;
  789. }
  790. else
  791. {
  792. actionResult.Status = (int)Constant.PDAResult.Fail;
  793. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  794. }
  795. }
  796. catch (Exception ex)
  797. {
  798. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  799. OutputLog.TraceLog(LogPriority.Error,
  800. this.ToString(),
  801. System.Reflection.MethodBase.GetCurrentMethod().Name,
  802. ex.ToString(),
  803. LocalPath.LogExePath);
  804. actionResult.Status = (int)Constant.PDAResult.Exception;
  805. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  806. }
  807. return actionResult;
  808. }
  809. /// <summary>
  810. /// 由当前检验工序获取缺陷列表
  811. /// </summary>
  812. /// <param name="accountCode">帐套code</param>
  813. /// <param name="userCode">用户code</param>
  814. /// <param name="userPassword">用户密码</param>
  815. /// <param name="sessionKey">本次登陆密钥</param>
  816. /// <param name="procedureID">当前检验工序ID</param>
  817. /// <param name="defectCode">缺陷编码</param>
  818. /// <returns></returns>
  819. /// <remarks>
  820. /// 陈冰 2014.10.04 新建
  821. /// </remarks>
  822. public ActionResult GetDefectByProcedureIDAndDefectCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  823. {
  824. ActionResult actionResult = new ActionResult();
  825. try
  826. {
  827. // 验证请求头信息
  828. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  829. // 验证失败
  830. if (actionResult.Status != (int)Constant.PDAResult.Success)
  831. {
  832. return actionResult;
  833. }
  834. object defectDs = ServiceInvoker.Invoke<object>(this,
  835. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  836. if (defectDs != null)
  837. {
  838. actionResult.Result = JsonHelper.ToJson(defectDs);
  839. actionResult.Status = (int)Constant.PDAResult.Success;
  840. }
  841. else
  842. {
  843. actionResult.Status = (int)Constant.PDAResult.Fail;
  844. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  845. }
  846. }
  847. catch (Exception ex)
  848. {
  849. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  850. OutputLog.TraceLog(LogPriority.Error,
  851. this.ToString(),
  852. System.Reflection.MethodBase.GetCurrentMethod().Name,
  853. ex.ToString(),
  854. LocalPath.LogExePath);
  855. actionResult.Status = (int)Constant.PDAResult.Exception;
  856. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  857. }
  858. return actionResult;
  859. }
  860. /// <summary>
  861. /// 根据产品ID查出缺陷位置
  862. /// </summary>
  863. /// <param name="accountCode">帐套code</param>
  864. /// <param name="userCode">用户code</param>
  865. /// <param name="userPassword">用户密码</param>
  866. /// <param name="sessionKey">本次登陆密钥</param>
  867. /// <param name="goodsID">产品ID</param>
  868. /// <param name="positionCode">位置编码</param>
  869. /// <returns></returns>
  870. /// <remarks>
  871. /// 陈冰 2014.10.04 新建
  872. /// </remarks>
  873. public ActionResult GetDefectPositionByGoodsIDAndPositionCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  874. {
  875. ActionResult actionResult = new ActionResult();
  876. try
  877. {
  878. // 验证请求头信息
  879. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  880. // 验证失败
  881. if (actionResult.Status != (int)Constant.PDAResult.Success)
  882. {
  883. return actionResult;
  884. }
  885. // 缺陷位置已经不用在关联产品
  886. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  887. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  888. if (defectDs != null)
  889. {
  890. actionResult.Result = JsonHelper.ToJson(defectDs);
  891. actionResult.Status = (int)Constant.PDAResult.Success;
  892. }
  893. else
  894. {
  895. actionResult.Status = (int)Constant.PDAResult.Fail;
  896. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  897. }
  898. }
  899. catch (Exception ex)
  900. {
  901. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  902. OutputLog.TraceLog(LogPriority.Error,
  903. this.ToString(),
  904. System.Reflection.MethodBase.GetCurrentMethod().Name,
  905. ex.ToString(),
  906. LocalPath.LogExePath);
  907. actionResult.Status = (int)Constant.PDAResult.Exception;
  908. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  909. }
  910. return actionResult;
  911. }
  912. /// <summary>
  913. /// 通过条码和缺陷查出责任工序
  914. /// </summary>
  915. /// <param name="accountCode">帐套code</param>
  916. /// <param name="userCode">用户code</param>
  917. /// <param name="userPassword">用户密码</param>
  918. /// <param name="sessionKey">本次登陆密钥</param>
  919. /// <param name="barcode">条码</param>
  920. /// <param name="defectid">缺陷ID</param>
  921. /// <returns></returns>
  922. /// <remarks>
  923. /// 陈冰 2014.10.04 新建
  924. /// </remarks>
  925. public ActionResult GetDutyProcedureByBarCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  926. {
  927. ActionResult actionResult = new ActionResult();
  928. try
  929. {
  930. // 验证请求头信息
  931. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  932. // 验证失败
  933. if (actionResult.Status != (int)Constant.PDAResult.Success)
  934. {
  935. return actionResult;
  936. }
  937. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  938. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  939. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  940. {
  941. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  942. actionResult.Status = (int)Constant.PDAResult.Success;
  943. }
  944. else
  945. {
  946. actionResult.Status = (int)Constant.PDAResult.Fail;
  947. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  948. }
  949. }
  950. catch (Exception ex)
  951. {
  952. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  953. OutputLog.TraceLog(LogPriority.Error,
  954. this.ToString(),
  955. System.Reflection.MethodBase.GetCurrentMethod().Name,
  956. ex.ToString(),
  957. LocalPath.LogExePath);
  958. actionResult.Status = (int)Constant.PDAResult.Exception;
  959. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  960. }
  961. return actionResult;
  962. }
  963. /// <summary>
  964. /// 通过条码与工序查出责任工号(己废)
  965. /// </summary>
  966. /// <param name="accountCode">帐套code</param>
  967. /// <param name="userCode">用户code</param>
  968. /// <param name="userPassword">用户密码</param>
  969. /// <param name="sessionKey">本次登陆密钥</param>
  970. /// <param name="barcode">条码</param>
  971. /// <param name="dutyProcedureID">责任工序</param>
  972. /// <returns></returns>
  973. /// <remarks>
  974. /// 陈冰 2014.10.04 新建
  975. /// </remarks>
  976. public ActionResult GetDutyProcedureCodeByBarCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  977. {
  978. ActionResult actionResult = new ActionResult();
  979. try
  980. {
  981. // 验证请求头信息
  982. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  983. // 验证失败
  984. if (actionResult.Status != (int)Constant.PDAResult.Success)
  985. {
  986. return actionResult;
  987. }
  988. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  989. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  990. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  991. {
  992. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  993. actionResult.Status = (int)Constant.PDAResult.Success;
  994. }
  995. else
  996. {
  997. actionResult.Status = (int)Constant.PDAResult.Fail;
  998. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  999. }
  1000. }
  1001. catch (Exception ex)
  1002. {
  1003. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1004. OutputLog.TraceLog(LogPriority.Error,
  1005. this.ToString(),
  1006. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1007. ex.ToString(),
  1008. LocalPath.LogExePath);
  1009. actionResult.Status = (int)Constant.PDAResult.Exception;
  1010. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1011. }
  1012. return actionResult;
  1013. }
  1014. /// <summary>
  1015. /// 通过条码与工序查出责任工号
  1016. /// </summary>
  1017. /// <param name="accountCode"></param>
  1018. /// <param name="userCode"></param>
  1019. /// <param name="userPassword"></param>
  1020. /// <param name="sessionKey"></param>
  1021. /// <param name="ProductionDataID">生产数据ID</param>
  1022. /// <returns></returns>
  1023. public ActionResult GetDutyProcedureCodeByProductionDataIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1024. {
  1025. ActionResult actionResult = new ActionResult();
  1026. try
  1027. {
  1028. // 验证请求头信息
  1029. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1030. // 验证失败
  1031. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1032. {
  1033. return actionResult;
  1034. }
  1035. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1036. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1037. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1038. {
  1039. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1040. actionResult.Status = (int)Constant.PDAResult.Success;
  1041. }
  1042. else
  1043. {
  1044. actionResult.Status = (int)Constant.PDAResult.Fail;
  1045. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1046. }
  1047. }
  1048. catch (Exception ex)
  1049. {
  1050. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1051. OutputLog.TraceLog(LogPriority.Error,
  1052. this.ToString(),
  1053. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1054. ex.ToString(),
  1055. LocalPath.LogExePath);
  1056. actionResult.Status = (int)Constant.PDAResult.Exception;
  1057. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1058. }
  1059. return actionResult;
  1060. }
  1061. /// <summary>
  1062. /// 通过生产数据与工号ID查询工种
  1063. /// </summary>
  1064. /// <param name="accountCode">帐套code</param>
  1065. /// <param name="userCode">用户code</param>
  1066. /// <param name="userPassword">用户密码</param>
  1067. /// <param name="sessionKey">本次登陆密钥</param>
  1068. /// <param name="productionDataID">生产数据ID</param>
  1069. /// <param name="userID">工号ID</param>
  1070. /// <returns></returns>
  1071. /// <remarks>
  1072. /// 陈冰 2014.10.08 新建
  1073. /// </remarks>
  1074. public ActionResult GetDutyJobsByUserIDAndProductionIDGet(string accountCode, string userCode, string userPassword, string sessionKey,
  1075. //int productionDataID, int userID)
  1076. int classesSettingID, int defectid, int procedureID)
  1077. {
  1078. ActionResult actionResult = new ActionResult();
  1079. try
  1080. {
  1081. // 验证请求头信息
  1082. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1083. // 验证失败
  1084. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1085. {
  1086. return actionResult;
  1087. }
  1088. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1089. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1090. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  1091. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1092. {
  1093. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1094. actionResult.Status = (int)Constant.PDAResult.Success;
  1095. }
  1096. else
  1097. {
  1098. actionResult.Status = (int)Constant.PDAResult.Fail;
  1099. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1100. }
  1101. }
  1102. catch (Exception ex)
  1103. {
  1104. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1105. OutputLog.TraceLog(LogPriority.Error,
  1106. this.ToString(),
  1107. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1108. ex.ToString(),
  1109. LocalPath.LogExePath);
  1110. actionResult.Status = (int)Constant.PDAResult.Exception;
  1111. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1112. }
  1113. return actionResult;
  1114. }
  1115. /// <summary>
  1116. /// 根据生产数据ID,用户ID及工种选出责任员工
  1117. /// </summary>
  1118. /// <param name="accountCode">帐套code</param>
  1119. /// <param name="userCode">用户code</param>
  1120. /// <param name="userPassword">用户密码</param>
  1121. /// <param name="sessionKey">本次登陆密钥</param>
  1122. /// <param name="productionDataID">生产数据ID</param>
  1123. /// <param name="userID">工号ID</param>
  1124. /// <param name="jobsID">工种ID</param>
  1125. /// <returns></returns>
  1126. /// <remarks>
  1127. /// 陈冰 2014.10.08 新建
  1128. /// </remarks>
  1129. public ActionResult GetDutyStaffByUserIDAndJobsGet(string accountCode, string userCode, string userPassword, string sessionKey,
  1130. //int productionDataID, int userID, int jobsID)
  1131. int classesSettingID, int jobsID)
  1132. {
  1133. ActionResult actionResult = new ActionResult();
  1134. try
  1135. {
  1136. // 验证请求头信息
  1137. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1138. // 验证失败
  1139. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1140. {
  1141. return actionResult;
  1142. }
  1143. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1144. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1145. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1146. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1147. {
  1148. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1149. actionResult.Status = (int)Constant.PDAResult.Success;
  1150. }
  1151. else
  1152. {
  1153. actionResult.Status = (int)Constant.PDAResult.Fail;
  1154. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1155. }
  1156. }
  1157. catch (Exception ex)
  1158. {
  1159. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1160. OutputLog.TraceLog(LogPriority.Error,
  1161. this.ToString(),
  1162. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1163. ex.ToString(),
  1164. LocalPath.LogExePath);
  1165. actionResult.Status = (int)Constant.PDAResult.Exception;
  1166. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1167. }
  1168. return actionResult;
  1169. }
  1170. /// <summary>
  1171. /// 获得产品分级
  1172. /// </summary>
  1173. /// <param name="accountCode">帐套code</param>
  1174. /// <param name="userCode">用户code</param>
  1175. /// <param name="userPassword">用户密码</param>
  1176. /// <param name="sessionKey">本次登陆密钥</param>
  1177. /// <returns></returns>
  1178. /// <remarks>
  1179. /// 陈冰 2014.10.08 新建
  1180. /// </remarks>
  1181. public ActionResult GetGoodsGradeDataGet(string accountCode, string userCode, string userPassword, string sessionKey)
  1182. {
  1183. ActionResult actionResult = new ActionResult();
  1184. try
  1185. {
  1186. // 验证请求头信息
  1187. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1188. // 验证失败
  1189. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1190. {
  1191. return actionResult;
  1192. }
  1193. #region 构造产品分级的数据源
  1194. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1195. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2, sUserInfo);
  1196. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1197. {
  1198. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1199. actionResult.Status = (int)Constant.PDAResult.Success;
  1200. }
  1201. else
  1202. {
  1203. actionResult.Status = (int)Constant.PDAResult.Fail;
  1204. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1205. }
  1206. #endregion
  1207. }
  1208. catch (Exception ex)
  1209. {
  1210. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1211. OutputLog.TraceLog(LogPriority.Error,
  1212. this.ToString(),
  1213. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1214. ex.ToString(),
  1215. LocalPath.LogExePath);
  1216. OutputLog.TraceLog(LogPriority.Error,
  1217. this.ToString(),
  1218. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1219. ex.ToString(),
  1220. LocalPath.LogExePath);
  1221. actionResult.Status = (int)Constant.PDAResult.Exception;
  1222. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1223. }
  1224. return actionResult;
  1225. }
  1226. #endregion
  1227. #region 保存检验条码
  1228. /// <summary>
  1229. /// 保存检验条码
  1230. /// </summary>
  1231. /// <param name="accountCode">帐套code</param>
  1232. /// <param name="userCode">用户code</param>
  1233. /// <param name="userPassword">用户密码</param>
  1234. /// <param name="sessionKey">本次登陆密钥</param>
  1235. /// <param name="procedureID">工序ID</param>
  1236. /// <param name="productionDataEntitys">条码信息</param>
  1237. /// <returns></returns>
  1238. public ActionResult AddCheckBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1239. {
  1240. ActionResult actionResult = new ActionResult();
  1241. try
  1242. {
  1243. // 验证请求头信息
  1244. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1245. // 验证失败
  1246. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1247. {
  1248. return actionResult;
  1249. }
  1250. //if(productionDataEntitys.Length>0)
  1251. //{
  1252. // if(productionDataEntitys[0].ProductionDataID>0)
  1253. // {
  1254. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1255. // }
  1256. //}
  1257. string err = ServiceInvoker.Invoke<string>(this,
  1258. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1259. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1260. if (err == null)
  1261. {
  1262. err = "";
  1263. }
  1264. //actionResult.Result = JsonHelper.ToJson(err);
  1265. actionResult.Result = err;// JsonHelper.ToJson(err);
  1266. actionResult.Status = (int)Constant.PDAResult.Success;
  1267. }
  1268. catch (Exception ex)
  1269. {
  1270. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1271. OutputLog.TraceLog(LogPriority.Error,
  1272. this.ToString(),
  1273. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1274. ex.ToString(),
  1275. LocalPath.LogExePath);
  1276. actionResult.Status = (int)Constant.PDAResult.Exception;
  1277. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1278. }
  1279. return actionResult;
  1280. }
  1281. #endregion
  1282. #region 文件上传下载
  1283. /// <summary>
  1284. /// 软件更新
  1285. /// </summary>
  1286. /// <param name="accountCode">帐套code</param>
  1287. /// <param name="userCode">用户code</param>
  1288. /// <param name="userPassword">用户密码</param>
  1289. /// <param name="sessionKey">本次登陆密钥</param>
  1290. /// <returns></returns>
  1291. public Stream AutoUpgradeGet(string accountCode, string userCode, string userPassword, string sessionKey)
  1292. {
  1293. try
  1294. {
  1295. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1296. }
  1297. catch (Exception ex)
  1298. {
  1299. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1300. OutputLog.TraceLog(LogPriority.Error,
  1301. this.ToString(),
  1302. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1303. ex.ToString(),
  1304. LocalPath.LogExePath);
  1305. return null;
  1306. }
  1307. }
  1308. /// <summary>
  1309. /// 上传临时文件
  1310. /// </summary>
  1311. /// <param name="imgStream"></param>
  1312. /// <returns></returns>
  1313. public ActionResult SaveImgGet(Stream mageStream)
  1314. {
  1315. ActionResult actionResult = new ActionResult();
  1316. try
  1317. {
  1318. string err = PDAModuleLogic.SaveImg(mageStream);
  1319. if (err == null)
  1320. {
  1321. err = "";
  1322. }
  1323. actionResult.Result = err;
  1324. actionResult.Status = (int)Constant.PDAResult.Success;
  1325. }
  1326. catch (Exception ex)
  1327. {
  1328. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1329. OutputLog.TraceLog(LogPriority.Error,
  1330. this.ToString(),
  1331. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1332. ex.ToString(),
  1333. LocalPath.LogExePath);
  1334. actionResult.Status = (int)Constant.PDAResult.Exception;
  1335. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1336. }
  1337. return actionResult;
  1338. }
  1339. public Stream GetFileTestGet(string path)
  1340. {
  1341. return PDAModuleLogic.GetImg(path);
  1342. }
  1343. public Stream GetFileStreamGet()
  1344. {
  1345. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1346. long l = fs.Length;
  1347. return fs;
  1348. }
  1349. public byte[] GetFileTestByteGet(string path)
  1350. {
  1351. FileStream stream = new FileInfo(path).OpenRead();
  1352. Byte[] buffer = new Byte[stream.Length];
  1353. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1354. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1355. return buffer;
  1356. }
  1357. public string GetFileGet(string path)
  1358. {
  1359. string imgFilePath = path;
  1360. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1361. int i = (int)fs.Length;
  1362. byte[] content = new byte[i];
  1363. fs.Read(content, 0, i);
  1364. string result = Convert.ToBase64String(content);
  1365. fs.Close();
  1366. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1367. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1368. sw.Write(result);
  1369. sw.Close();
  1370. fsTxt.Close();
  1371. return result;
  1372. }
  1373. #endregion
  1374. /// <summary>
  1375. /// 获得产品分级
  1376. /// </summary>
  1377. /// <param name="accountCode">帐套code</param>
  1378. /// <param name="userCode">用户code</param>
  1379. /// <param name="userPassword">用户密码</param>
  1380. /// <param name="sessionKey">本次登陆密钥</param>
  1381. /// <param name="procedureID">当前工序ID</param>
  1382. /// <returns></returns>
  1383. /// <remarks>
  1384. /// 陈冰 2014.10.22 新建
  1385. /// </remarks>
  1386. public ActionResult GetReworkProcedureByProcedureIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1387. {
  1388. ActionResult actionResult = new ActionResult();
  1389. try
  1390. {
  1391. // 验证请求头信息
  1392. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1393. // 验证失败
  1394. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1395. {
  1396. return actionResult;
  1397. }
  1398. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1399. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1400. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1401. {
  1402. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1403. actionResult.Status = (int)Constant.PDAResult.Success;
  1404. }
  1405. else
  1406. {
  1407. actionResult.Status = (int)Constant.PDAResult.Fail;
  1408. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1409. }
  1410. }
  1411. catch (Exception ex)
  1412. {
  1413. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1414. OutputLog.TraceLog(LogPriority.Error,
  1415. this.ToString(),
  1416. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1417. ex.ToString(),
  1418. LocalPath.LogExePath);
  1419. actionResult.Status = (int)Constant.PDAResult.Exception;
  1420. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1421. }
  1422. return actionResult;
  1423. }
  1424. /// <summary>
  1425. /// 获得产品分级
  1426. /// </summary>
  1427. /// <param name="accountCode">帐套code</param>
  1428. /// <param name="userCode">用户code</param>
  1429. /// <param name="userPassword">用户密码</param>
  1430. /// <param name="sessionKey">本次登陆密钥</param>
  1431. /// <param name="barcode">条码</param>
  1432. /// <returns></returns>
  1433. public ActionResult GetKilnCarByBarCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1434. {
  1435. ActionResult actionResult = new ActionResult();
  1436. try
  1437. {
  1438. // 验证请求头信息
  1439. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1440. // 验证失败
  1441. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1442. {
  1443. return actionResult;
  1444. }
  1445. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1446. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1447. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1448. {
  1449. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1450. actionResult.Status = (int)Constant.PDAResult.Success;
  1451. }
  1452. else
  1453. {
  1454. actionResult.Status = (int)Constant.PDAResult.Fail;
  1455. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1456. }
  1457. }
  1458. catch (Exception ex)
  1459. {
  1460. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1461. OutputLog.TraceLog(LogPriority.Error,
  1462. this.ToString(),
  1463. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1464. ex.ToString(),
  1465. LocalPath.LogExePath);
  1466. actionResult.Status = (int)Constant.PDAResult.Exception;
  1467. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1468. }
  1469. return actionResult;
  1470. }
  1471. #region 统计
  1472. /// <summary>
  1473. /// 统计当日计数数量
  1474. /// </summary>
  1475. /// <param name="accountCode">帐套code</param>
  1476. /// <param name="userCode">用户code</param>
  1477. /// <param name="userPassword">用户密码</param>
  1478. /// <param name="sessionKey">本次登陆密钥</param>
  1479. /// <param name="procedureID">工序ID</param>
  1480. /// <returns></returns>
  1481. public ActionResult StatisticsCollectBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1482. {
  1483. ActionResult actionResult = new ActionResult();
  1484. try
  1485. {
  1486. // 验证请求头信息
  1487. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1488. // 验证失败
  1489. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1490. {
  1491. return actionResult;
  1492. }
  1493. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1494. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1495. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1496. {
  1497. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1498. actionResult.Status = (int)Constant.PDAResult.Success;
  1499. }
  1500. else
  1501. {
  1502. actionResult.Status = (int)Constant.PDAResult.Fail;
  1503. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1504. }
  1505. }
  1506. catch (Exception ex)
  1507. {
  1508. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1509. OutputLog.TraceLog(LogPriority.Error,
  1510. this.ToString(),
  1511. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1512. ex.ToString(),
  1513. LocalPath.LogExePath);
  1514. actionResult.Status = (int)Constant.PDAResult.Exception;
  1515. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1516. }
  1517. return actionResult;
  1518. }
  1519. /// <summary>
  1520. /// 统计当日计数数量
  1521. /// </summary>
  1522. /// <param name="accountCode">帐套code</param>
  1523. /// <param name="userCode">用户code</param>
  1524. /// <param name="userPassword">用户密码</param>
  1525. /// <param name="sessionKey">本次登陆密钥</param>
  1526. /// <param name="procedureID">工序ID</param>
  1527. /// <returns></returns>
  1528. public ActionResult StatisticsKilnCarGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1529. {
  1530. ActionResult actionResult = new ActionResult();
  1531. try
  1532. {
  1533. // 验证请求头信息
  1534. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1535. // 验证失败
  1536. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1537. {
  1538. return actionResult;
  1539. }
  1540. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1541. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1542. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1543. {
  1544. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1545. actionResult.Status = (int)Constant.PDAResult.Success;
  1546. }
  1547. else
  1548. {
  1549. actionResult.Status = (int)Constant.PDAResult.Fail;
  1550. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1551. }
  1552. }
  1553. catch (Exception ex)
  1554. {
  1555. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1556. OutputLog.TraceLog(LogPriority.Error,
  1557. this.ToString(),
  1558. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1559. ex.ToString(),
  1560. LocalPath.LogExePath);
  1561. actionResult.Status = (int)Constant.PDAResult.Exception;
  1562. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1563. }
  1564. return actionResult;
  1565. }
  1566. /// <summary>
  1567. /// 统计产品跟踪
  1568. /// </summary>
  1569. /// <param name="accountCode">帐套code</param>
  1570. /// <param name="userCode">用户code</param>
  1571. /// <param name="userPassword">用户密码</param>
  1572. /// <param name="sessionKey">本次登陆密钥</param>
  1573. /// <param name="procedureID">工序ID</param>
  1574. /// <returns></returns>
  1575. public ActionResult StatisticsProductTrackGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1576. {
  1577. ActionResult actionResult = new ActionResult();
  1578. try
  1579. {
  1580. // 验证请求头信息
  1581. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1582. // 验证失败
  1583. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1584. {
  1585. return actionResult;
  1586. }
  1587. RPT020101_SE se = new RPT020101_SE();
  1588. se.Barcode = barcode;
  1589. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1590. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1591. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1592. {
  1593. actionResult.Status = (int)Constant.PDAResult.Fail;
  1594. actionResult.Message = Messages.MSG_CMN_I002;
  1595. }
  1596. else
  1597. {
  1598. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1599. actionResult.Status = (int)Constant.PDAResult.Success;
  1600. }
  1601. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1602. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1603. //if (productionDataEntity != null)
  1604. //{
  1605. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1606. // actionResult.Status = (int)Constant.PDAResult.Success;
  1607. //}
  1608. //else
  1609. //{
  1610. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1611. // actionResult.Message = Messages.MSG_CMN_I002;
  1612. //}
  1613. }
  1614. catch (Exception ex)
  1615. {
  1616. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1617. OutputLog.TraceLog(LogPriority.Error,
  1618. this.ToString(),
  1619. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1620. ex.ToString() + ex.HelpLink,
  1621. LocalPath.LogExePath);
  1622. actionResult.Status = (int)Constant.PDAResult.Exception;
  1623. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1624. }
  1625. return actionResult;
  1626. }
  1627. #endregion
  1628. #region 撤销装车及成检
  1629. /// <summary>
  1630. /// 检验条码是否可以撤销装车
  1631. /// </summary>
  1632. /// <param name="accountCode">帐套code</param>
  1633. /// <param name="userCode">用户code</param>
  1634. /// <param name="userPassword">用户密码</param>
  1635. /// <param name="sessionKey">本次登陆密钥</param>
  1636. /// <param name="procedureID">当前工序ID</param>
  1637. /// <param name="barcode">条码</param>
  1638. /// <returns></returns>
  1639. public ActionResult CheckCancelLoadCarGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1640. {
  1641. ActionResult actionResult = new ActionResult();
  1642. try
  1643. {
  1644. // 验证请求头信息
  1645. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1646. // 验证失败
  1647. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1648. {
  1649. return actionResult;
  1650. }
  1651. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1652. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1653. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1654. actionResult.Status = (int)Constant.PDAResult.Success;
  1655. }
  1656. catch (Exception ex)
  1657. {
  1658. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1659. OutputLog.TraceLog(LogPriority.Error,
  1660. this.ToString(),
  1661. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1662. ex.ToString(),
  1663. LocalPath.LogExePath);
  1664. actionResult.Status = (int)Constant.PDAResult.Exception;
  1665. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1666. }
  1667. return actionResult;
  1668. }
  1669. /// <summary>
  1670. /// 保存撤销装车的条码
  1671. /// </summary>
  1672. /// <param name="accountCode">帐套code</param>
  1673. /// <param name="userCode">用户code</param>
  1674. /// <param name="userPassword">用户密码</param>
  1675. /// <param name="sessionKey">本次登陆密钥</param>
  1676. /// <param name="procedureID">当前工序ID</param>
  1677. /// <param name="barcode">条码</param>
  1678. /// <returns></returns>
  1679. public ActionResult AddCancelLoadCarGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1680. {
  1681. ActionResult actionResult = new ActionResult();
  1682. try
  1683. {
  1684. // 验证请求头信息
  1685. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1686. // 验证失败
  1687. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1688. {
  1689. return actionResult;
  1690. }
  1691. string err = ServiceInvoker.Invoke<string>(this,
  1692. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1693. if (err == null)
  1694. {
  1695. err = "";
  1696. }
  1697. actionResult.Result = JsonHelper.ToJson(err);
  1698. actionResult.Status = (int)Constant.PDAResult.Success;
  1699. }
  1700. catch (Exception ex)
  1701. {
  1702. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1703. OutputLog.TraceLog(LogPriority.Error,
  1704. this.ToString(),
  1705. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1706. ex.ToString(),
  1707. LocalPath.LogExePath);
  1708. actionResult.Status = (int)Constant.PDAResult.Exception;
  1709. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1710. }
  1711. return actionResult;
  1712. }
  1713. /// <summary>
  1714. /// 由产品条码获取注浆信息
  1715. /// </summary>
  1716. /// <param name="barcode"></param>
  1717. /// <returns></returns>
  1718. public ActionResult GetGroutingProducttByBarCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1719. {
  1720. ActionResult actionResult = new ActionResult();
  1721. try
  1722. {
  1723. // 验证请求头信息
  1724. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1725. // 验证失败
  1726. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1727. {
  1728. return actionResult;
  1729. }
  1730. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1731. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1732. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1733. {
  1734. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1735. actionResult.Status = (int)Constant.PDAResult.Success;
  1736. }
  1737. else
  1738. {
  1739. actionResult.Status = (int)Constant.PDAResult.Fail;
  1740. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1741. }
  1742. }
  1743. catch (Exception ex)
  1744. {
  1745. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1746. OutputLog.TraceLog(LogPriority.Error,
  1747. this.ToString(),
  1748. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1749. ex.ToString(),
  1750. LocalPath.LogExePath);
  1751. actionResult.Status = (int)Constant.PDAResult.Exception;
  1752. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1753. }
  1754. return actionResult;
  1755. }
  1756. /// <summary>
  1757. /// 获取工号下的所有工种信息
  1758. /// </summary>
  1759. /// <param name="UserID">工号ID</param>
  1760. /// <returns></returns>
  1761. public ActionResult GetAllJobsByUserIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1762. {
  1763. ActionResult actionResult = new ActionResult();
  1764. try
  1765. {
  1766. // 验证请求头信息
  1767. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1768. // 验证失败
  1769. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1770. {
  1771. return actionResult;
  1772. }
  1773. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1774. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1775. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1776. {
  1777. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1778. actionResult.Status = (int)Constant.PDAResult.Success;
  1779. }
  1780. else
  1781. {
  1782. actionResult.Status = (int)Constant.PDAResult.Fail;
  1783. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1784. }
  1785. }
  1786. catch (Exception ex)
  1787. {
  1788. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1789. OutputLog.TraceLog(LogPriority.Error,
  1790. this.ToString(),
  1791. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1792. ex.ToString(),
  1793. LocalPath.LogExePath);
  1794. actionResult.Status = (int)Constant.PDAResult.Exception;
  1795. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1796. }
  1797. return actionResult;
  1798. }
  1799. /// <summary>
  1800. /// 根据所选工号对应的工种,查出缺陷责任员工
  1801. /// </summary>
  1802. /// <param name="jobs">工种ID</param>
  1803. /// <returns></returns>
  1804. public ActionResult GetDutyStaffByUserIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  1805. {
  1806. ActionResult actionResult = new ActionResult();
  1807. try
  1808. {
  1809. // 验证请求头信息
  1810. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1811. // 验证失败
  1812. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1813. {
  1814. return actionResult;
  1815. }
  1816. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1817. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  1818. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1819. {
  1820. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1821. actionResult.Status = (int)Constant.PDAResult.Success;
  1822. }
  1823. else
  1824. {
  1825. actionResult.Status = (int)Constant.PDAResult.Fail;
  1826. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1827. }
  1828. }
  1829. catch (Exception ex)
  1830. {
  1831. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1832. OutputLog.TraceLog(LogPriority.Error,
  1833. this.ToString(),
  1834. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1835. ex.ToString(),
  1836. LocalPath.LogExePath);
  1837. actionResult.Status = (int)Constant.PDAResult.Exception;
  1838. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1839. }
  1840. return actionResult;
  1841. }
  1842. /// <summary>
  1843. /// 根据所选工号,查出漏检责任员工
  1844. /// </summary>
  1845. /// <param name="userid">工号</param>
  1846. /// <returns></returns>
  1847. public ActionResult GetMissedStaffByUserIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  1848. {
  1849. ActionResult actionResult = new ActionResult();
  1850. try
  1851. {
  1852. // 验证请求头信息
  1853. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1854. // 验证失败
  1855. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1856. {
  1857. return actionResult;
  1858. }
  1859. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1860. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  1861. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1862. {
  1863. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1864. actionResult.Status = (int)Constant.PDAResult.Success;
  1865. }
  1866. else
  1867. {
  1868. actionResult.Status = (int)Constant.PDAResult.Fail;
  1869. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1870. }
  1871. }
  1872. catch (Exception ex)
  1873. {
  1874. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1875. OutputLog.TraceLog(LogPriority.Error,
  1876. this.ToString(),
  1877. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1878. ex.ToString(),
  1879. LocalPath.LogExePath);
  1880. actionResult.Status = (int)Constant.PDAResult.Exception;
  1881. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1882. }
  1883. return actionResult;
  1884. }
  1885. /// <summary>
  1886. /// 获取用户列表
  1887. /// </summary>
  1888. /// <param name="requestEntity">用户实体</param>
  1889. /// <returns></returns>
  1890. public ActionResult SearchUserDataGet(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  1891. {
  1892. ActionResult actionResult = new ActionResult();
  1893. try
  1894. {
  1895. // 验证请求头信息
  1896. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1897. // 验证失败
  1898. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1899. {
  1900. return actionResult;
  1901. }
  1902. SUserEntity requestEntity = new SUserEntity();
  1903. requestEntity.IsWorker = IsWorker;
  1904. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1905. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  1906. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1907. {
  1908. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1909. actionResult.Status = (int)Constant.PDAResult.Success;
  1910. }
  1911. else
  1912. {
  1913. actionResult.Status = (int)Constant.PDAResult.Fail;
  1914. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1915. }
  1916. }
  1917. catch (Exception ex)
  1918. {
  1919. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1920. OutputLog.TraceLog(LogPriority.Error,
  1921. this.ToString(),
  1922. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1923. ex.ToString(),
  1924. LocalPath.LogExePath);
  1925. actionResult.Status = (int)Constant.PDAResult.Exception;
  1926. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1927. }
  1928. return actionResult;
  1929. }
  1930. /// <summary>
  1931. /// 获取数据字典管理的数据
  1932. /// </summary>
  1933. /// <param name="Pvalue">显示停用标识</param>
  1934. /// <param name="dictionaryType">字典类别</param>
  1935. /// <returns></returns>
  1936. /// <remarks>
  1937. /// 2014.12.03 新建
  1938. /// </remarks>
  1939. public ActionResult GetDictionaryDataGet(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  1940. {
  1941. ActionResult actionResult = new ActionResult();
  1942. try
  1943. {
  1944. // 验证请求头信息
  1945. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1946. // 验证失败
  1947. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1948. {
  1949. return actionResult;
  1950. }
  1951. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1952. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  1953. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1954. {
  1955. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1956. actionResult.Status = (int)Constant.PDAResult.Success;
  1957. }
  1958. else
  1959. {
  1960. actionResult.Status = (int)Constant.PDAResult.Fail;
  1961. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1962. }
  1963. }
  1964. catch (Exception ex)
  1965. {
  1966. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1967. OutputLog.TraceLog(LogPriority.Error,
  1968. this.ToString(),
  1969. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1970. ex.ToString(),
  1971. LocalPath.LogExePath);
  1972. actionResult.Status = (int)Constant.PDAResult.Exception;
  1973. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1974. }
  1975. return actionResult;
  1976. }
  1977. #endregion
  1978. #region 保存半检数据
  1979. /// <summary>
  1980. /// 保存半检数据
  1981. /// </summary>
  1982. /// <param name="accountCode">帐套code</param>
  1983. /// <param name="userCode">用户code</param>
  1984. /// <param name="userPassword">用户密码</param>
  1985. /// <param name="sessionKey">本次登陆密钥</param>
  1986. /// <param name="productionDataEntitys">半检信息</param>
  1987. /// <returns></returns>
  1988. public ActionResult AddSemiTestGet(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  1989. {
  1990. ActionResult actionResult = new ActionResult();
  1991. try
  1992. {
  1993. // 验证请求头信息
  1994. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1995. // 验证失败
  1996. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1997. {
  1998. return actionResult;
  1999. }
  2000. string err = ServiceInvoker.Invoke<string>(this,
  2001. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2002. if (err == null)
  2003. {
  2004. err = "";
  2005. }
  2006. actionResult.Result = JsonHelper.ToJson(err);
  2007. actionResult.Status = (int)Constant.PDAResult.Success;
  2008. }
  2009. catch (Exception ex)
  2010. {
  2011. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2012. OutputLog.TraceLog(LogPriority.Error,
  2013. this.ToString(),
  2014. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2015. ex.ToString(),
  2016. LocalPath.LogExePath);
  2017. actionResult.Status = (int)Constant.PDAResult.Exception;
  2018. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2019. }
  2020. return actionResult;
  2021. }
  2022. #endregion
  2023. /// <summary>
  2024. /// 获取产品列表
  2025. /// </summary>
  2026. /// <returns></returns>
  2027. public ActionResult SerachGoodsGet(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  2028. {
  2029. ActionResult actionResult = new ActionResult();
  2030. try
  2031. {
  2032. // 验证请求头信息
  2033. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2034. // 验证失败
  2035. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2036. {
  2037. return actionResult;
  2038. }
  2039. GoodsEntity goodsEntity = new GoodsEntity();
  2040. goodsEntity.ValueFlag = 1;//有效标记
  2041. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2042. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2043. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2044. {
  2045. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2046. actionResult.Status = (int)Constant.PDAResult.Success;
  2047. }
  2048. else
  2049. {
  2050. actionResult.Status = (int)Constant.PDAResult.Fail;
  2051. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2052. }
  2053. }
  2054. catch (Exception ex)
  2055. {
  2056. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2057. OutputLog.TraceLog(LogPriority.Error,
  2058. this.ToString(),
  2059. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2060. ex.ToString(),
  2061. LocalPath.LogExePath);
  2062. actionResult.Status = (int)Constant.PDAResult.Exception;
  2063. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2064. }
  2065. return actionResult;
  2066. }
  2067. /// <summary>
  2068. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2069. /// </summary>
  2070. /// <param name="searchEntity">生产数据实体类</param>
  2071. /// <returns>DataTable</returns>
  2072. public ActionResult GetProductionDataGet(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2073. {
  2074. ActionResult actionResult = new ActionResult();
  2075. try
  2076. {
  2077. // 验证请求头信息
  2078. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2079. // 验证失败
  2080. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2081. {
  2082. return actionResult;
  2083. }
  2084. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2085. searchEntity.ProcedureID = ProcedureID;
  2086. searchEntity.BarCode = BarCode;
  2087. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2088. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2089. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2090. {
  2091. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2092. actionResult.Status = (int)Constant.PDAResult.Success;
  2093. }
  2094. else
  2095. {
  2096. actionResult.Status = (int)Constant.PDAResult.Fail;
  2097. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2098. }
  2099. }
  2100. catch (Exception ex)
  2101. {
  2102. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2103. OutputLog.TraceLog(LogPriority.Error,
  2104. this.ToString(),
  2105. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2106. ex.ToString(),
  2107. LocalPath.LogExePath);
  2108. actionResult.Status = (int)Constant.PDAResult.Exception;
  2109. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2110. }
  2111. return actionResult;
  2112. }
  2113. /// <summary>
  2114. /// 根据所选生产数据ID,显示成检数据信息
  2115. /// </summary>
  2116. /// <param name="productionDataID">生产数据ID</param>
  2117. /// <returns>DataSet</returns>
  2118. public ActionResult GetProductionDataByIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2119. {
  2120. ActionResult actionResult = new ActionResult();
  2121. try
  2122. {
  2123. // 验证请求头信息
  2124. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2125. // 验证失败
  2126. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2127. {
  2128. return actionResult;
  2129. }
  2130. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2131. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2132. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2133. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2134. {
  2135. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2136. {
  2137. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2138. {
  2139. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2140. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2141. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2142. {
  2143. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2144. }
  2145. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2146. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2147. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2148. {
  2149. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2150. }
  2151. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2152. {
  2153. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2154. }
  2155. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2156. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2157. {
  2158. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2159. }
  2160. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2161. {
  2162. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2163. }
  2164. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2165. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2166. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2167. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2168. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2169. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2170. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2171. {
  2172. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2173. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2174. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2175. }
  2176. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2177. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2178. {
  2179. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2180. }
  2181. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2182. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2183. DataTable dtDefect = dvDefect.ToTable();
  2184. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2185. {
  2186. // 产品缺陷
  2187. PDADefectResult defect = new PDADefectResult();
  2188. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2189. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2190. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2191. {
  2192. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2193. }
  2194. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2195. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2196. {
  2197. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2198. }
  2199. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2200. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2201. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2202. {
  2203. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2204. }
  2205. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2206. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2207. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2208. {
  2209. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2210. }
  2211. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2212. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2213. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2214. {
  2215. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2216. }
  2217. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2218. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2219. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2220. {
  2221. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2222. }
  2223. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2224. {
  2225. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2226. }
  2227. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2228. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2229. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2230. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2231. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2232. {
  2233. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2234. }
  2235. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2236. {
  2237. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2238. }
  2239. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2240. {
  2241. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2242. }
  2243. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2244. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2245. //--------责任员工-------------------
  2246. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2247. if (drRow.Length > Constant.INT_IS_ZERO)
  2248. {
  2249. foreach (DataRow r in drRow)
  2250. {
  2251. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2252. if (r["ProductionDefectID"].ToString() != "")
  2253. {
  2254. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2255. }
  2256. if (r["StaffID"].ToString() != "")
  2257. {
  2258. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2259. }
  2260. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2261. defectResponsible.StaffName = r["StaffName"].ToString();
  2262. if (r["StaffStatus"].ToString() != "")
  2263. {
  2264. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2265. }
  2266. if (r["UJobsID"].ToString() != "")
  2267. {
  2268. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2269. }
  2270. if (r["SJobsID"].ToString() != "")
  2271. {
  2272. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2273. }
  2274. defect.PDADefectResponsibles.Add(defectResponsible);
  2275. }
  2276. }
  2277. //------------------------------
  2278. //--------漏检员工-------------------
  2279. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2280. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2281. {
  2282. foreach (DataRow r in drMissedRow)
  2283. {
  2284. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2285. if (r["ProductionDefectID"].ToString() != "")
  2286. {
  2287. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2288. }
  2289. if (r["StaffID"].ToString() != "")
  2290. {
  2291. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2292. }
  2293. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2294. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2295. if (r["StaffStatus"].ToString() != "")
  2296. {
  2297. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2298. }
  2299. if (r["UJobsID"].ToString() != "")
  2300. {
  2301. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2302. }
  2303. if (r["SJobsID"].ToString() != "")
  2304. {
  2305. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2306. }
  2307. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2308. }
  2309. }
  2310. //------------------------------
  2311. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2312. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2313. {
  2314. foreach (DataRow r in drImageRow)
  2315. {
  2316. PDADefectImageResult defectImage = new PDADefectImageResult();
  2317. if (r["ProductionDefectID"].ToString() != "")
  2318. {
  2319. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2320. }
  2321. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2322. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2323. //{
  2324. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2325. //}
  2326. defect.PDADefectImageResults.Add(defectImage);
  2327. }
  2328. }
  2329. productionData.PDADefects.Add(defect);
  2330. }
  2331. if (productionDatas.PDAProductionData == null)
  2332. {
  2333. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2334. }
  2335. productionDatas.PDAProductionData.Add(productionData);
  2336. //---------------------------------------------------------------------------------
  2337. }
  2338. }
  2339. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2340. actionResult.Status = (int)Constant.PDAResult.Success;
  2341. }
  2342. else
  2343. {
  2344. actionResult.Status = (int)Constant.PDAResult.Fail;
  2345. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2346. }
  2347. }
  2348. catch (Exception ex)
  2349. {
  2350. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2351. OutputLog.TraceLog(LogPriority.Error,
  2352. this.ToString(),
  2353. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2354. ex.ToString(),
  2355. LocalPath.LogExePath);
  2356. actionResult.Status = (int)Constant.PDAResult.Exception;
  2357. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2358. }
  2359. return actionResult;
  2360. }
  2361. /// <summary>
  2362. /// 编辑后删除生产数据
  2363. /// </summary>
  2364. /// <param name="productionDataID">生产数据ID</param>
  2365. /// <returns>int</returns>
  2366. public ActionResult DeleteProductionDataByIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2367. {
  2368. ActionResult actionResult = new ActionResult();
  2369. try
  2370. {
  2371. // 验证请求头信息
  2372. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2373. // 验证失败
  2374. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2375. {
  2376. return actionResult;
  2377. }
  2378. int row = ServiceInvoker.Invoke<int>(this,
  2379. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2380. actionResult.Result = JsonHelper.ToJson(row);
  2381. actionResult.Status = (int)Constant.PDAResult.Success;
  2382. }
  2383. catch (Exception ex)
  2384. {
  2385. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2386. OutputLog.TraceLog(LogPriority.Error,
  2387. this.ToString(),
  2388. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2389. ex.ToString(),
  2390. LocalPath.LogExePath);
  2391. actionResult.Status = (int)Constant.PDAResult.Exception;
  2392. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2393. }
  2394. return actionResult;
  2395. }
  2396. /// <summary>
  2397. /// 获取产品完成工序的ID
  2398. /// </summary>
  2399. /// <param name="barcode">产品条码</param>
  2400. /// <returns>int</returns>
  2401. public ActionResult GetCompleteProcedureIDGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2402. {
  2403. ActionResult actionResult = new ActionResult();
  2404. try
  2405. {
  2406. // 验证请求头信息
  2407. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2408. // 验证失败
  2409. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2410. {
  2411. return actionResult;
  2412. }
  2413. int row = ServiceInvoker.Invoke<int>(this,
  2414. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2415. actionResult.Result = JsonHelper.ToJson(row);
  2416. actionResult.Status = (int)Constant.PDAResult.Success;
  2417. }
  2418. catch (Exception ex)
  2419. {
  2420. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2421. OutputLog.TraceLog(LogPriority.Error,
  2422. this.ToString(),
  2423. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2424. ex.ToString(),
  2425. LocalPath.LogExePath);
  2426. actionResult.Status = (int)Constant.PDAResult.Exception;
  2427. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2428. }
  2429. return actionResult;
  2430. }
  2431. /// <summary>
  2432. /// 绑定图片
  2433. /// </summary>
  2434. /// <param name="accountCode">帐套code</param>
  2435. /// <param name="userCode">用户code</param>
  2436. /// <param name="userPassword">用户密码</param>
  2437. /// <param name="sessionKey">本次登陆密钥</param>
  2438. /// <param name="imagePath">图片路径</param>
  2439. /// <returns></returns>
  2440. public Stream BindDefectImageGet(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2441. {
  2442. try
  2443. {
  2444. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2445. }
  2446. catch (Exception ex)
  2447. {
  2448. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2449. OutputLog.TraceLog(LogPriority.Error,
  2450. this.ToString(),
  2451. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2452. ex.ToString(),
  2453. LocalPath.LogExePath);
  2454. return null;
  2455. }
  2456. }
  2457. /// <summary>
  2458. /// 根据所选工号对应的工种,查出缺陷责任员工
  2459. /// </summary>
  2460. /// <param name="jobs">工种ID</param>
  2461. /// <returns></returns>
  2462. public ActionResult GetDutyStaffByUserJobsIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2463. {
  2464. ActionResult actionResult = new ActionResult();
  2465. try
  2466. {
  2467. // 验证请求头信息
  2468. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2469. // 验证失败
  2470. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2471. {
  2472. return actionResult;
  2473. }
  2474. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2475. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2476. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2477. {
  2478. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2479. actionResult.Status = (int)Constant.PDAResult.Success;
  2480. }
  2481. else
  2482. {
  2483. actionResult.Status = (int)Constant.PDAResult.Fail;
  2484. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2485. }
  2486. }
  2487. catch (Exception ex)
  2488. {
  2489. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2490. OutputLog.TraceLog(LogPriority.Error,
  2491. this.ToString(),
  2492. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2493. ex.ToString(),
  2494. LocalPath.LogExePath);
  2495. actionResult.Status = (int)Constant.PDAResult.Exception;
  2496. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2497. }
  2498. return actionResult;
  2499. }
  2500. #region 产品报废
  2501. /// <summary>
  2502. /// 验证废弃产品唯一性
  2503. /// </summary>
  2504. /// <param name="barcode">产品条码</param>
  2505. /// <returns>int</returns>
  2506. public ActionResult ScrapProductChackGet(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2507. {
  2508. ActionResult actionResult = new ActionResult();
  2509. try
  2510. {
  2511. // 验证请求头信息
  2512. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2513. // 验证失败
  2514. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2515. {
  2516. return actionResult;
  2517. }
  2518. string row = ServiceInvoker.Invoke<string>(this,
  2519. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2520. string[] rm = row.Split(':');
  2521. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2522. if (rm.Length > 1)
  2523. {
  2524. actionResult.Message = rm[1];
  2525. }
  2526. actionResult.Status = (int)Constant.PDAResult.Success;
  2527. }
  2528. catch (Exception ex)
  2529. {
  2530. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2531. OutputLog.TraceLog(LogPriority.Error,
  2532. this.ToString(),
  2533. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2534. ex.ToString(),
  2535. LocalPath.LogExePath);
  2536. actionResult.Status = (int)Constant.PDAResult.Exception;
  2537. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2538. }
  2539. return actionResult;
  2540. }
  2541. /// <summary>
  2542. /// 根据条码获取该产品的在产信息以及生产数据
  2543. /// </summary>
  2544. /// <param name="Barcode">产品条码</param>
  2545. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2546. public ActionResult GetInProductionAndProductionDataGet(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2547. {
  2548. ActionResult actionResult = new ActionResult();
  2549. try
  2550. {
  2551. // 验证请求头信息
  2552. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2553. // 验证失败
  2554. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2555. {
  2556. return actionResult;
  2557. }
  2558. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2559. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2560. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2561. {
  2562. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2563. actionResult.Status = (int)Constant.PDAResult.Success;
  2564. }
  2565. else
  2566. {
  2567. actionResult.Status = (int)Constant.PDAResult.Fail;
  2568. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2569. }
  2570. }
  2571. catch (Exception ex)
  2572. {
  2573. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2574. OutputLog.TraceLog(LogPriority.Error,
  2575. this.ToString(),
  2576. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2577. ex.ToString(),
  2578. LocalPath.LogExePath);
  2579. actionResult.Status = (int)Constant.PDAResult.Exception;
  2580. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2581. }
  2582. return actionResult;
  2583. }
  2584. /// <summary>
  2585. /// 根据工号查询员工档案信息
  2586. /// </summary>
  2587. /// <param name="accountCode"></param>
  2588. /// <param name="userCode"></param>
  2589. /// <param name="userPassword"></param>
  2590. /// <param name="sessionKey"></param>
  2591. /// <param name="userId"></param>
  2592. /// <returns></returns>
  2593. public ActionResult SearchHrStaffInfoGet(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2594. {
  2595. ActionResult actionResult = new ActionResult();
  2596. try
  2597. {
  2598. // 验证请求头信息
  2599. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2600. // 验证失败
  2601. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2602. {
  2603. return actionResult;
  2604. }
  2605. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2606. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2607. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2608. {
  2609. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2610. actionResult.Status = (int)Constant.PDAResult.Success;
  2611. }
  2612. else
  2613. {
  2614. actionResult.Status = (int)Constant.PDAResult.Fail;
  2615. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2616. }
  2617. }
  2618. catch (Exception ex)
  2619. {
  2620. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2621. OutputLog.TraceLog(LogPriority.Error,
  2622. this.ToString(),
  2623. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2624. ex.ToString(),
  2625. LocalPath.LogExePath);
  2626. actionResult.Status = (int)Constant.PDAResult.Exception;
  2627. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2628. }
  2629. return actionResult;
  2630. }
  2631. /// <summary>
  2632. /// 添加废弃产品记录
  2633. /// </summary>
  2634. /// <param name="SProductEntity">废弃产品实体</param>
  2635. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2636. /// <param name="SResponsibleList">责任者集合</param>
  2637. /// <param name="userInfo">用户基本信息</param>
  2638. /// <returns>int结果返回值</returns>
  2639. /// <remarks>
  2640. /// 庄天威 2014.09.24 新建
  2641. /// </remarks>
  2642. public ActionResult AddScrapProductGet(string accountCode, string userCode, string userPassword, string sessionKey,
  2643. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2644. ScrapResponsibleEntity[] SResponsibleList)
  2645. {
  2646. ActionResult actionResult = new ActionResult();
  2647. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2648. {
  2649. actionResult.Status = (int)Constant.PDAResult.Fail;
  2650. actionResult.Message = "没有选择责任人";
  2651. }
  2652. try
  2653. {
  2654. // 验证请求头信息
  2655. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2656. // 验证失败
  2657. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2658. {
  2659. return actionResult;
  2660. }
  2661. int addRow = ServiceInvoker.Invoke<int>(this,
  2662. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  2663. actionResult.Result = JsonHelper.ToJson(addRow);
  2664. actionResult.Status = (int)Constant.PDAResult.Success;
  2665. }
  2666. catch (Exception ex)
  2667. {
  2668. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2669. OutputLog.TraceLog(LogPriority.Error,
  2670. this.ToString(),
  2671. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2672. ex.ToString(),
  2673. LocalPath.LogExePath);
  2674. actionResult.Status = (int)Constant.PDAResult.Exception;
  2675. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2676. // TODO 空指针异常问题检测
  2677. try
  2678. {
  2679. OutputLog.TraceLog(LogPriority.Error,
  2680. this.ToString(),
  2681. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2682. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  2683. LocalPath.LogExePath);
  2684. string json1 = JsonHelper.ToJson(SProductEntity);
  2685. OutputLog.TraceLog(LogPriority.Error,
  2686. this.ToString(),
  2687. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2688. "SProductEntity:" + json1,
  2689. LocalPath.LogExePath);
  2690. string json2 = JsonHelper.ToJson(RProcedureEntity);
  2691. OutputLog.TraceLog(LogPriority.Error,
  2692. this.ToString(),
  2693. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2694. "RProcedureEntity:" + json2,
  2695. LocalPath.LogExePath);
  2696. string json3 = JsonHelper.ToJson(SResponsibleList);
  2697. OutputLog.TraceLog(LogPriority.Error,
  2698. this.ToString(),
  2699. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2700. "SResponsibleList:" + json3,
  2701. LocalPath.LogExePath);
  2702. }
  2703. catch (Exception exc)
  2704. {
  2705. OutputLog.TraceLog(LogPriority.Error,
  2706. this.ToString(),
  2707. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2708. "参数输入异常:" + exc.Message,
  2709. LocalPath.LogExePath);
  2710. }
  2711. }
  2712. return actionResult;
  2713. }
  2714. /// <summary>
  2715. /// 获取产品分级的数据(根据ID)
  2716. /// </summary>
  2717. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  2718. /// <param name="GoodsLevelID">分类ID</param>
  2719. /// <param name="sUserInfo">用户基本信息</param>
  2720. /// <returns>DataSet</returns>
  2721. /// <remarks>
  2722. /// 2014.10.22 庄天威 新建
  2723. public ActionResult GetGoodsLevelDataByIdGet(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  2724. {
  2725. ActionResult actionResult = new ActionResult();
  2726. try
  2727. {
  2728. // 验证请求头信息
  2729. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2730. // 验证失败
  2731. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2732. {
  2733. return actionResult;
  2734. }
  2735. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2736. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  2737. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2738. {
  2739. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2740. actionResult.Status = (int)Constant.PDAResult.Success;
  2741. }
  2742. else
  2743. {
  2744. actionResult.Status = (int)Constant.PDAResult.Fail;
  2745. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2746. }
  2747. }
  2748. catch (Exception ex)
  2749. {
  2750. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2751. OutputLog.TraceLog(LogPriority.Error,
  2752. this.ToString(),
  2753. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2754. ex.ToString(),
  2755. LocalPath.LogExePath);
  2756. actionResult.Status = (int)Constant.PDAResult.Exception;
  2757. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2758. }
  2759. return actionResult;
  2760. }
  2761. /// <summary>
  2762. /// 获取账务日期
  2763. /// </summary>
  2764. /// <param name="accountCode"></param>
  2765. /// <param name="userCode"></param>
  2766. /// <param name="userPassword"></param>
  2767. /// <param name="sessionKey"></param>
  2768. /// <returns></returns>
  2769. public ActionResult GetAccountDateGet(string accountCode, string userCode, string userPassword, string sessionKey)
  2770. {
  2771. ActionResult actionResult = new ActionResult();
  2772. try
  2773. {
  2774. // 验证请求头信息
  2775. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2776. // 验证失败
  2777. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2778. {
  2779. return actionResult;
  2780. }
  2781. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  2782. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  2783. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2784. actionResult.Status = (int)Constant.PDAResult.Success;
  2785. }
  2786. catch (Exception ex)
  2787. {
  2788. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2789. OutputLog.TraceLog(LogPriority.Error,
  2790. this.ToString(),
  2791. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2792. ex.ToString(),
  2793. LocalPath.LogExePath);
  2794. actionResult.Status = (int)Constant.PDAResult.Exception;
  2795. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2796. }
  2797. return actionResult;
  2798. }
  2799. /// <summary>
  2800. /// 获取登陆帐户有无报损权限
  2801. /// </summary>
  2802. /// <param name="accountCode"></param>
  2803. /// <param name="userCode"></param>
  2804. /// <param name="userPassword"></param>
  2805. /// <param name="sessionKey"></param>
  2806. /// <param name="usercode">工号编码</param>
  2807. /// <returns></returns>
  2808. public ActionResult GetScrapFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  2809. {
  2810. ActionResult actionResult = new ActionResult();
  2811. try
  2812. {
  2813. // 验证请求头信息
  2814. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2815. // 验证失败
  2816. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2817. {
  2818. return actionResult;
  2819. }
  2820. int returnValue = ServiceInvoker.Invoke<int>(this,
  2821. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  2822. actionResult.Result = JsonHelper.ToJson(returnValue);
  2823. actionResult.Status = (int)Constant.PDAResult.Success;
  2824. }
  2825. catch (Exception ex)
  2826. {
  2827. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2828. OutputLog.TraceLog(LogPriority.Error,
  2829. this.ToString(),
  2830. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2831. ex.ToString(),
  2832. LocalPath.LogExePath);
  2833. actionResult.Status = (int)Constant.PDAResult.Exception;
  2834. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2835. }
  2836. return actionResult;
  2837. }
  2838. #endregion
  2839. /// <summary>
  2840. /// 获取是否存在报损未审核产品
  2841. /// </summary>
  2842. /// <param name="barcode">产品条码</param>
  2843. /// <returns>int</returns>
  2844. public ActionResult GetScrapProductAuditStatusGet(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2845. {
  2846. ActionResult actionResult = new ActionResult();
  2847. try
  2848. {
  2849. // 验证请求头信息
  2850. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2851. // 验证失败
  2852. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2853. {
  2854. return actionResult;
  2855. }
  2856. int row = ServiceInvoker.Invoke<int>(this,
  2857. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  2858. actionResult.Result = JsonHelper.ToJson(row);
  2859. actionResult.Status = (int)Constant.PDAResult.Success;
  2860. }
  2861. catch (Exception ex)
  2862. {
  2863. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2864. OutputLog.TraceLog(LogPriority.Error,
  2865. this.ToString(),
  2866. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2867. ex.ToString(),
  2868. LocalPath.LogExePath);
  2869. actionResult.Status = (int)Constant.PDAResult.Exception;
  2870. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2871. }
  2872. return actionResult;
  2873. }
  2874. /// <summary>
  2875. /// 查询报废产品信息
  2876. /// </summary>
  2877. /// <param name="accountCode"></param>
  2878. /// <param name="userCode"></param>
  2879. /// <param name="userPassword"></param>
  2880. /// <param name="sessionKey"></param>
  2881. /// <param name="barCode">产品条码</param>
  2882. /// <param name="scrapProductID">报废产品ID</param>
  2883. /// <returns></returns>
  2884. public ActionResult GetScrapProductGet(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  2885. {
  2886. ActionResult actionResult = new ActionResult();
  2887. try
  2888. {
  2889. // 验证请求头信息
  2890. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2891. // 验证失败
  2892. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2893. {
  2894. return actionResult;
  2895. }
  2896. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  2897. selectProEntity.BarCode = barCode;
  2898. selectProEntity.ScrapProductID = scrapProductID;
  2899. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2900. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  2901. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2902. {
  2903. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2904. actionResult.Status = (int)Constant.PDAResult.Success;
  2905. }
  2906. else
  2907. {
  2908. actionResult.Status = (int)Constant.PDAResult.Fail;
  2909. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2910. }
  2911. }
  2912. catch (Exception ex)
  2913. {
  2914. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2915. OutputLog.TraceLog(LogPriority.Error,
  2916. this.ToString(),
  2917. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2918. ex.ToString(),
  2919. LocalPath.LogExePath);
  2920. actionResult.Status = (int)Constant.PDAResult.Exception;
  2921. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2922. }
  2923. return actionResult;
  2924. }
  2925. /// <summary>
  2926. /// 根据废弃产品ID获取责任工序
  2927. /// </summary>
  2928. /// <param name="accountCode"></param>
  2929. /// <param name="userCode"></param>
  2930. /// <param name="userPassword"></param>
  2931. /// <param name="sessionKey"></param>
  2932. /// <param name="scrapProductID">报废产品ID</param>
  2933. /// <returns></returns>
  2934. public ActionResult GetResponProcedureBySPIdGet(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  2935. {
  2936. ActionResult actionResult = new ActionResult();
  2937. try
  2938. {
  2939. // 验证请求头信息
  2940. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2941. // 验证失败
  2942. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2943. {
  2944. return actionResult;
  2945. }
  2946. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2947. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  2948. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2949. {
  2950. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2951. actionResult.Status = (int)Constant.PDAResult.Success;
  2952. }
  2953. else
  2954. {
  2955. actionResult.Status = (int)Constant.PDAResult.Fail;
  2956. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2957. }
  2958. }
  2959. catch (Exception ex)
  2960. {
  2961. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2962. OutputLog.TraceLog(LogPriority.Error,
  2963. this.ToString(),
  2964. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2965. ex.ToString(),
  2966. LocalPath.LogExePath);
  2967. actionResult.Status = (int)Constant.PDAResult.Exception;
  2968. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2969. }
  2970. return actionResult;
  2971. }
  2972. /// <summary>
  2973. /// 根据废弃产品ID获取责任人列表
  2974. /// </summary>
  2975. /// <param name="accountCode"></param>
  2976. /// <param name="userCode"></param>
  2977. /// <param name="userPassword"></param>
  2978. /// <param name="sessionKey"></param>
  2979. /// <param name="scrapProductID">报废产品ID</param>
  2980. /// <returns></returns>
  2981. public ActionResult GetScrapResponsibleBySPIdGet(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  2982. {
  2983. ActionResult actionResult = new ActionResult();
  2984. try
  2985. {
  2986. // 验证请求头信息
  2987. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2988. // 验证失败
  2989. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2990. {
  2991. return actionResult;
  2992. }
  2993. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2994. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  2995. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2996. {
  2997. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2998. actionResult.Status = (int)Constant.PDAResult.Success;
  2999. }
  3000. else
  3001. {
  3002. actionResult.Status = (int)Constant.PDAResult.Fail;
  3003. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3004. }
  3005. }
  3006. catch (Exception ex)
  3007. {
  3008. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3009. OutputLog.TraceLog(LogPriority.Error,
  3010. this.ToString(),
  3011. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3012. ex.ToString(),
  3013. LocalPath.LogExePath);
  3014. actionResult.Status = (int)Constant.PDAResult.Exception;
  3015. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3016. }
  3017. return actionResult;
  3018. }
  3019. /// <summary>
  3020. /// 添加废弃产品记录
  3021. /// </summary>
  3022. /// <param name="SProductEntity">废弃产品实体</param>
  3023. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3024. /// <param name="SResponsibleList">责任者集合</param>
  3025. /// <param name="userInfo">用户基本信息</param>
  3026. /// <returns>int结果返回值</returns>
  3027. /// <remarks>
  3028. /// 庄天威 2014.09.24 新建
  3029. /// </remarks>
  3030. public ActionResult UpdateScrapProductGet(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3031. ResponProcedureEntity UpdateRProcedureEntity,
  3032. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3033. {
  3034. ActionResult actionResult = new ActionResult();
  3035. try
  3036. {
  3037. // 验证请求头信息
  3038. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3039. // 验证失败
  3040. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3041. {
  3042. return actionResult;
  3043. }
  3044. int addRow = ServiceInvoker.Invoke<int>(this,
  3045. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3046. actionResult.Result = JsonHelper.ToJson(addRow);
  3047. actionResult.Status = (int)Constant.PDAResult.Success;
  3048. }
  3049. catch (Exception ex)
  3050. {
  3051. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3052. OutputLog.TraceLog(LogPriority.Error,
  3053. this.ToString(),
  3054. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3055. ex.ToString(),
  3056. LocalPath.LogExePath);
  3057. actionResult.Status = (int)Constant.PDAResult.Exception;
  3058. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3059. }
  3060. return actionResult;
  3061. }
  3062. /// <summary>
  3063. /// 获取产品窑炉
  3064. /// </summary>
  3065. /// <param name="accountCode"></param>
  3066. /// <param name="userCode"></param>
  3067. /// <param name="userPassword"></param>
  3068. /// <param name="sessionKey"></param>
  3069. /// <returns>Datase</returns>
  3070. public ActionResult GetAllKilntInfoGet(string accountCode, string userCode, string userPassword, string sessionKey)
  3071. {
  3072. ActionResult actionResult = new ActionResult();
  3073. try
  3074. {
  3075. // 验证请求头信息
  3076. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3077. // 验证失败
  3078. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3079. {
  3080. return actionResult;
  3081. }
  3082. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3083. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3084. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3085. {
  3086. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3087. actionResult.Status = (int)Constant.PDAResult.Success;
  3088. }
  3089. else
  3090. {
  3091. actionResult.Status = (int)Constant.PDAResult.Fail;
  3092. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3093. }
  3094. }
  3095. catch (Exception ex)
  3096. {
  3097. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3098. OutputLog.TraceLog(LogPriority.Error,
  3099. this.ToString(),
  3100. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3101. ex.ToString(),
  3102. LocalPath.LogExePath);
  3103. actionResult.Status = (int)Constant.PDAResult.Exception;
  3104. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3105. }
  3106. return actionResult;
  3107. }
  3108. /// <summary>
  3109. /// 获取次品产品条码允许编辑
  3110. /// </summary>
  3111. /// <param name="accountCode"></param>
  3112. /// <param name="userCode"></param>
  3113. /// <param name="userPassword"></param>
  3114. /// <param name="sessionKey"></param>
  3115. /// <param name="barcode">产品条码</param>
  3116. /// <returns>Datase</returns>
  3117. public ActionResult GetSubstandardInfoGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3118. {
  3119. ActionResult actionResult = new ActionResult();
  3120. try
  3121. {
  3122. // 验证请求头信息
  3123. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3124. // 验证失败
  3125. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3126. {
  3127. return actionResult;
  3128. }
  3129. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3130. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3131. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3132. {
  3133. actionResult.Result = JsonHelper.ToJson(1);
  3134. actionResult.Status = (int)Constant.PDAResult.Success;
  3135. }
  3136. else
  3137. {
  3138. actionResult.Result = JsonHelper.ToJson(0);
  3139. actionResult.Status = (int)Constant.PDAResult.Fail;
  3140. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3141. }
  3142. }
  3143. catch (Exception ex)
  3144. {
  3145. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3146. OutputLog.TraceLog(LogPriority.Error,
  3147. this.ToString(),
  3148. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3149. ex.ToString(),
  3150. LocalPath.LogExePath);
  3151. actionResult.Status = (int)Constant.PDAResult.Exception;
  3152. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3153. }
  3154. return actionResult;
  3155. }
  3156. /// <summary>
  3157. /// 获取产品条码是否重烧
  3158. /// </summary>
  3159. /// <param name="accountCode"></param>
  3160. /// <param name="userCode"></param>
  3161. /// <param name="userPassword"></param>
  3162. /// <param name="sessionKey"></param>
  3163. /// <param name="barcode">产品条码</param>
  3164. /// <returns>Datase</returns>
  3165. public ActionResult GetReFineGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3166. {
  3167. ActionResult actionResult = new ActionResult();
  3168. try
  3169. {
  3170. // 验证请求头信息
  3171. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3172. // 验证失败
  3173. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3174. {
  3175. return actionResult;
  3176. }
  3177. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3178. () => PDAModuleLogic.GetReFine(barcode));
  3179. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3180. {
  3181. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3182. }
  3183. else
  3184. {
  3185. actionResult.Result = JsonHelper.ToJson(0);
  3186. }
  3187. actionResult.Status = (int)Constant.PDAResult.Success;
  3188. }
  3189. catch (Exception ex)
  3190. {
  3191. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3192. OutputLog.TraceLog(LogPriority.Error,
  3193. this.ToString(),
  3194. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3195. ex.ToString(),
  3196. LocalPath.LogExePath);
  3197. actionResult.Status = (int)Constant.PDAResult.Exception;
  3198. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3199. }
  3200. return actionResult;
  3201. }
  3202. /// <summary>
  3203. /// 获取登陆帐户有无成检编辑权限
  3204. /// </summary>
  3205. /// <param name="accountCode"></param>
  3206. /// <param name="userCode"></param>
  3207. /// <param name="userPassword"></param>
  3208. /// <param name="sessionKey"></param>
  3209. /// <param name="usercode">工号编码</param>
  3210. /// <returns></returns>
  3211. public ActionResult GetFinishedProductEditFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  3212. {
  3213. ActionResult actionResult = new ActionResult();
  3214. try
  3215. {
  3216. // 验证请求头信息
  3217. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3218. // 验证失败
  3219. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3220. {
  3221. return actionResult;
  3222. }
  3223. int returnValue = ServiceInvoker.Invoke<int>(this,
  3224. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3225. actionResult.Result = JsonHelper.ToJson(returnValue);
  3226. actionResult.Status = (int)Constant.PDAResult.Success;
  3227. }
  3228. catch (Exception ex)
  3229. {
  3230. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3231. OutputLog.TraceLog(LogPriority.Error,
  3232. this.ToString(),
  3233. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3234. ex.ToString(),
  3235. LocalPath.LogExePath);
  3236. actionResult.Status = (int)Constant.PDAResult.Exception;
  3237. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3238. }
  3239. return actionResult;
  3240. }
  3241. /// <summary>
  3242. /// 根据条码及工序判断是否漏扫
  3243. /// </summary>
  3244. /// <param name="accountCode"></param>
  3245. /// <param name="userCode"></param>
  3246. /// <param name="userPassword"></param>
  3247. /// <param name="sessionKey"></param>
  3248. /// <param name="usercode">工号编码</param>
  3249. /// <param name="barcode">产品条码</param>
  3250. /// <param name="produceid">工序ID</param>
  3251. /// <returns></returns>
  3252. public ActionResult AddBarCodeMissingGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3253. {
  3254. ActionResult actionResult = new ActionResult();
  3255. try
  3256. {
  3257. // 验证请求头信息
  3258. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3259. // 验证失败
  3260. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3261. {
  3262. return actionResult;
  3263. }
  3264. int returnValue = 1;
  3265. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3266. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3267. actionResult.Result = JsonHelper.ToJson(returnValue);
  3268. actionResult.Status = (int)Constant.PDAResult.Success;
  3269. }
  3270. catch (Exception ex)
  3271. {
  3272. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3273. OutputLog.TraceLog(LogPriority.Error,
  3274. this.ToString(),
  3275. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3276. ex.ToString(),
  3277. LocalPath.LogExePath);
  3278. actionResult.Status = (int)Constant.PDAResult.Exception;
  3279. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3280. }
  3281. return actionResult;
  3282. }
  3283. /// <summary>
  3284. /// 获取登陆帐户有无报损审批权限
  3285. /// </summary>
  3286. /// <param name="accountCode"></param>
  3287. /// <param name="userCode"></param>
  3288. /// <param name="userPassword"></param>
  3289. /// <param name="sessionKey"></param>
  3290. /// <param name="usercode">工号编码</param>
  3291. /// <returns></returns>
  3292. public ActionResult GetScrapProductFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  3293. {
  3294. ActionResult actionResult = new ActionResult();
  3295. try
  3296. {
  3297. // 验证请求头信息
  3298. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3299. // 验证失败
  3300. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3301. {
  3302. return actionResult;
  3303. }
  3304. int returnValue = ServiceInvoker.Invoke<int>(this,
  3305. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3306. actionResult.Result = JsonHelper.ToJson(returnValue);
  3307. actionResult.Status = (int)Constant.PDAResult.Success;
  3308. }
  3309. catch (Exception ex)
  3310. {
  3311. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3312. OutputLog.TraceLog(LogPriority.Error,
  3313. this.ToString(),
  3314. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3315. ex.ToString(),
  3316. LocalPath.LogExePath);
  3317. actionResult.Status = (int)Constant.PDAResult.Exception;
  3318. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3319. }
  3320. return actionResult;
  3321. }
  3322. /// <summary>
  3323. /// 获取登陆帐户有无报损审批权限
  3324. /// </summary>
  3325. /// <param name="accountCode"></param>
  3326. /// <param name="userCode"></param>
  3327. /// <param name="userPassword"></param>
  3328. /// <param name="sessionKey"></param>
  3329. /// <param name="usercode">工号编码</param>
  3330. /// <returns></returns>
  3331. public ActionResult GetSpecialRepairflagByBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3332. {
  3333. ActionResult actionResult = new ActionResult();
  3334. try
  3335. {
  3336. // 验证请求头信息
  3337. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3338. // 验证失败
  3339. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3340. {
  3341. return actionResult;
  3342. }
  3343. int returnValue = ServiceInvoker.Invoke<int>(this,
  3344. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3345. actionResult.Result = JsonHelper.ToJson(returnValue);
  3346. actionResult.Status = (int)Constant.PDAResult.Success;
  3347. }
  3348. catch (Exception ex)
  3349. {
  3350. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3351. OutputLog.TraceLog(LogPriority.Error,
  3352. this.ToString(),
  3353. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3354. ex.ToString(),
  3355. LocalPath.LogExePath);
  3356. actionResult.Status = (int)Constant.PDAResult.Exception;
  3357. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3358. }
  3359. return actionResult;
  3360. }
  3361. /// <summary>
  3362. /// 获取窑车对应产品列表
  3363. /// </summary>
  3364. /// <param name="accountCode"></param>
  3365. /// <param name="userCode"></param>
  3366. /// <param name="userPassword"></param>
  3367. /// <param name="sessionKey"></param>
  3368. /// <param name="KilnCarID">窑车ID</param>
  3369. /// <returns>Dataset</returns>
  3370. public ActionResult GetKilnCarGoodsByKilnCarIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  3371. {
  3372. ActionResult actionResult = new ActionResult();
  3373. try
  3374. {
  3375. // 验证请求头信息
  3376. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3377. // 验证失败
  3378. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3379. {
  3380. return actionResult;
  3381. }
  3382. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3383. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3384. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3385. {
  3386. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3387. actionResult.Status = (int)Constant.PDAResult.Success;
  3388. }
  3389. else
  3390. {
  3391. actionResult.Status = (int)Constant.PDAResult.Fail;
  3392. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3393. }
  3394. }
  3395. catch (Exception ex)
  3396. {
  3397. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3398. OutputLog.TraceLog(LogPriority.Error,
  3399. this.ToString(),
  3400. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3401. ex.ToString(),
  3402. LocalPath.LogExePath);
  3403. actionResult.Status = (int)Constant.PDAResult.Exception;
  3404. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3405. }
  3406. return actionResult;
  3407. }
  3408. /// <summary>
  3409. /// 更换条码
  3410. /// </summary>
  3411. /// <param name="accountCode"></param>
  3412. /// <param name="userCode"></param>
  3413. /// <param name="userPassword"></param>
  3414. /// <param name="sessionKey"></param>
  3415. ///<param name="barcode">原条码</param>
  3416. /// <param name="newBarcode">新条码</param>
  3417. /// <param name="remarks">备注</param>
  3418. /// <returns>操作结果</returns>
  3419. public ActionResult SaveBarCodeChangeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  3420. {
  3421. ActionResult actionResult = new ActionResult();
  3422. try
  3423. {
  3424. // 验证请求头信息
  3425. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3426. // 验证失败
  3427. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3428. {
  3429. return actionResult;
  3430. }
  3431. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3432. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3433. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3434. {
  3435. actionResult.Result = 1;
  3436. actionResult.Status = (int)Constant.PDAResult.Success;
  3437. }
  3438. else
  3439. {
  3440. actionResult.Status = (int)Constant.PDAResult.Fail;
  3441. actionResult.Message = serviceResultEntity.Message;
  3442. }
  3443. }
  3444. catch (Exception ex)
  3445. {
  3446. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3447. OutputLog.TraceLog(LogPriority.Error,
  3448. this.ToString(),
  3449. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3450. ex.ToString(),
  3451. LocalPath.LogExePath);
  3452. actionResult.Status = (int)Constant.PDAResult.Exception;
  3453. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3454. }
  3455. return actionResult;
  3456. }
  3457. /// <summary>
  3458. /// 获取(注浆登记)的查询数据
  3459. /// </summary>
  3460. /// <param name="accountCode"></param>
  3461. /// <param name="userCode"></param>
  3462. /// <param name="userPassword"></param>
  3463. /// <param name="sessionKey"></param>
  3464. /// <param name="se">查询条件</param>
  3465. /// <returns>Dataset</returns>
  3466. public ActionResult GetGroutingListGet(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  3467. {
  3468. ActionResult actionResult = new ActionResult();
  3469. try
  3470. {
  3471. // 验证请求头信息
  3472. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3473. // 验证失败
  3474. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3475. {
  3476. return actionResult;
  3477. }
  3478. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3479. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3480. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3481. {
  3482. // PDA不显示的列删除掉
  3483. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3484. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3485. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3486. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3487. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3488. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3489. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3490. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3491. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3492. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3493. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3494. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3495. actionResult.Status = (int)Constant.PDAResult.Success;
  3496. }
  3497. else
  3498. {
  3499. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3500. actionResult.Message = "无查询数据";
  3501. }
  3502. }
  3503. catch (Exception ex)
  3504. {
  3505. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3506. OutputLog.TraceLog(LogPriority.Error,
  3507. this.ToString(),
  3508. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3509. ex.ToString(),
  3510. LocalPath.LogExePath);
  3511. actionResult.Status = (int)Constant.PDAResult.Exception;
  3512. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3513. }
  3514. return actionResult;
  3515. }
  3516. /// <summary>
  3517. /// 获取(注浆登记)的查询数据
  3518. /// </summary>
  3519. /// <param name="accountCode"></param>
  3520. /// <param name="userCode"></param>
  3521. /// <param name="userPassword"></param>
  3522. /// <param name="sessionKey"></param>
  3523. /// <param name="se">查询条件</param>
  3524. /// <returns>Dataset</returns>
  3525. public ActionResult GetGroutingListByBarCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3526. {
  3527. ActionResult actionResult = new ActionResult();
  3528. try
  3529. {
  3530. // 验证请求头信息
  3531. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3532. // 验证失败
  3533. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3534. {
  3535. return actionResult;
  3536. }
  3537. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3538. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3539. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3540. {
  3541. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3542. actionResult.Status = (int)Constant.PDAResult.Success;
  3543. }
  3544. else
  3545. {
  3546. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3547. actionResult.Message = "无查询数据";
  3548. }
  3549. }
  3550. catch (Exception ex)
  3551. {
  3552. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3553. OutputLog.TraceLog(LogPriority.Error,
  3554. this.ToString(),
  3555. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3556. ex.ToString(),
  3557. LocalPath.LogExePath);
  3558. actionResult.Status = (int)Constant.PDAResult.Exception;
  3559. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3560. }
  3561. return actionResult;
  3562. }
  3563. /// <summary>
  3564. ///获得成型线信息
  3565. /// </summary>
  3566. /// <param name="accountCode"></param>
  3567. /// <param name="userCode"></param>
  3568. /// <param name="userPassword"></param>
  3569. /// <param name="sessionKey"></param>
  3570. /// <param name="se">查询条件</param>
  3571. /// <returns>Dataset</returns>
  3572. public ActionResult GetGroutingLineGet(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3573. {
  3574. ActionResult actionResult = new ActionResult();
  3575. try
  3576. {
  3577. // 验证请求头信息
  3578. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3579. // 验证失败
  3580. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3581. {
  3582. return actionResult;
  3583. }
  3584. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3585. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3586. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3587. {
  3588. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3589. actionResult.Status = (int)Constant.PDAResult.Success;
  3590. }
  3591. else
  3592. {
  3593. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3594. actionResult.Message = "无查询数据";
  3595. }
  3596. }
  3597. catch (Exception ex)
  3598. {
  3599. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3600. OutputLog.TraceLog(LogPriority.Error,
  3601. this.ToString(),
  3602. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3603. ex.ToString(),
  3604. LocalPath.LogExePath);
  3605. actionResult.Status = (int)Constant.PDAResult.Exception;
  3606. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3607. }
  3608. return actionResult;
  3609. }
  3610. /// <summary>
  3611. ///获取在产产品的信息标识列表
  3612. /// </summary>
  3613. /// <param name="accountCode"></param>
  3614. /// <param name="userCode"></param>
  3615. /// <param name="userPassword"></param>
  3616. /// <param name="sessionKey"></param>
  3617. /// <param name="barcode">查询条件</param>
  3618. /// <returns>Dataset</returns>
  3619. public ActionResult GetInProductionDataListGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3620. {
  3621. ActionResult actionResult = new ActionResult();
  3622. try
  3623. {
  3624. // 验证请求头信息
  3625. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3626. // 验证失败
  3627. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3628. {
  3629. return actionResult;
  3630. }
  3631. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3632. () => PMModuleLogic.GetInProductionDataList(barcode));
  3633. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3634. {
  3635. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3636. actionResult.Status = (int)Constant.PDAResult.Success;
  3637. }
  3638. else
  3639. {
  3640. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3641. actionResult.Message = "无查询数据";
  3642. }
  3643. }
  3644. catch (Exception ex)
  3645. {
  3646. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3647. OutputLog.TraceLog(LogPriority.Error,
  3648. this.ToString(),
  3649. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3650. ex.ToString(),
  3651. LocalPath.LogExePath);
  3652. actionResult.Status = (int)Constant.PDAResult.Exception;
  3653. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3654. }
  3655. return actionResult;
  3656. }
  3657. /// <summary>
  3658. ///获取条码是否注浆登记过,0行无效
  3659. /// </summary>
  3660. /// <param name="accountCode"></param>
  3661. /// <param name="userCode"></param>
  3662. /// <param name="userPassword"></param>
  3663. /// <param name="sessionKey"></param>
  3664. /// <param name="barcode">查询条件</param>
  3665. /// <returns>Dataset</returns>
  3666. public ActionResult GetBarCodeInGroutingDailyDetailGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3667. {
  3668. ActionResult actionResult = new ActionResult();
  3669. try
  3670. {
  3671. // 验证请求头信息
  3672. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3673. // 验证失败
  3674. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3675. {
  3676. return actionResult;
  3677. }
  3678. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3679. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  3680. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3681. {
  3682. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3683. actionResult.Status = (int)Constant.PDAResult.Success;
  3684. }
  3685. else
  3686. {
  3687. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3688. actionResult.Message = "该产品条码无效,无法报损!";
  3689. }
  3690. }
  3691. catch (Exception ex)
  3692. {
  3693. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3694. OutputLog.TraceLog(LogPriority.Error,
  3695. this.ToString(),
  3696. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3697. ex.ToString(),
  3698. LocalPath.LogExePath);
  3699. actionResult.Status = (int)Constant.PDAResult.Exception;
  3700. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3701. }
  3702. return actionResult;
  3703. }
  3704. /// <summary>
  3705. /// 获取登陆帐户有变更条码权限
  3706. /// </summary>
  3707. /// <param name="accountCode"></param>
  3708. /// <param name="userCode"></param>
  3709. /// <param name="userPassword"></param>
  3710. /// <param name="sessionKey"></param>
  3711. /// <returns></returns>
  3712. public ActionResult GetBarCodeRecordFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  3713. {
  3714. ActionResult actionResult = new ActionResult();
  3715. try
  3716. {
  3717. // 验证请求头信息
  3718. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3719. // 验证失败
  3720. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3721. {
  3722. return actionResult;
  3723. }
  3724. int returnValue = ServiceInvoker.Invoke<int>(this,
  3725. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  3726. actionResult.Result = JsonHelper.ToJson(returnValue);
  3727. actionResult.Status = (int)Constant.PDAResult.Success;
  3728. }
  3729. catch (Exception ex)
  3730. {
  3731. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3732. OutputLog.TraceLog(LogPriority.Error,
  3733. this.ToString(),
  3734. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3735. ex.ToString(),
  3736. LocalPath.LogExePath);
  3737. actionResult.Status = (int)Constant.PDAResult.Exception;
  3738. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3739. }
  3740. return actionResult;
  3741. }
  3742. /// <summary>
  3743. /// 成检时获取此条码是否报损
  3744. /// </summary>
  3745. /// <param name="accountCode"></param>
  3746. /// <param name="userCode"></param>
  3747. /// <param name="userPassword"></param>
  3748. /// <param name="sessionKey"></param>
  3749. /// <param name="barcode">产品条码</param>
  3750. /// <returns></returns>
  3751. public ActionResult CheckScrapProductGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3752. {
  3753. ActionResult actionResult = new ActionResult();
  3754. try
  3755. {
  3756. // 验证请求头信息
  3757. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3758. // 验证失败
  3759. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3760. {
  3761. return actionResult;
  3762. }
  3763. int returnValue = ServiceInvoker.Invoke<int>(this,
  3764. () => PMModuleLogic.CheckScrapProduct(barcode));
  3765. if (returnValue == -100)
  3766. {
  3767. actionResult.Result = JsonHelper.ToJson(returnValue);
  3768. actionResult.Status = (int)Constant.PDAResult.Success;
  3769. }
  3770. else
  3771. {
  3772. actionResult.Status = (int)Constant.PDAResult.Fail;
  3773. if (returnValue == 0)
  3774. {
  3775. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  3776. }
  3777. else
  3778. {
  3779. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  3780. }
  3781. }
  3782. }
  3783. catch (Exception ex)
  3784. {
  3785. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3786. OutputLog.TraceLog(LogPriority.Error,
  3787. this.ToString(),
  3788. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3789. ex.ToString(),
  3790. LocalPath.LogExePath);
  3791. actionResult.Status = (int)Constant.PDAResult.Exception;
  3792. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3793. }
  3794. return actionResult;
  3795. }
  3796. /// <summary>
  3797. /// 获取产品完成工序的ID(PDA)
  3798. /// </summary>
  3799. /// <param name="barcode">产品条码</param>
  3800. /// <returns>int</returns>
  3801. public ActionResult GetCompleteProcedureIDPDAGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3802. {
  3803. ActionResult actionResult = new ActionResult();
  3804. try
  3805. {
  3806. // 验证请求头信息
  3807. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3808. // 验证失败
  3809. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3810. {
  3811. return actionResult;
  3812. }
  3813. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3814. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  3815. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3816. actionResult.Status = (int)Constant.PDAResult.Success;
  3817. }
  3818. catch (Exception ex)
  3819. {
  3820. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3821. OutputLog.TraceLog(LogPriority.Error,
  3822. this.ToString(),
  3823. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3824. ex.ToString(),
  3825. LocalPath.LogExePath);
  3826. actionResult.Status = (int)Constant.PDAResult.Exception;
  3827. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3828. }
  3829. return actionResult;
  3830. }
  3831. /// <summary>
  3832. /// 获取产品完成工序的ID(PDA)
  3833. /// </summary>
  3834. /// <param name="barcode">产品条码</param>
  3835. /// <returns>int</returns>
  3836. public ActionResult GetGoodsInfoBybarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3837. {
  3838. ActionResult actionResult = new ActionResult();
  3839. try
  3840. {
  3841. // 验证请求头信息
  3842. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3843. // 验证失败
  3844. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3845. {
  3846. return actionResult;
  3847. }
  3848. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3849. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  3850. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3851. actionResult.Status = (int)Constant.PDAResult.Success;
  3852. }
  3853. catch (Exception ex)
  3854. {
  3855. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3856. OutputLog.TraceLog(LogPriority.Error,
  3857. this.ToString(),
  3858. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3859. ex.ToString(),
  3860. LocalPath.LogExePath);
  3861. actionResult.Status = (int)Constant.PDAResult.Exception;
  3862. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3863. }
  3864. return actionResult;
  3865. }
  3866. /// <summary>
  3867. /// 成检-校验生产工号
  3868. /// </summary>
  3869. /// <param name="usercode">生产工号</param>
  3870. /// <returns>int</returns>
  3871. public ActionResult GetUserCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string usercodep)
  3872. {
  3873. ActionResult actionResult = new ActionResult();
  3874. try
  3875. {
  3876. // 验证请求头信息
  3877. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3878. // 验证失败
  3879. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3880. {
  3881. return actionResult;
  3882. }
  3883. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3884. () => PDAModuleLogic.GetUserCode(usercodep, sUserInfo));
  3885. actionResult.Result = JsonHelper.ToJson(ds);
  3886. actionResult.Status = (int)Constant.PDAResult.Success;
  3887. }
  3888. catch (Exception ex)
  3889. {
  3890. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3891. OutputLog.TraceLog(LogPriority.Error,
  3892. this.ToString(),
  3893. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3894. ex.ToString(),
  3895. LocalPath.LogExePath);
  3896. actionResult.Status = (int)Constant.PDAResult.Exception;
  3897. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3898. }
  3899. return actionResult;
  3900. }
  3901. /// <summary>
  3902. /// 更新漏扫的成型工号
  3903. /// </summary>
  3904. /// <param name="accountCode"></param>
  3905. /// <param name="userCode"></param>
  3906. /// <param name="userPassword"></param>
  3907. /// <param name="sessionKey"></param>
  3908. /// <param name="groutingUserCode">成型工号</param>
  3909. /// <param name="missingID">漏扫ID</param>
  3910. /// <returns></returns>
  3911. public ActionResult UpdateGroutingUserCodeByMissingIDGet(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  3912. {
  3913. ActionResult actionResult = new ActionResult();
  3914. try
  3915. {
  3916. // 验证请求头信息
  3917. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3918. // 验证失败
  3919. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3920. {
  3921. return actionResult;
  3922. }
  3923. int returnValue = ServiceInvoker.Invoke<int>(this,
  3924. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  3925. if (returnValue != -1)
  3926. {
  3927. actionResult.Result = JsonHelper.ToJson(returnValue);
  3928. actionResult.Status = (int)Constant.PDAResult.Success;
  3929. }
  3930. else
  3931. {
  3932. actionResult.Status = (int)Constant.PDAResult.Fail;
  3933. actionResult.Message = "存在无效的漏扫工号";
  3934. }
  3935. }
  3936. catch (Exception ex)
  3937. {
  3938. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3939. OutputLog.TraceLog(LogPriority.Error,
  3940. this.ToString(),
  3941. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3942. ex.ToString(),
  3943. LocalPath.LogExePath);
  3944. actionResult.Status = (int)Constant.PDAResult.Exception;
  3945. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3946. }
  3947. return actionResult;
  3948. }
  3949. /// <summary>
  3950. /// 在入窑工序检验窑车号是否存在
  3951. /// </summary>
  3952. /// <param name="accountCode"></param>
  3953. /// <param name="userCode"></param>
  3954. /// <param name="userPassword"></param>
  3955. /// <param name="sessionKey"></param>
  3956. /// <param name="kilncarcode">窑车编码</param>
  3957. /// <param name="procedureid">工序ID</param>
  3958. /// <returns></returns>
  3959. public ActionResult CheckKilnCarByIntoCarGet(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  3960. {
  3961. ActionResult actionResult = new ActionResult();
  3962. try
  3963. {
  3964. // 验证请求头信息
  3965. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3966. // 验证失败
  3967. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3968. {
  3969. return actionResult;
  3970. }
  3971. int returnValue = ServiceInvoker.Invoke<int>(this,
  3972. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  3973. if (returnValue == 1)
  3974. {
  3975. actionResult.Result = JsonHelper.ToJson(returnValue);
  3976. actionResult.Status = (int)Constant.PDAResult.Success;
  3977. }
  3978. else
  3979. {
  3980. actionResult.Status = (int)Constant.PDAResult.Fail;
  3981. if (returnValue == -99)
  3982. actionResult.Message = "窑炉车号无效";
  3983. else if (returnValue == -98)
  3984. actionResult.Message = "窑车己无产品";
  3985. else if (returnValue == -97)
  3986. actionResult.Message = "窑车没有入窑,不可以撤销";
  3987. else if (returnValue == -1)
  3988. actionResult.Message = "保存失败";
  3989. }
  3990. }
  3991. catch (Exception ex)
  3992. {
  3993. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3994. OutputLog.TraceLog(LogPriority.Error,
  3995. this.ToString(),
  3996. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3997. ex.ToString(),
  3998. LocalPath.LogExePath);
  3999. actionResult.Status = (int)Constant.PDAResult.Exception;
  4000. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4001. }
  4002. return actionResult;
  4003. }
  4004. /// <summary>
  4005. /// 获取盘点单列表
  4006. /// </summary>
  4007. /// <param name="sUserInfo"></param>
  4008. /// <returns></returns>
  4009. public ActionResult GetInCheckedListGet(string accountCode, string userCode, string userPassword, string sessionKey)
  4010. {
  4011. ActionResult actionResult = new ActionResult();
  4012. try
  4013. {
  4014. // 验证请求头信息
  4015. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4016. // 验证失败
  4017. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4018. {
  4019. return actionResult;
  4020. }
  4021. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4022. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  4023. actionResult.Result = JsonHelper.ToJson(ds);
  4024. actionResult.Status = (int)Constant.PDAResult.Success;
  4025. }
  4026. catch (Exception ex)
  4027. {
  4028. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4029. OutputLog.TraceLog(LogPriority.Error,
  4030. this.ToString(),
  4031. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4032. ex.ToString(),
  4033. LocalPath.LogExePath);
  4034. actionResult.Status = (int)Constant.PDAResult.Exception;
  4035. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4036. }
  4037. return actionResult;
  4038. }
  4039. /// <summary>
  4040. /// 进行盘点操作
  4041. /// </summary>
  4042. /// <param name="accountCode"></param>
  4043. /// <param name="userCode"></param>
  4044. /// <param name="userPassword"></param>
  4045. /// <param name="sessionKey"></param>
  4046. /// <param name="InCheckedID">盘点单ID</param>
  4047. /// <param name="BarCode">产品条码</param>
  4048. /// <returns></returns>
  4049. public ActionResult UpdateInCheckedGet(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4050. {
  4051. ActionResult actionResult = new ActionResult();
  4052. try
  4053. {
  4054. // 验证请求头信息
  4055. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4056. // 验证失败
  4057. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4058. {
  4059. return actionResult;
  4060. }
  4061. int returnValue = ServiceInvoker.Invoke<int>(this,
  4062. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4063. if (returnValue > 0)
  4064. {
  4065. actionResult.Result = JsonHelper.ToJson(returnValue);
  4066. actionResult.Status = (int)Constant.PDAResult.Success;
  4067. actionResult.Message = "产品" + BarCode + "盘点成功";
  4068. }
  4069. else if (returnValue == 10)
  4070. {
  4071. actionResult.Result = JsonHelper.ToJson(returnValue);
  4072. actionResult.Status = (int)Constant.PDAResult.Success;
  4073. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4074. }
  4075. else
  4076. {
  4077. actionResult.Status = (int)Constant.PDAResult.Fail;
  4078. if (returnValue == -2)
  4079. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4080. //if (returnValue == 10)
  4081. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4082. //if (returnValue > 0)
  4083. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4084. if (returnValue == -22)
  4085. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4086. if (returnValue == -23)
  4087. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4088. if (returnValue == -24)
  4089. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4090. if (returnValue == -25)
  4091. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4092. else if (returnValue == 0)
  4093. actionResult.Message = "盘点失败";
  4094. }
  4095. }
  4096. catch (Exception ex)
  4097. {
  4098. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4099. OutputLog.TraceLog(LogPriority.Error,
  4100. this.ToString(),
  4101. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4102. ex.ToString(),
  4103. LocalPath.LogExePath);
  4104. actionResult.Status = (int)Constant.PDAResult.Exception;
  4105. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4106. }
  4107. return actionResult;
  4108. }
  4109. #region 班次配置
  4110. /// <summary>
  4111. /// 班次配置-通过工号获取工种列表
  4112. /// </summary>
  4113. /// <param name="userId">工号ID</param>
  4114. /// <returns></returns>
  4115. public ActionResult BindUserJobsGet(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4116. {
  4117. ActionResult actionResult = new ActionResult();
  4118. try
  4119. {
  4120. // 验证请求头信息
  4121. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4122. // 验证失败
  4123. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4124. {
  4125. return actionResult;
  4126. }
  4127. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4128. () => SystemModuleLogic.GetJobByUserId(userId));
  4129. actionResult.Result = JsonHelper.ToJson(ds);
  4130. actionResult.Status = (int)Constant.PDAResult.Success;
  4131. }
  4132. catch (Exception ex)
  4133. {
  4134. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4135. OutputLog.TraceLog(LogPriority.Error,
  4136. this.ToString(),
  4137. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4138. ex.ToString(),
  4139. LocalPath.LogExePath);
  4140. actionResult.Status = (int)Constant.PDAResult.Exception;
  4141. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4142. }
  4143. return actionResult;
  4144. }
  4145. ///// <summary>
  4146. ///// 班次配置-根据工号查询员工档案信息
  4147. ///// </summary>
  4148. ///// <param name="userId">工号ID</param>
  4149. ///// <returns></returns>
  4150. //public ActionResult SearchHrStaffInfoGet(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4151. //{
  4152. // ActionResult actionResult = new ActionResult();
  4153. // try
  4154. // {
  4155. // // 验证请求头信息
  4156. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4157. // // 验证失败
  4158. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4159. // {
  4160. // return actionResult;
  4161. // }
  4162. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4163. // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
  4164. // actionResult.Result = JsonHelper.ToJson(ds);
  4165. // actionResult.Status = (int)Constant.PDAResult.Success;
  4166. // }
  4167. // catch (Exception ex)
  4168. // {
  4169. // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4170. // OutputLog.TraceLog(LogPriority.Error,
  4171. // this.ToString(),
  4172. // System.Reflection.MethodBase.GetCurrentMethod().Name,
  4173. // ex.ToString(),
  4174. // LocalPath.LogExePath);
  4175. // actionResult.Status = (int)Constant.PDAResult.Exception;
  4176. // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4177. // }
  4178. // return actionResult;
  4179. //}
  4180. /// <summary>
  4181. /// 班次配置-根据员工姓名查员工信息
  4182. /// </summary>
  4183. /// <param name="searchStaffEntity"></param>
  4184. /// <returns></returns>
  4185. public ActionResult SearchStaffInfoGet(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4186. {
  4187. ActionResult actionResult = new ActionResult();
  4188. try
  4189. {
  4190. // 验证请求头信息
  4191. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4192. // 验证失败
  4193. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4194. {
  4195. return actionResult;
  4196. }
  4197. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4198. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4199. actionResult.Result = JsonHelper.ToJson(ds);
  4200. actionResult.Status = (int)Constant.PDAResult.Success;
  4201. }
  4202. catch (Exception ex)
  4203. {
  4204. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4205. OutputLog.TraceLog(LogPriority.Error,
  4206. this.ToString(),
  4207. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4208. ex.ToString(),
  4209. LocalPath.LogExePath);
  4210. actionResult.Status = (int)Constant.PDAResult.Exception;
  4211. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4212. }
  4213. return actionResult;
  4214. }
  4215. /// <summary>
  4216. /// 获取班次配置信息
  4217. /// </summary>
  4218. /// <param name="searchEntity"></param>
  4219. /// <returns></returns>
  4220. public ActionResult SearchClassesSettingGet(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  4221. {
  4222. ActionResult actionResult = new ActionResult();
  4223. try
  4224. {
  4225. // 验证请求头信息
  4226. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4227. // 验证失败
  4228. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4229. {
  4230. return actionResult;
  4231. }
  4232. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4233. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4234. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4235. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4236. actionResult.Result = JsonHelper.ToJson(ds);
  4237. actionResult.Status = (int)Constant.PDAResult.Success;
  4238. }
  4239. catch (Exception ex)
  4240. {
  4241. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4242. OutputLog.TraceLog(LogPriority.Error,
  4243. this.ToString(),
  4244. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4245. ex.ToString(),
  4246. LocalPath.LogExePath);
  4247. actionResult.Status = (int)Constant.PDAResult.Exception;
  4248. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4249. }
  4250. return actionResult;
  4251. }
  4252. public ActionResult SaveClassesSettingGet(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4253. {
  4254. ActionResult actionResult = new ActionResult();
  4255. try
  4256. {
  4257. // 验证请求头信息
  4258. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4259. // 验证失败
  4260. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4261. {
  4262. return actionResult;
  4263. }
  4264. int returnValue = ServiceInvoker.Invoke<int>(this,
  4265. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4266. if (returnValue > 0)
  4267. {
  4268. actionResult.Result = JsonHelper.ToJson(returnValue);
  4269. actionResult.Status = (int)Constant.PDAResult.Success;
  4270. }
  4271. else
  4272. {
  4273. actionResult.Status = (int)Constant.PDAResult.Fail;
  4274. actionResult.Message = "保存失败";
  4275. }
  4276. }
  4277. catch (Exception ex)
  4278. {
  4279. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4280. OutputLog.TraceLog(LogPriority.Error,
  4281. this.ToString(),
  4282. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4283. ex.ToString(),
  4284. LocalPath.LogExePath);
  4285. actionResult.Status = (int)Constant.PDAResult.Exception;
  4286. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4287. }
  4288. return actionResult;
  4289. }
  4290. /// <summary>
  4291. /// 班次配置--获取详细信息
  4292. /// </summary>
  4293. /// <param name="searchEntity"></param>
  4294. /// <returns></returns>
  4295. public ActionResult SearchClassesDetailGet(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4296. {
  4297. ActionResult actionResult = new ActionResult();
  4298. try
  4299. {
  4300. // 验证请求头信息
  4301. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4302. // 验证失败
  4303. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4304. {
  4305. return actionResult;
  4306. }
  4307. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4308. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4309. actionResult.Result = JsonHelper.ToJson(ds);
  4310. actionResult.Status = (int)Constant.PDAResult.Success;
  4311. }
  4312. catch (Exception ex)
  4313. {
  4314. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4315. OutputLog.TraceLog(LogPriority.Error,
  4316. this.ToString(),
  4317. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4318. ex.ToString(),
  4319. LocalPath.LogExePath);
  4320. actionResult.Status = (int)Constant.PDAResult.Exception;
  4321. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4322. }
  4323. return actionResult;
  4324. }
  4325. /// <summary>
  4326. /// 获取用户是否有班次配置权限
  4327. /// </summary>
  4328. /// <param name="accountCode"></param>
  4329. /// <param name="userCode"></param>
  4330. /// <param name="userPassword"></param>
  4331. /// <param name="sessionKey"></param>
  4332. /// <returns></returns>
  4333. public ActionResult GetClassesSettingFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  4334. {
  4335. ActionResult actionResult = new ActionResult();
  4336. try
  4337. {
  4338. // 验证请求头信息
  4339. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4340. // 验证失败
  4341. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4342. {
  4343. return actionResult;
  4344. }
  4345. int returnValue = ServiceInvoker.Invoke<int>(this,
  4346. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4347. actionResult.Result = JsonHelper.ToJson(returnValue);
  4348. actionResult.Status = (int)Constant.PDAResult.Success;
  4349. }
  4350. catch (Exception ex)
  4351. {
  4352. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4353. OutputLog.TraceLog(LogPriority.Error,
  4354. this.ToString(),
  4355. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4356. ex.ToString(),
  4357. LocalPath.LogExePath);
  4358. actionResult.Status = (int)Constant.PDAResult.Exception;
  4359. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4360. }
  4361. return actionResult;
  4362. }
  4363. /// <summary>
  4364. /// 获取盘点单列表
  4365. /// </summary>
  4366. /// <param name="sUserInfo"></param>
  4367. /// <returns></returns>
  4368. public ActionResult GetAllInCheckedGet(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  4369. {
  4370. ActionResult actionResult = new ActionResult();
  4371. try
  4372. {
  4373. // 验证请求头信息
  4374. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4375. // 验证失败
  4376. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4377. {
  4378. return actionResult;
  4379. }
  4380. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4381. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4382. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4383. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4384. actionResult.Result = JsonHelper.ToJson(ds);
  4385. actionResult.Status = (int)Constant.PDAResult.Success;
  4386. }
  4387. catch (Exception ex)
  4388. {
  4389. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4390. OutputLog.TraceLog(LogPriority.Error,
  4391. this.ToString(),
  4392. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4393. ex.ToString(),
  4394. LocalPath.LogExePath);
  4395. actionResult.Status = (int)Constant.PDAResult.Exception;
  4396. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4397. }
  4398. return actionResult;
  4399. }
  4400. #endregion
  4401. #region PDA报表
  4402. /// <summary>
  4403. /// 产品质量跟踪
  4404. /// </summary>
  4405. /// <param name="accountCode"></param>
  4406. /// <param name="userCode"></param>
  4407. /// <param name="userPassword"></param>
  4408. /// <param name="sessionKey"></param>
  4409. /// <param name="se"></param>
  4410. /// <returns></returns>
  4411. public ActionResult GetRPT040104SDataGet(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4412. {
  4413. ActionResult actionResult = new ActionResult();
  4414. try
  4415. {
  4416. // 验证请求头信息
  4417. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4418. // 验证失败
  4419. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4420. {
  4421. return actionResult;
  4422. }
  4423. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4424. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4425. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4426. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4427. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4428. {
  4429. actionResult.Status = (int)Constant.PDAResult.Fail;
  4430. actionResult.Message = Messages.MSG_CMN_I002;
  4431. }
  4432. else
  4433. {
  4434. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4435. actionResult.Status = (int)Constant.PDAResult.Success;
  4436. }
  4437. }
  4438. catch (Exception ex)
  4439. {
  4440. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4441. OutputLog.TraceLog(LogPriority.Error,
  4442. this.ToString(),
  4443. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4444. ex.ToString(),
  4445. LocalPath.LogExePath);
  4446. actionResult.Status = (int)Constant.PDAResult.Exception;
  4447. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4448. }
  4449. return actionResult;
  4450. }
  4451. /// <summary>
  4452. /// 工号产量质量分析表
  4453. /// </summary>
  4454. /// <param name="accountCode"></param>
  4455. /// <param name="userCode"></param>
  4456. /// <param name="userPassword"></param>
  4457. /// <param name="sessionKey"></param>
  4458. /// <param name="se"></param>
  4459. /// <returns></returns>
  4460. public ActionResult GetFP00002DataGet(string accountCode, string userCode, string userPassword, string sessionKey,
  4461. int rptSProcedureID, string workcode, string date)
  4462. {
  4463. ActionResult actionResult = new ActionResult();
  4464. try
  4465. {
  4466. // 验证请求头信息
  4467. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4468. // 验证失败
  4469. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4470. {
  4471. return actionResult;
  4472. }
  4473. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4474. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4475. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4476. {
  4477. actionResult.Status = (int)Constant.PDAResult.Fail;
  4478. actionResult.Message = Messages.MSG_CMN_I002;
  4479. }
  4480. else
  4481. {
  4482. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4483. actionResult.Status = (int)Constant.PDAResult.Success;
  4484. }
  4485. }
  4486. catch (Exception ex)
  4487. {
  4488. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4489. OutputLog.TraceLog(LogPriority.Error,
  4490. this.ToString(),
  4491. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4492. ex.ToString(),
  4493. LocalPath.LogExePath);
  4494. actionResult.Status = (int)Constant.PDAResult.Exception;
  4495. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4496. }
  4497. return actionResult;
  4498. }
  4499. /// <summary>
  4500. /// 半检数据统计表
  4501. /// </summary>
  4502. /// <param name="accountCode"></param>
  4503. /// <param name="userCode"></param>
  4504. /// <param name="userPassword"></param>
  4505. /// <param name="sessionKey"></param>
  4506. /// <param name="se"></param>
  4507. /// <returns></returns>
  4508. public ActionResult GetPDARPT000001DataGet(string accountCode, string userCode, string userPassword, string sessionKey,
  4509. string workcode, string datebegin, string dateend)
  4510. {
  4511. ActionResult actionResult = new ActionResult();
  4512. try
  4513. {
  4514. // 验证请求头信息
  4515. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4516. // 验证失败
  4517. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4518. {
  4519. return actionResult;
  4520. }
  4521. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4522. DateTime datetimeend = Convert.ToDateTime(dateend);
  4523. datetimebegin = datetimebegin.Date;
  4524. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4525. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4526. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4527. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4528. {
  4529. actionResult.Status = (int)Constant.PDAResult.Fail;
  4530. actionResult.Message = Messages.MSG_CMN_I002;
  4531. }
  4532. else
  4533. {
  4534. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4535. actionResult.Status = (int)Constant.PDAResult.Success;
  4536. }
  4537. }
  4538. catch (Exception ex)
  4539. {
  4540. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4541. OutputLog.TraceLog(LogPriority.Error,
  4542. this.ToString(),
  4543. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4544. ex.ToString(),
  4545. LocalPath.LogExePath);
  4546. actionResult.Status = (int)Constant.PDAResult.Exception;
  4547. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4548. }
  4549. return actionResult;
  4550. }
  4551. /// <summary>
  4552. /// 工号质量统计表
  4553. /// </summary>
  4554. /// <param name="accountCode"></param>
  4555. /// <param name="userCode"></param>
  4556. /// <param name="userPassword"></param>
  4557. /// <param name="sessionKey"></param>
  4558. /// <param name="se"></param>
  4559. /// <returns></returns>
  4560. public ActionResult GetPDARPT000002DataGet(string accountCode, string userCode, string userPassword, string sessionKey,
  4561. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4562. {
  4563. ActionResult actionResult = new ActionResult();
  4564. try
  4565. {
  4566. // 验证请求头信息
  4567. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4568. // 验证失败
  4569. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4570. {
  4571. return actionResult;
  4572. }
  4573. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4574. DateTime datetimeend = Convert.ToDateTime(dateend);
  4575. datetimebegin = datetimebegin.Date;
  4576. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4577. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4578. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4579. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4580. {
  4581. actionResult.Status = (int)Constant.PDAResult.Fail;
  4582. actionResult.Message = Messages.MSG_CMN_I002;
  4583. }
  4584. else
  4585. {
  4586. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4587. actionResult.Status = (int)Constant.PDAResult.Success;
  4588. }
  4589. }
  4590. catch (Exception ex)
  4591. {
  4592. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4593. OutputLog.TraceLog(LogPriority.Error,
  4594. this.ToString(),
  4595. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4596. ex.ToString(),
  4597. LocalPath.LogExePath);
  4598. actionResult.Status = (int)Constant.PDAResult.Exception;
  4599. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4600. }
  4601. return actionResult;
  4602. }
  4603. /// <summary>
  4604. /// 损坯数据统计表
  4605. /// </summary>
  4606. /// <param name="accountCode"></param>
  4607. /// <param name="userCode"></param>
  4608. /// <param name="userPassword"></param>
  4609. /// <param name="sessionKey"></param>
  4610. /// <param name="se"></param>
  4611. /// <returns></returns>
  4612. public ActionResult GetPDARPT000003DataGet(string accountCode, string userCode, string userPassword, string sessionKey,
  4613. string workcode, string datebegin, string dateend)
  4614. {
  4615. ActionResult actionResult = new ActionResult();
  4616. try
  4617. {
  4618. // 验证请求头信息
  4619. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4620. // 验证失败
  4621. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4622. {
  4623. return actionResult;
  4624. }
  4625. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4626. DateTime datetimeend = Convert.ToDateTime(dateend);
  4627. datetimebegin = datetimebegin.Date;
  4628. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4629. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4630. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4631. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4632. {
  4633. actionResult.Status = (int)Constant.PDAResult.Fail;
  4634. actionResult.Message = Messages.MSG_CMN_I002;
  4635. }
  4636. else
  4637. {
  4638. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4639. actionResult.Status = (int)Constant.PDAResult.Success;
  4640. }
  4641. }
  4642. catch (Exception ex)
  4643. {
  4644. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4645. OutputLog.TraceLog(LogPriority.Error,
  4646. this.ToString(),
  4647. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4648. ex.ToString(),
  4649. LocalPath.LogExePath);
  4650. actionResult.Status = (int)Constant.PDAResult.Exception;
  4651. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4652. }
  4653. return actionResult;
  4654. }
  4655. #endregion
  4656. /// <summary>
  4657. /// 取得报表数据源数据
  4658. /// </summary>
  4659. /// <param name="accountCode"></param>
  4660. /// <param name="userCode"></param>
  4661. /// <param name="userPassword"></param>
  4662. /// <param name="sessionKey"></param>
  4663. /// <returns></returns>
  4664. public ActionResult GetRptProcedureModuleGet(string accountCode, string userCode, string userPassword, string sessionKey)
  4665. {
  4666. ActionResult actionResult = new ActionResult();
  4667. try
  4668. {
  4669. // 验证请求头信息
  4670. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4671. // 验证失败
  4672. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4673. {
  4674. return actionResult;
  4675. }
  4676. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4677. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4678. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4679. {
  4680. actionResult.Status = (int)Constant.PDAResult.Fail;
  4681. actionResult.Message = Messages.MSG_CMN_I002;
  4682. }
  4683. else
  4684. {
  4685. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4686. actionResult.Status = (int)Constant.PDAResult.Success;
  4687. }
  4688. }
  4689. catch (Exception ex)
  4690. {
  4691. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4692. OutputLog.TraceLog(LogPriority.Error,
  4693. this.ToString(),
  4694. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4695. ex.ToString(),
  4696. LocalPath.LogExePath);
  4697. actionResult.Status = (int)Constant.PDAResult.Exception;
  4698. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4699. }
  4700. return actionResult;
  4701. }
  4702. /// <summary>
  4703. /// 取得报表的查询数据源统计工序数据
  4704. /// </summary>
  4705. /// <param name="accountCode"></param>
  4706. /// <param name="userCode"></param>
  4707. /// <param name="userPassword"></param>
  4708. /// <param name="sessionKey"></param>
  4709. /// <param name="RptProcedureID"></param>
  4710. /// <returns></returns>
  4711. public ActionResult GetRptSourceProcedureModuleGet(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  4712. {
  4713. ActionResult actionResult = new ActionResult();
  4714. try
  4715. {
  4716. // 验证请求头信息
  4717. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4718. // 验证失败
  4719. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4720. {
  4721. return actionResult;
  4722. }
  4723. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4724. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  4725. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4726. {
  4727. actionResult.Status = (int)Constant.PDAResult.Fail;
  4728. actionResult.Message = Messages.MSG_CMN_I002;
  4729. }
  4730. else
  4731. {
  4732. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4733. actionResult.Status = (int)Constant.PDAResult.Success;
  4734. }
  4735. }
  4736. catch (Exception ex)
  4737. {
  4738. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4739. OutputLog.TraceLog(LogPriority.Error,
  4740. this.ToString(),
  4741. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4742. ex.ToString(),
  4743. LocalPath.LogExePath);
  4744. actionResult.Status = (int)Constant.PDAResult.Exception;
  4745. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4746. }
  4747. return actionResult;
  4748. }
  4749. /// <summary>
  4750. /// 获取用户是否有统计产成品权限
  4751. /// </summary>
  4752. /// <param name="accountCode"></param>
  4753. /// <param name="userCode"></param>
  4754. /// <param name="userPassword"></param>
  4755. /// <param name="sessionKey"></param>
  4756. /// <returns></returns>
  4757. public ActionResult GetStatisticsFinishedProductFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  4758. {
  4759. ActionResult actionResult = new ActionResult();
  4760. try
  4761. {
  4762. // 验证请求头信息
  4763. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4764. // 验证失败
  4765. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4766. {
  4767. return actionResult;
  4768. }
  4769. int returnValue = ServiceInvoker.Invoke<int>(this,
  4770. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  4771. actionResult.Result = JsonHelper.ToJson(returnValue);
  4772. actionResult.Status = (int)Constant.PDAResult.Success;
  4773. }
  4774. catch (Exception ex)
  4775. {
  4776. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4777. OutputLog.TraceLog(LogPriority.Error,
  4778. this.ToString(),
  4779. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4780. ex.ToString(),
  4781. LocalPath.LogExePath);
  4782. actionResult.Status = (int)Constant.PDAResult.Exception;
  4783. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4784. }
  4785. return actionResult;
  4786. }
  4787. /// <summary>
  4788. /// 获取用户是否有盘点权限
  4789. /// </summary>
  4790. /// <param name="accountCode"></param>
  4791. /// <param name="userCode"></param>
  4792. /// <param name="userPassword"></param>
  4793. /// <param name="sessionKey"></param>
  4794. /// <returns></returns>
  4795. public ActionResult GetInCheckedFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  4796. {
  4797. ActionResult actionResult = new ActionResult();
  4798. try
  4799. {
  4800. // 验证请求头信息
  4801. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4802. // 验证失败
  4803. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4804. {
  4805. return actionResult;
  4806. }
  4807. int returnValue = ServiceInvoker.Invoke<int>(this,
  4808. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  4809. actionResult.Result = JsonHelper.ToJson(returnValue);
  4810. actionResult.Status = (int)Constant.PDAResult.Success;
  4811. }
  4812. catch (Exception ex)
  4813. {
  4814. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4815. OutputLog.TraceLog(LogPriority.Error,
  4816. this.ToString(),
  4817. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4818. ex.ToString(),
  4819. LocalPath.LogExePath);
  4820. actionResult.Status = (int)Constant.PDAResult.Exception;
  4821. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4822. }
  4823. return actionResult;
  4824. }
  4825. /// <summary>
  4826. /// 根据条件查询是否存在班次配置
  4827. /// </summary>
  4828. /// <param name="accountCode"></param>
  4829. /// <param name="userCode"></param>
  4830. /// <param name="userPassword"></param>
  4831. /// <param name="sessionKey"></param>
  4832. /// <param name="userCode">工号编码</param>
  4833. /// <returns></returns>
  4834. public ActionResult GetClassesSettingGet(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  4835. {
  4836. ActionResult actionResult = new ActionResult();
  4837. try
  4838. {
  4839. // 验证请求头信息
  4840. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4841. // 验证失败
  4842. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4843. {
  4844. return actionResult;
  4845. }
  4846. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4847. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  4848. actionResult.Result = JsonHelper.ToJson(ds);
  4849. actionResult.Status = (int)Constant.PDAResult.Success;
  4850. }
  4851. catch (Exception ex)
  4852. {
  4853. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4854. OutputLog.TraceLog(LogPriority.Error,
  4855. this.ToString(),
  4856. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4857. ex.ToString(),
  4858. LocalPath.LogExePath);
  4859. actionResult.Status = (int)Constant.PDAResult.Exception;
  4860. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4861. }
  4862. return actionResult;
  4863. }
  4864. /// <summary>
  4865. /// 报损工序查出工号根据生产数据ID
  4866. /// </summary>
  4867. /// <param name="accountCode"></param>
  4868. /// <param name="userCode"></param>
  4869. /// <param name="userPassword"></param>
  4870. /// <param name="sessionKey"></param>
  4871. /// <param name="ProductionDataID">生产数据ID</param>
  4872. /// <returns></returns>
  4873. public ActionResult GetScrapProductUserCodeByProductionDataIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  4874. {
  4875. ActionResult actionResult = new ActionResult();
  4876. try
  4877. {
  4878. // 验证请求头信息
  4879. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4880. // 验证失败
  4881. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4882. {
  4883. return actionResult;
  4884. }
  4885. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  4886. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  4887. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  4888. {
  4889. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  4890. actionResult.Status = (int)Constant.PDAResult.Success;
  4891. }
  4892. else
  4893. {
  4894. actionResult.Status = (int)Constant.PDAResult.Fail;
  4895. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  4896. }
  4897. }
  4898. catch (Exception ex)
  4899. {
  4900. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4901. OutputLog.TraceLog(LogPriority.Error,
  4902. this.ToString(),
  4903. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4904. ex.ToString(),
  4905. LocalPath.LogExePath);
  4906. actionResult.Status = (int)Constant.PDAResult.Exception;
  4907. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4908. }
  4909. return actionResult;
  4910. }
  4911. /// <summary>
  4912. /// 在入窑工序检验窑车号是否存在
  4913. /// </summary>
  4914. /// <param name="accountCode"></param>
  4915. /// <param name="userCode"></param>
  4916. /// <param name="userPassword"></param>
  4917. /// <param name="sessionKey"></param>
  4918. /// <param name="kilncarcode">窑车编码</param>
  4919. /// <param name="procedureid">工序ID</param>
  4920. /// <returns></returns>
  4921. public ActionResult CheckKilnCarByIntoCar2Get(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4922. {
  4923. ActionResult actionResult = new ActionResult();
  4924. try
  4925. {
  4926. // 验证请求头信息
  4927. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4928. // 验证失败
  4929. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4930. {
  4931. return actionResult;
  4932. }
  4933. int returnValue = ServiceInvoker.Invoke<int>(this,
  4934. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  4935. if (returnValue == 1)
  4936. {
  4937. actionResult.Result = JsonHelper.ToJson(returnValue);
  4938. actionResult.Status = (int)Constant.PDAResult.Success;
  4939. }
  4940. else
  4941. {
  4942. actionResult.Status = (int)Constant.PDAResult.Fail;
  4943. if (returnValue == -99)
  4944. actionResult.Message = "窑炉车号无效";
  4945. else if (returnValue == -98)
  4946. actionResult.Message = "窑车己无产品";
  4947. else if (returnValue == -97)
  4948. actionResult.Message = "窑车没有入窑,不可以撤销";
  4949. else if (returnValue == -1)
  4950. actionResult.Message = "保存失败";
  4951. }
  4952. }
  4953. catch (Exception ex)
  4954. {
  4955. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4956. OutputLog.TraceLog(LogPriority.Error,
  4957. this.ToString(),
  4958. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4959. ex.ToString(),
  4960. LocalPath.LogExePath);
  4961. actionResult.Status = (int)Constant.PDAResult.Exception;
  4962. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4963. }
  4964. return actionResult;
  4965. }
  4966. /// <summary>
  4967. /// 撤销包装
  4968. /// </summary>
  4969. /// <param name="accountCode"></param>
  4970. /// <param name="userCode"></param>
  4971. /// <param name="userPassword"></param>
  4972. /// <param name="sessionKey"></param>
  4973. /// <param name="barcode"></param>
  4974. /// <returns></returns>
  4975. public ActionResult AddChancelFinishedproductGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  4976. {
  4977. ActionResult actionResult = new ActionResult();
  4978. try
  4979. {
  4980. // 验证请求头信息
  4981. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4982. // 验证失败
  4983. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4984. {
  4985. return actionResult;
  4986. }
  4987. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4988. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  4989. if (Convert.ToInt32(returnValue.Result) > 0)
  4990. {
  4991. actionResult.Result = JsonHelper.ToJson(returnValue);
  4992. actionResult.Status = (int)Constant.PDAResult.Success;
  4993. }
  4994. else
  4995. {
  4996. actionResult.Status = (int)Constant.PDAResult.Fail;
  4997. if (Convert.ToInt32(returnValue.Result) == -1)
  4998. actionResult.Message = "产品条码不存在包装记录";
  4999. else if (Convert.ToInt32(returnValue.Result) == -200)
  5000. actionResult.Message = returnValue.Message;
  5001. else
  5002. actionResult.Message = "成品撤销失败";
  5003. }
  5004. }
  5005. catch (Exception ex)
  5006. {
  5007. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5008. OutputLog.TraceLog(LogPriority.Error,
  5009. this.ToString(),
  5010. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5011. ex.ToString(),
  5012. LocalPath.LogExePath);
  5013. actionResult.Status = (int)Constant.PDAResult.Exception;
  5014. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5015. }
  5016. return actionResult;
  5017. }
  5018. /*
  5019. /// <summary>
  5020. /// 获取用户是否有撤销包装权限
  5021. /// </summary>
  5022. /// <param name="accountCode"></param>
  5023. /// <param name="userCode"></param>
  5024. /// <param name="userPassword"></param>
  5025. /// <param name="sessionKey"></param>
  5026. /// <returns></returns>
  5027. public ActionResult GetChancelFinishedproductFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5028. {
  5029. ActionResult actionResult = new ActionResult();
  5030. try
  5031. {
  5032. // 验证请求头信息
  5033. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5034. // 验证失败
  5035. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5036. {
  5037. return actionResult;
  5038. }
  5039. int returnValue = ServiceInvoker.Invoke<int>(this,
  5040. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5041. actionResult.Result = JsonHelper.ToJson(returnValue);
  5042. actionResult.Status = (int)Constant.PDAResult.Success;
  5043. }
  5044. catch (Exception ex)
  5045. {
  5046. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5047. OutputLog.TraceLog(LogPriority.Error,
  5048. this.ToString(),
  5049. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5050. ex.ToString(),
  5051. LocalPath.LogExePath);
  5052. actionResult.Status = (int)Constant.PDAResult.Exception;
  5053. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5054. }
  5055. return actionResult;
  5056. }
  5057. */
  5058. /// <summary>
  5059. /// 窑车状态明细表查询
  5060. /// </summary>
  5061. /// <param name="accountCode"></param>
  5062. /// <param name="userCode"></param>
  5063. /// <param name="userPassword"></param>
  5064. /// <param name="sessionKey"></param>
  5065. /// <param name="kilnCarCode"></param>
  5066. /// <returns></returns>
  5067. public ActionResult GetKilnCarStatusDetailByCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5068. {
  5069. ActionResult actionResult = new ActionResult();
  5070. try
  5071. {
  5072. // 验证请求头信息
  5073. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5074. // 验证失败
  5075. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5076. {
  5077. return actionResult;
  5078. }
  5079. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5080. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5081. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5082. {
  5083. actionResult.Status = (int)Constant.PDAResult.Fail;
  5084. actionResult.Message = Messages.MSG_CMN_I002;
  5085. }
  5086. else
  5087. {
  5088. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5089. actionResult.Status = (int)Constant.PDAResult.Success;
  5090. }
  5091. }
  5092. catch (Exception ex)
  5093. {
  5094. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5095. OutputLog.TraceLog(LogPriority.Error,
  5096. this.ToString(),
  5097. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5098. ex.ToString(),
  5099. LocalPath.LogExePath);
  5100. actionResult.Status = (int)Constant.PDAResult.Exception;
  5101. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5102. }
  5103. return actionResult;
  5104. }
  5105. /// <summary>
  5106. /// 损坯撤销
  5107. /// </summary>
  5108. /// <param name="accountCode"></param>
  5109. /// <param name="userCode"></param>
  5110. /// <param name="userPassword"></param>
  5111. /// <param name="sessionKey"></param>
  5112. /// <param name="barcode"></param>
  5113. /// <returns></returns>
  5114. public ActionResult AddCancelScrapProductionGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5115. {
  5116. ActionResult actionResult = new ActionResult();
  5117. try
  5118. {
  5119. // 验证请求头信息
  5120. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5121. // 验证失败
  5122. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5123. {
  5124. return actionResult;
  5125. }
  5126. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5127. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5128. if (Convert.ToInt32(returnValue.Result) > 0)
  5129. {
  5130. actionResult.Result = JsonHelper.ToJson(returnValue);
  5131. actionResult.Status = (int)Constant.PDAResult.Success;
  5132. }
  5133. else
  5134. {
  5135. actionResult.Status = (int)Constant.PDAResult.Fail;
  5136. if (Convert.ToInt32(returnValue.Result) == -1)
  5137. actionResult.Message = "此产品没有损坯,不能撤销";
  5138. else if (Convert.ToInt32(returnValue.Result) == -200)
  5139. actionResult.Message = returnValue.Message;
  5140. else
  5141. actionResult.Message = "损坯撤销失败";
  5142. }
  5143. }
  5144. catch (Exception ex)
  5145. {
  5146. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5147. OutputLog.TraceLog(LogPriority.Error,
  5148. this.ToString(),
  5149. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5150. ex.ToString(),
  5151. LocalPath.LogExePath);
  5152. actionResult.Status = (int)Constant.PDAResult.Exception;
  5153. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5154. }
  5155. return actionResult;
  5156. }
  5157. /*
  5158. /// <summary>
  5159. /// 获取用户是否有损坯撤销权限
  5160. /// </summary>
  5161. /// <param name="accountCode"></param>
  5162. /// <param name="userCode"></param>
  5163. /// <param name="userPassword"></param>
  5164. /// <param name="sessionKey"></param>
  5165. /// <returns></returns>
  5166. public ActionResult GetCancelScrapProductionFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5167. {
  5168. ActionResult actionResult = new ActionResult();
  5169. try
  5170. {
  5171. // 验证请求头信息
  5172. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5173. // 验证失败
  5174. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5175. {
  5176. return actionResult;
  5177. }
  5178. int returnValue = ServiceInvoker.Invoke<int>(this,
  5179. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5180. actionResult.Result = JsonHelper.ToJson(returnValue);
  5181. actionResult.Status = (int)Constant.PDAResult.Success;
  5182. }
  5183. catch (Exception ex)
  5184. {
  5185. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5186. OutputLog.TraceLog(LogPriority.Error,
  5187. this.ToString(),
  5188. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5189. ex.ToString(),
  5190. LocalPath.LogExePath);
  5191. actionResult.Status = (int)Constant.PDAResult.Exception;
  5192. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5193. }
  5194. return actionResult;
  5195. }
  5196. */
  5197. /// <summary>
  5198. /// 获取条码注浆信息
  5199. /// </summary>
  5200. /// <param name="accountCode"></param>
  5201. /// <param name="userCode"></param>
  5202. /// <param name="userPassword"></param>
  5203. /// <param name="sessionKey"></param>
  5204. /// <returns></returns>
  5205. public ActionResult GetGroutingInfoBybarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5206. {
  5207. ActionResult actionResult = new ActionResult();
  5208. try
  5209. {
  5210. // 验证请求头信息
  5211. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5212. // 验证失败
  5213. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5214. {
  5215. return actionResult;
  5216. }
  5217. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5218. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5219. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5220. {
  5221. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5222. actionResult.Status = (int)Constant.PDAResult.Success;
  5223. }
  5224. else
  5225. {
  5226. actionResult.Status = (int)Constant.PDAResult.Fail;
  5227. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5228. }
  5229. }
  5230. catch (Exception ex)
  5231. {
  5232. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5233. OutputLog.TraceLog(LogPriority.Error,
  5234. this.ToString(),
  5235. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5236. ex.ToString(),
  5237. LocalPath.LogExePath);
  5238. actionResult.Status = (int)Constant.PDAResult.Exception;
  5239. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5240. }
  5241. return actionResult;
  5242. }
  5243. /// <summary>
  5244. /// 获取条码注浆信息
  5245. /// </summary>
  5246. /// <param name="accountCode"></param>
  5247. /// <param name="userCode"></param>
  5248. /// <param name="userPassword"></param>
  5249. /// <param name="sessionKey"></param>
  5250. /// <returns></returns>
  5251. public ActionResult GetFinishedProductGroutingInfoBybarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5252. {
  5253. ActionResult actionResult = new ActionResult();
  5254. try
  5255. {
  5256. // 验证请求头信息
  5257. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5258. // 验证失败
  5259. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5260. {
  5261. return actionResult;
  5262. }
  5263. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5264. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5265. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5266. {
  5267. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5268. actionResult.Status = (int)Constant.PDAResult.Success;
  5269. }
  5270. else
  5271. {
  5272. actionResult.Status = (int)Constant.PDAResult.Fail;
  5273. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5274. }
  5275. }
  5276. catch (Exception ex)
  5277. {
  5278. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5279. OutputLog.TraceLog(LogPriority.Error,
  5280. this.ToString(),
  5281. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5282. ex.ToString(),
  5283. LocalPath.LogExePath);
  5284. actionResult.Status = (int)Constant.PDAResult.Exception;
  5285. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5286. }
  5287. return actionResult;
  5288. }
  5289. /// <summary>
  5290. /// 公坯设定
  5291. /// </summary>
  5292. /// <param name="accountCode"></param>
  5293. /// <param name="userCode"></param>
  5294. /// <param name="userPassword"></param>
  5295. /// <param name="sessionKey"></param>
  5296. /// <param name="barcode"></param>
  5297. /// <returns></returns>
  5298. public ActionResult AddPublicBodyProductGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5299. {
  5300. ActionResult actionResult = new ActionResult();
  5301. try
  5302. {
  5303. // 验证请求头信息
  5304. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5305. // 验证失败
  5306. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5307. {
  5308. return actionResult;
  5309. }
  5310. int returnValue = ServiceInvoker.Invoke<int>(this,
  5311. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5312. if (returnValue > 0)
  5313. {
  5314. actionResult.Result = JsonHelper.ToJson(returnValue);
  5315. actionResult.Status = (int)Constant.PDAResult.Success;
  5316. }
  5317. else
  5318. {
  5319. actionResult.Status = (int)Constant.PDAResult.Fail;
  5320. if (returnValue == -1)
  5321. actionResult.Message = "此产品不在生产线上";
  5322. else if (returnValue == -2)
  5323. actionResult.Message = "该产品已经标识为公坯";
  5324. else
  5325. actionResult.Message = "公坯设定失败";
  5326. }
  5327. }
  5328. catch (Exception ex)
  5329. {
  5330. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5331. OutputLog.TraceLog(LogPriority.Error,
  5332. this.ToString(),
  5333. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5334. ex.ToString(),
  5335. LocalPath.LogExePath);
  5336. actionResult.Status = (int)Constant.PDAResult.Exception;
  5337. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5338. }
  5339. return actionResult;
  5340. }
  5341. /*
  5342. /// <summary>
  5343. /// 获取用户是否有公坯设定
  5344. /// </summary>
  5345. /// <param name="accountCode"></param>
  5346. /// <param name="userCode"></param>
  5347. /// <param name="userPassword"></param>
  5348. /// <param name="sessionKey"></param>
  5349. /// <returns></returns>
  5350. public ActionResult GetPublicBodyProductFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5351. {
  5352. ActionResult actionResult = new ActionResult();
  5353. try
  5354. {
  5355. // 验证请求头信息
  5356. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5357. // 验证失败
  5358. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5359. {
  5360. return actionResult;
  5361. }
  5362. int returnValue = ServiceInvoker.Invoke<int>(this,
  5363. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5364. actionResult.Result = JsonHelper.ToJson(returnValue);
  5365. actionResult.Status = (int)Constant.PDAResult.Success;
  5366. }
  5367. catch (Exception ex)
  5368. {
  5369. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5370. OutputLog.TraceLog(LogPriority.Error,
  5371. this.ToString(),
  5372. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5373. ex.ToString(),
  5374. LocalPath.LogExePath);
  5375. actionResult.Status = (int)Constant.PDAResult.Exception;
  5376. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5377. }
  5378. return actionResult;
  5379. }
  5380. */
  5381. /// <summary>
  5382. /// 校验产品条码是否可以走到该工序
  5383. /// </summary>
  5384. /// <param name="accountCode">帐套code</param>
  5385. /// <param name="userCode">用户code</param>
  5386. /// <param name="userPassword">用户密码</param>
  5387. /// <param name="sessionKey">本次登陆密钥</param>
  5388. /// <param name="procedureID">工序ID</param>
  5389. /// <param name="barcode">条码</param>
  5390. /// <returns></returns>
  5391. /// <remarks>
  5392. /// 陈冰 2014.09.18 新建
  5393. /// </remarks>
  5394. public ActionResult CheckBarcodeDeliverMudGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5395. {
  5396. ActionResult actionResult = new ActionResult();
  5397. try
  5398. {
  5399. // 验证请求头信息
  5400. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5401. // 验证失败
  5402. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5403. {
  5404. return actionResult;
  5405. }
  5406. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5407. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5408. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5409. {
  5410. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5411. actionResult.Status = (int)Constant.PDAResult.Success;
  5412. }
  5413. else
  5414. {
  5415. actionResult.Status = (int)Constant.PDAResult.Fail;
  5416. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5417. }
  5418. }
  5419. catch (Exception ex)
  5420. {
  5421. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5422. OutputLog.TraceLog(LogPriority.Error,
  5423. this.ToString(),
  5424. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5425. ex.ToString(),
  5426. LocalPath.LogExePath);
  5427. actionResult.Status = (int)Constant.PDAResult.Exception;
  5428. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5429. }
  5430. return actionResult;
  5431. }
  5432. /// <summary>
  5433. /// 获取用户所有菜单权限
  5434. /// </summary>
  5435. /// <param name="accountCode"></param>
  5436. /// <param name="userCode"></param>
  5437. /// <param name="userPassword"></param>
  5438. /// <param name="sessionKey"></param>
  5439. /// <returns></returns>
  5440. public ActionResult GetUserAllFunctionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5441. {
  5442. ActionResult actionResult = new ActionResult();
  5443. try
  5444. {
  5445. // 验证请求头信息
  5446. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5447. // 验证失败
  5448. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5449. {
  5450. return actionResult;
  5451. }
  5452. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5453. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5454. actionResult.Result = JsonHelper.ToJson(returnValue);
  5455. actionResult.Status = (int)Constant.PDAResult.Success;
  5456. }
  5457. catch (Exception ex)
  5458. {
  5459. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5460. OutputLog.TraceLog(LogPriority.Error,
  5461. this.ToString(),
  5462. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5463. ex.ToString(),
  5464. LocalPath.LogExePath);
  5465. actionResult.Status = (int)Constant.PDAResult.Exception;
  5466. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5467. }
  5468. return actionResult;
  5469. }
  5470. public ActionResult AddChancelBarCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5471. {
  5472. ActionResult actionResult = new ActionResult();
  5473. try
  5474. {
  5475. // 验证请求头信息
  5476. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5477. // 验证失败
  5478. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5479. {
  5480. return actionResult;
  5481. }
  5482. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5483. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5484. if (Convert.ToInt32(returnValue.Result) > 0)
  5485. {
  5486. actionResult.Result = JsonHelper.ToJson(returnValue);
  5487. actionResult.Status = (int)Constant.PDAResult.Success;
  5488. }
  5489. else
  5490. {
  5491. actionResult.Status = (int)Constant.PDAResult.Fail;
  5492. if (Convert.ToInt32(returnValue.Result) == -1)
  5493. actionResult.Message = "无效条码";
  5494. else if (Convert.ToInt32(returnValue.Result) == -2)
  5495. actionResult.Message = "已经生产完成";
  5496. else if (Convert.ToInt32(returnValue.Result) == -3)
  5497. actionResult.Message = "条码已经申请报废";
  5498. else if (Convert.ToInt32(returnValue.Result) == -4)
  5499. actionResult.Message = "此条码当前工序不允许进行撤销";
  5500. else if (Convert.ToInt32(returnValue.Result) == -5)
  5501. actionResult.Message = "此条码没有生产数据";
  5502. else if (Convert.ToInt32(returnValue.Result) == -6)
  5503. actionResult.Message = "没有当前工序权限";
  5504. else if (Convert.ToInt32(returnValue.Result) == -7)
  5505. actionResult.Message = "条码不在生产线上";
  5506. else if (Convert.ToInt32(returnValue.Result) == -8)
  5507. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5508. else if (Convert.ToInt32(returnValue.Result) == -9)
  5509. actionResult.Message = "条码已经是返工状态";
  5510. else if (Convert.ToInt32(returnValue.Result) == -200)
  5511. actionResult.Message = returnValue.Message;
  5512. }
  5513. }
  5514. catch (Exception ex)
  5515. {
  5516. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5517. OutputLog.TraceLog(LogPriority.Error,
  5518. this.ToString(),
  5519. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5520. ex.ToString(),
  5521. LocalPath.LogExePath);
  5522. actionResult.Status = (int)Constant.PDAResult.Exception;
  5523. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5524. }
  5525. return actionResult;
  5526. }
  5527. public ActionResult AddChancelDeliverMudBarCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5528. {
  5529. ActionResult actionResult = new ActionResult();
  5530. try
  5531. {
  5532. // 验证请求头信息
  5533. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5534. // 验证失败
  5535. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5536. {
  5537. return actionResult;
  5538. }
  5539. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5540. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5541. if (Convert.ToInt32(returnValue.Result) > 0)
  5542. {
  5543. actionResult.Result = JsonHelper.ToJson(returnValue);
  5544. actionResult.Status = (int)Constant.PDAResult.Success;
  5545. }
  5546. else
  5547. {
  5548. actionResult.Status = (int)Constant.PDAResult.Fail;
  5549. if (Convert.ToInt32(returnValue.Result) == -1)
  5550. actionResult.Message = "无效条码";
  5551. else if (Convert.ToInt32(returnValue.Result) == -2)
  5552. actionResult.Message = "已经生产完成";
  5553. else if (Convert.ToInt32(returnValue.Result) == -3)
  5554. actionResult.Message = "条码已经申请报废";
  5555. else if (Convert.ToInt32(returnValue.Result) == -4)
  5556. actionResult.Message = "此条码当前工序不允许进行撤销";
  5557. else if (Convert.ToInt32(returnValue.Result) == -5)
  5558. actionResult.Message = "此条码没有生产数据";
  5559. else if (Convert.ToInt32(returnValue.Result) == -55)
  5560. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5561. else if (Convert.ToInt32(returnValue.Result) == -6)
  5562. actionResult.Message = "没有任何影响行";
  5563. else if (Convert.ToInt32(returnValue.Result) == -7)
  5564. actionResult.Message = "条码不在生产线上";
  5565. else if (Convert.ToInt32(returnValue.Result) == -8)
  5566. actionResult.Message = "条码已经是返工状态";
  5567. else if (Convert.ToInt32(returnValue.Result) == -200)
  5568. actionResult.Message = returnValue.Message;
  5569. }
  5570. }
  5571. catch (Exception ex)
  5572. {
  5573. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5574. OutputLog.TraceLog(LogPriority.Error,
  5575. this.ToString(),
  5576. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5577. ex.ToString(),
  5578. LocalPath.LogExePath);
  5579. actionResult.Status = (int)Constant.PDAResult.Exception;
  5580. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5581. }
  5582. return actionResult;
  5583. }
  5584. public ActionResult GetAllLogoInfoGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5585. {
  5586. ActionResult actionResult = new ActionResult();
  5587. try
  5588. {
  5589. // 验证请求头信息
  5590. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5591. // 验证失败
  5592. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5593. {
  5594. return actionResult;
  5595. }
  5596. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5597. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5598. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5599. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5600. {
  5601. //DataView dv = returnValue.Tables[0].DefaultView;
  5602. //dv.RowFilter = "ValueFlag=1";
  5603. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5604. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5605. actionResult.Status = (int)Constant.PDAResult.Success;
  5606. }
  5607. }
  5608. catch (Exception ex)
  5609. {
  5610. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5611. OutputLog.TraceLog(LogPriority.Error,
  5612. this.ToString(),
  5613. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5614. ex.ToString(),
  5615. LocalPath.LogExePath);
  5616. actionResult.Status = (int)Constant.PDAResult.Exception;
  5617. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5618. }
  5619. return actionResult;
  5620. }
  5621. public ActionResult GetLogoIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5622. {
  5623. ActionResult actionResult = new ActionResult();
  5624. try
  5625. {
  5626. // 验证请求头信息
  5627. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5628. // 验证失败
  5629. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5630. {
  5631. return actionResult;
  5632. }
  5633. int returnValue = ServiceInvoker.Invoke<int>(this,
  5634. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5635. actionResult.Result = JsonHelper.ToJson(returnValue);
  5636. actionResult.Status = (int)Constant.PDAResult.Success;
  5637. }
  5638. catch (Exception ex)
  5639. {
  5640. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5641. OutputLog.TraceLog(LogPriority.Error,
  5642. this.ToString(),
  5643. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5644. ex.ToString(),
  5645. LocalPath.LogExePath);
  5646. actionResult.Status = (int)Constant.PDAResult.Exception;
  5647. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5648. }
  5649. return actionResult;
  5650. }
  5651. public ActionResult SaveBarCodeLogoGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  5652. {
  5653. ActionResult actionResult = new ActionResult();
  5654. try
  5655. {
  5656. // 验证请求头信息
  5657. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5658. // 验证失败
  5659. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5660. {
  5661. return actionResult;
  5662. }
  5663. int returnValue = ServiceInvoker.Invoke<int>(this,
  5664. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo));
  5665. actionResult.Result = JsonHelper.ToJson(returnValue);
  5666. actionResult.Status = (int)Constant.PDAResult.Success;
  5667. }
  5668. catch (Exception ex)
  5669. {
  5670. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5671. OutputLog.TraceLog(LogPriority.Error,
  5672. this.ToString(),
  5673. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5674. ex.ToString(),
  5675. LocalPath.LogExePath);
  5676. actionResult.Status = (int)Constant.PDAResult.Exception;
  5677. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5678. }
  5679. return actionResult;
  5680. }
  5681. public ActionResult GetBarCodeLogoIDGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5682. {
  5683. ActionResult actionResult = new ActionResult();
  5684. try
  5685. {
  5686. // 验证请求头信息
  5687. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5688. // 验证失败
  5689. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5690. {
  5691. return actionResult;
  5692. }
  5693. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5694. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  5695. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5696. {
  5697. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5698. actionResult.Status = (int)Constant.PDAResult.Success;
  5699. }
  5700. }
  5701. catch (Exception ex)
  5702. {
  5703. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5704. OutputLog.TraceLog(LogPriority.Error,
  5705. this.ToString(),
  5706. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5707. ex.ToString(),
  5708. LocalPath.LogExePath);
  5709. actionResult.Status = (int)Constant.PDAResult.Exception;
  5710. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5711. }
  5712. return actionResult;
  5713. }
  5714. /// <summary>
  5715. /// 半检时,入窑前检验获取此条码是否报损为废品
  5716. /// </summary>
  5717. /// <param name="accountCode"></param>
  5718. /// <param name="userCode"></param>
  5719. /// <param name="userPassword"></param>
  5720. /// <param name="sessionKey"></param>
  5721. /// <param name="barcode">产品条码</param>
  5722. /// <returns></returns>
  5723. public ActionResult CheckWasteScrapProductGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5724. {
  5725. ActionResult actionResult = new ActionResult();
  5726. try
  5727. {
  5728. // 验证请求头信息
  5729. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5730. // 验证失败
  5731. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5732. {
  5733. return actionResult;
  5734. }
  5735. int returnValue = ServiceInvoker.Invoke<int>(this,
  5736. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  5737. if (returnValue != -100)
  5738. {
  5739. actionResult.Result = JsonHelper.ToJson(returnValue);
  5740. actionResult.Status = (int)Constant.PDAResult.Success;
  5741. }
  5742. else
  5743. {
  5744. actionResult.Status = (int)Constant.PDAResult.Fail;
  5745. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  5746. }
  5747. }
  5748. catch (Exception ex)
  5749. {
  5750. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5751. OutputLog.TraceLog(LogPriority.Error,
  5752. this.ToString(),
  5753. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5754. ex.ToString(),
  5755. LocalPath.LogExePath);
  5756. actionResult.Status = (int)Constant.PDAResult.Exception;
  5757. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5758. }
  5759. return actionResult;
  5760. }
  5761. /// <summary>
  5762. /// 获取登陆帐户有无入窑前检验数据编辑权限
  5763. /// </summary>
  5764. /// <param name="accountCode"></param>
  5765. /// <param name="userCode"></param>
  5766. /// <param name="userPassword"></param>
  5767. /// <param name="sessionKey"></param>
  5768. /// <param name="usercode">工号编码</param>
  5769. /// <returns></returns>
  5770. public ActionResult GetIntoKilnCheckEditFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5771. {
  5772. ActionResult actionResult = new ActionResult();
  5773. try
  5774. {
  5775. // 验证请求头信息
  5776. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5777. // 验证失败
  5778. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5779. {
  5780. return actionResult;
  5781. }
  5782. int returnValue = ServiceInvoker.Invoke<int>(this,
  5783. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  5784. actionResult.Result = JsonHelper.ToJson(returnValue);
  5785. actionResult.Status = (int)Constant.PDAResult.Success;
  5786. }
  5787. catch (Exception ex)
  5788. {
  5789. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5790. OutputLog.TraceLog(LogPriority.Error,
  5791. this.ToString(),
  5792. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5793. ex.ToString(),
  5794. LocalPath.LogExePath);
  5795. actionResult.Status = (int)Constant.PDAResult.Exception;
  5796. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5797. }
  5798. return actionResult;
  5799. }
  5800. /// <summary>
  5801. /// 获取登陆帐户有无半检验数据编辑权限
  5802. /// </summary>
  5803. /// <param name="accountCode"></param>
  5804. /// <param name="userCode"></param>
  5805. /// <param name="userPassword"></param>
  5806. /// <param name="sessionKey"></param>
  5807. /// <param name="usercode">工号编码</param>
  5808. /// <returns></returns>
  5809. public ActionResult GetNormalCheckEditFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5810. {
  5811. ActionResult actionResult = new ActionResult();
  5812. try
  5813. {
  5814. // 验证请求头信息
  5815. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5816. // 验证失败
  5817. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5818. {
  5819. return actionResult;
  5820. }
  5821. int returnValue = ServiceInvoker.Invoke<int>(this,
  5822. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  5823. actionResult.Result = JsonHelper.ToJson(returnValue);
  5824. actionResult.Status = (int)Constant.PDAResult.Success;
  5825. }
  5826. catch (Exception ex)
  5827. {
  5828. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5829. OutputLog.TraceLog(LogPriority.Error,
  5830. this.ToString(),
  5831. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5832. ex.ToString(),
  5833. LocalPath.LogExePath);
  5834. actionResult.Status = (int)Constant.PDAResult.Exception;
  5835. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5836. }
  5837. return actionResult;
  5838. }
  5839. /// <summary>
  5840. /// 获取缺陷扣罚管理的全部数据
  5841. /// </summary>
  5842. /// <param name="accountCode"></param>
  5843. /// <param name="userCode"></param>
  5844. /// <param name="userPassword"></param>
  5845. /// <param name="sessionKey"></param>
  5846. /// <returns></returns>
  5847. public ActionResult GetAllDefectFineGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5848. {
  5849. ActionResult actionResult = new ActionResult();
  5850. try
  5851. {
  5852. // 验证请求头信息
  5853. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5854. // 验证失败
  5855. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5856. {
  5857. return actionResult;
  5858. }
  5859. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5860. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  5861. if (ds != null && ds.Tables[0].Rows.Count > 0)
  5862. {
  5863. DataView dv = ds.Tables[0].DefaultView;
  5864. dv.RowFilter = "valueflag=1";
  5865. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5866. actionResult.Status = (int)Constant.PDAResult.Success;
  5867. }
  5868. else
  5869. {
  5870. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  5871. actionResult.Status = (int)Constant.PDAResult.Success;
  5872. }
  5873. }
  5874. catch (Exception ex)
  5875. {
  5876. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5877. OutputLog.TraceLog(LogPriority.Error,
  5878. this.ToString(),
  5879. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5880. ex.ToString(),
  5881. LocalPath.LogExePath);
  5882. actionResult.Status = (int)Constant.PDAResult.Exception;
  5883. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5884. }
  5885. return actionResult;
  5886. }
  5887. /// <summary>
  5888. /// 获取缺陷扣除数管理的全部数据
  5889. /// </summary>
  5890. /// <param name="accountCode"></param>
  5891. /// <param name="userCode"></param>
  5892. /// <param name="userPassword"></param>
  5893. /// <param name="sessionKey"></param>
  5894. /// <returns></returns>
  5895. public ActionResult GetAllDefectDeductionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5896. {
  5897. ActionResult actionResult = new ActionResult();
  5898. try
  5899. {
  5900. // 验证请求头信息
  5901. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5902. // 验证失败
  5903. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5904. {
  5905. return actionResult;
  5906. }
  5907. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5908. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  5909. if (ds != null && ds.Tables[0].Rows.Count > 0)
  5910. {
  5911. DataView dv = ds.Tables[0].DefaultView;
  5912. dv.RowFilter = "valueflag=1";
  5913. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5914. actionResult.Status = (int)Constant.PDAResult.Success;
  5915. }
  5916. else
  5917. {
  5918. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  5919. actionResult.Status = (int)Constant.PDAResult.Success;
  5920. }
  5921. }
  5922. catch (Exception ex)
  5923. {
  5924. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5925. OutputLog.TraceLog(LogPriority.Error,
  5926. this.ToString(),
  5927. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5928. ex.ToString(),
  5929. LocalPath.LogExePath);
  5930. actionResult.Status = (int)Constant.PDAResult.Exception;
  5931. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5932. }
  5933. return actionResult;
  5934. }
  5935. /// <summary>
  5936. /// 获取缺陷扣罚关系管理的全部数据
  5937. /// </summary>
  5938. /// <param name="accountCode"></param>
  5939. /// <param name="userCode"></param>
  5940. /// <param name="userPassword"></param>
  5941. /// <param name="sessionKey"></param>
  5942. /// <returns></returns>
  5943. public ActionResult GetAllDefectFineRelationGet(string accountCode, string userCode, string userPassword, string sessionKey)
  5944. {
  5945. ActionResult actionResult = new ActionResult();
  5946. try
  5947. {
  5948. // 验证请求头信息
  5949. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5950. // 验证失败
  5951. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5952. {
  5953. return actionResult;
  5954. }
  5955. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5956. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  5957. DataTable dt = new DataTable();
  5958. dt.Columns.Add("DefectID");
  5959. dt.Columns.Add("DefectFineID");
  5960. DataView dv = ds.Tables[0].DefaultView;
  5961. DataTable dtFor = dv.ToTable("defectid", true);
  5962. for (int i = 0; i < dtFor.Rows.Count; i++)
  5963. {
  5964. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  5965. string substring = "";
  5966. foreach (DataRow r1 in r)
  5967. {
  5968. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  5969. }
  5970. if (substring != "")
  5971. {
  5972. DataRow drnew = dt.NewRow();
  5973. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  5974. drnew["DefectFineID"] = substring.TrimEnd(',');
  5975. dt.Rows.Add(drnew);
  5976. }
  5977. }
  5978. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  5979. actionResult.Status = (int)Constant.PDAResult.Success;
  5980. }
  5981. catch (Exception ex)
  5982. {
  5983. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5984. OutputLog.TraceLog(LogPriority.Error,
  5985. this.ToString(),
  5986. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5987. ex.ToString(),
  5988. LocalPath.LogExePath);
  5989. actionResult.Status = (int)Constant.PDAResult.Exception;
  5990. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5991. }
  5992. return actionResult;
  5993. }
  5994. /// <summary>
  5995. /// 获取缺陷扣除数关系管理的全部数据
  5996. /// </summary>
  5997. /// <param name="accountCode"></param>
  5998. /// <param name="userCode"></param>
  5999. /// <param name="userPassword"></param>
  6000. /// <param name="sessionKey"></param>
  6001. /// <returns></returns>
  6002. public ActionResult GetAllDefectDeductionRelationGet(string accountCode, string userCode, string userPassword, string sessionKey)
  6003. {
  6004. ActionResult actionResult = new ActionResult();
  6005. try
  6006. {
  6007. // 验证请求头信息
  6008. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6009. // 验证失败
  6010. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6011. {
  6012. return actionResult;
  6013. }
  6014. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6015. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6016. DataTable dt = new DataTable();
  6017. dt.Columns.Add("DefectID");
  6018. dt.Columns.Add("DefectDeductionNum");
  6019. DataView dv = ds.Tables[0].DefaultView;
  6020. DataTable dtFor = dv.ToTable("defectid", true);
  6021. for (int i = 0; i < dtFor.Rows.Count; i++)
  6022. {
  6023. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6024. string substring = "";
  6025. foreach (DataRow r1 in r)
  6026. {
  6027. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6028. }
  6029. if (substring != "")
  6030. {
  6031. DataRow drnew = dt.NewRow();
  6032. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6033. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6034. dt.Rows.Add(drnew);
  6035. }
  6036. }
  6037. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6038. actionResult.Status = (int)Constant.PDAResult.Success;
  6039. }
  6040. catch (Exception ex)
  6041. {
  6042. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6043. OutputLog.TraceLog(LogPriority.Error,
  6044. this.ToString(),
  6045. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6046. ex.ToString(),
  6047. LocalPath.LogExePath);
  6048. actionResult.Status = (int)Constant.PDAResult.Exception;
  6049. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6050. }
  6051. return actionResult;
  6052. }
  6053. /// <summary>
  6054. /// 获取盘点单明细
  6055. /// </summary>
  6056. /// <param name="sUserInfo"></param>
  6057. /// <returns></returns>
  6058. public ActionResult GetUpdateInCheckedInfoGet(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6059. {
  6060. ActionResult actionResult = new ActionResult();
  6061. try
  6062. {
  6063. // 验证请求头信息
  6064. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6065. // 验证失败
  6066. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6067. {
  6068. return actionResult;
  6069. }
  6070. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6071. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6072. actionResult.Result = JsonHelper.ToJson(ds);
  6073. actionResult.Status = (int)Constant.PDAResult.Success;
  6074. }
  6075. catch (Exception ex)
  6076. {
  6077. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6078. OutputLog.TraceLog(LogPriority.Error,
  6079. this.ToString(),
  6080. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6081. ex.ToString(),
  6082. LocalPath.LogExePath);
  6083. actionResult.Status = (int)Constant.PDAResult.Exception;
  6084. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6085. }
  6086. return actionResult;
  6087. }
  6088. /// <summary>
  6089. /// 半检检验条码
  6090. /// </summary>
  6091. /// <param name="sUserInfo"></param>
  6092. /// <returns></returns>
  6093. public ActionResult SemiCheckBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6094. {
  6095. ActionResult actionResult = new ActionResult();
  6096. try
  6097. {
  6098. // 验证请求头信息
  6099. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6100. // 验证失败
  6101. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6102. {
  6103. return actionResult;
  6104. }
  6105. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6106. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6107. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6108. if (Convert.ToInt32(resultEntity.Result) < 0)
  6109. {
  6110. actionResult.Status = (int)Constant.PDAResult.Fail;
  6111. }
  6112. else
  6113. {
  6114. actionResult.Status = (int)Constant.PDAResult.Success;
  6115. }
  6116. actionResult.Message = resultEntity.Message;
  6117. }
  6118. catch (Exception ex)
  6119. {
  6120. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6121. OutputLog.TraceLog(LogPriority.Error,
  6122. this.ToString(),
  6123. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6124. ex.ToString(),
  6125. LocalPath.LogExePath);
  6126. actionResult.Status = (int)Constant.PDAResult.Exception;
  6127. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6128. }
  6129. return actionResult;
  6130. }
  6131. /// <summary>
  6132. /// 根据条码获取经过的工序,用于绑定返工工序
  6133. /// </summary>
  6134. /// <param name="sUserInfo"></param>
  6135. /// <returns></returns>
  6136. public ActionResult GetSemiCheckPassProcedureGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6137. {
  6138. ActionResult actionResult = new ActionResult();
  6139. try
  6140. {
  6141. // 验证请求头信息
  6142. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6143. // 验证失败
  6144. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6145. {
  6146. return actionResult;
  6147. }
  6148. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6149. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6150. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6151. actionResult.Status = (int)Constant.PDAResult.Success;
  6152. }
  6153. catch (Exception ex)
  6154. {
  6155. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6156. OutputLog.TraceLog(LogPriority.Error,
  6157. this.ToString(),
  6158. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6159. ex.ToString(),
  6160. LocalPath.LogExePath);
  6161. actionResult.Status = (int)Constant.PDAResult.Exception;
  6162. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6163. }
  6164. return actionResult;
  6165. }
  6166. /// <summary>
  6167. /// 获取登陆帐户有无半检状态权限
  6168. /// </summary>
  6169. /// <param name="sUserInfo"></param>
  6170. /// <returns></returns>
  6171. public ActionResult GetSemiCheckStatusFuntionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  6172. {
  6173. ActionResult actionResult = new ActionResult();
  6174. try
  6175. {
  6176. // 验证请求头信息
  6177. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6178. // 验证失败
  6179. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6180. {
  6181. return actionResult;
  6182. }
  6183. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6184. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6185. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6186. actionResult.Status = (int)Constant.PDAResult.Success;
  6187. }
  6188. catch (Exception ex)
  6189. {
  6190. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6191. OutputLog.TraceLog(LogPriority.Error,
  6192. this.ToString(),
  6193. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6194. ex.ToString(),
  6195. LocalPath.LogExePath);
  6196. actionResult.Status = (int)Constant.PDAResult.Exception;
  6197. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6198. }
  6199. return actionResult;
  6200. }
  6201. /// <summary>
  6202. /// 复检状态数据源
  6203. /// </summary>
  6204. /// <param name="sUserInfo"></param>
  6205. /// <returns></returns>
  6206. public ActionResult GetSemiCheckTypeGet(string accountCode, string userCode, string userPassword, string sessionKey)
  6207. {
  6208. ActionResult actionResult = new ActionResult();
  6209. try
  6210. {
  6211. // 验证请求头信息
  6212. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6213. // 验证失败
  6214. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6215. {
  6216. return actionResult;
  6217. }
  6218. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6219. () => SystemModuleLogic.GetSemiCheckType());
  6220. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6221. actionResult.Status = (int)Constant.PDAResult.Success;
  6222. }
  6223. catch (Exception ex)
  6224. {
  6225. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6226. OutputLog.TraceLog(LogPriority.Error,
  6227. this.ToString(),
  6228. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6229. ex.ToString(),
  6230. LocalPath.LogExePath);
  6231. actionResult.Status = (int)Constant.PDAResult.Exception;
  6232. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6233. }
  6234. return actionResult;
  6235. }
  6236. /// <summary>
  6237. /// 根据半成品检验数据ID,显示半成品数据信息
  6238. /// </summary>
  6239. /// <param name="sUserInfo"></param>
  6240. /// <returns></returns>
  6241. public ActionResult GetSemiCheckByIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6242. {
  6243. ActionResult actionResult = new ActionResult();
  6244. try
  6245. {
  6246. // 验证请求头信息
  6247. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6248. // 验证失败
  6249. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6250. {
  6251. return actionResult;
  6252. }
  6253. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6254. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6255. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6256. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6257. {
  6258. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6259. {
  6260. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6261. {
  6262. SemiCheckEntity productionData = new SemiCheckEntity();
  6263. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6264. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6265. {
  6266. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6267. }
  6268. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6269. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6270. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6271. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6272. productionData.ReFine = 0;
  6273. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6274. {
  6275. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6276. }
  6277. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6278. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6279. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6280. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6281. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6282. {
  6283. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6284. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6285. }
  6286. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6287. {
  6288. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6289. }
  6290. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6291. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6292. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6293. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6294. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6295. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6296. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6297. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6298. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6299. {
  6300. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6301. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6302. }
  6303. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6304. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6305. {
  6306. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6307. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6308. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6309. }
  6310. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6311. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6312. {
  6313. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6314. }
  6315. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6316. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6317. DataTable dtDefect = dvDefect.ToTable();
  6318. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6319. {
  6320. // 产品缺陷
  6321. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6322. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6323. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6324. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6325. //{
  6326. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6327. //}
  6328. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6329. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6330. {
  6331. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6332. }
  6333. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6334. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6335. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6336. {
  6337. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6338. }
  6339. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6340. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6341. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6342. {
  6343. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6344. }
  6345. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6346. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6347. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6348. {
  6349. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6350. }
  6351. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6352. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6353. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6354. //{
  6355. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6356. //}
  6357. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6358. //{
  6359. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6360. //}
  6361. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6362. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6363. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6364. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6365. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6366. {
  6367. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6368. }
  6369. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6370. {
  6371. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6372. }
  6373. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6374. //{
  6375. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6376. //}
  6377. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6378. //--------责任员工-------------------
  6379. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6380. if (drRow.Length > Constant.INT_IS_ZERO)
  6381. {
  6382. if (defect.DefectResponsibles == null)
  6383. {
  6384. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6385. }
  6386. foreach (DataRow r in drRow)
  6387. {
  6388. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6389. if (r["SemiCheckDefectID"].ToString() != "")
  6390. {
  6391. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6392. }
  6393. if (r["StaffID"].ToString() != "")
  6394. {
  6395. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6396. }
  6397. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6398. defectResponsible.StaffName = r["StaffName"].ToString();
  6399. if (r["StaffStatus"].ToString() != "")
  6400. {
  6401. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6402. }
  6403. if (r["UJobsID"].ToString() != "")
  6404. {
  6405. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6406. }
  6407. if (r["SJobsID"].ToString() != "")
  6408. {
  6409. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6410. }
  6411. defect.DefectResponsibles.Add(defectResponsible);
  6412. }
  6413. }
  6414. //------------------------------
  6415. if (productionData.SemiCheckDefects == null)
  6416. {
  6417. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6418. }
  6419. productionData.SemiCheckDefects.Add(defect);
  6420. }
  6421. //if (productionDatas.PDAProductionData == null)
  6422. //{
  6423. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6424. //}
  6425. productionDatas[0] = productionData;
  6426. //---------------------------------------------------------------------------------
  6427. }
  6428. }
  6429. }
  6430. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6431. actionResult.Status = (int)Constant.PDAResult.Success;
  6432. }
  6433. catch (Exception ex)
  6434. {
  6435. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6436. OutputLog.TraceLog(LogPriority.Error,
  6437. this.ToString(),
  6438. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6439. ex.ToString(),
  6440. LocalPath.LogExePath);
  6441. actionResult.Status = (int)Constant.PDAResult.Exception;
  6442. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6443. }
  6444. return actionResult;
  6445. }
  6446. /// <summary>
  6447. /// 保存半检登记
  6448. /// </summary>
  6449. /// <param name="accountCode">帐套code</param>
  6450. /// <param name="userCode">用户code</param>
  6451. /// <param name="userPassword">用户密码</param>
  6452. /// <param name="sessionKey">本次登陆密钥</param>
  6453. /// <param name="entity">半检实体类</param>
  6454. /// <param name="sUserInfo">用户基本信息</param>
  6455. /// <returns></returns>
  6456. public ActionResult AddSemiCheckGet(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6457. {
  6458. ActionResult actionResult = new ActionResult();
  6459. try
  6460. {
  6461. // 验证请求头信息
  6462. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6463. // 验证失败
  6464. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6465. {
  6466. return actionResult;
  6467. }
  6468. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6469. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6470. string err = string.Empty;
  6471. err = resultEntity.Message;
  6472. if (err == null)
  6473. {
  6474. err = "";
  6475. }
  6476. SemiCheckEntity entity = entityobj[0];
  6477. if (entity.SemiCheckCategory == 1) // 半检登记
  6478. {
  6479. }
  6480. else if (entity.SemiCheckCategory == 2)// 复检登记
  6481. {
  6482. err = JsonHelper.ToJson(err);
  6483. }
  6484. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6485. {
  6486. err = JsonHelper.ToJson(err);
  6487. }
  6488. //actionResult.Result = JsonHelper.ToJson(err);
  6489. actionResult.Result = err;//JsonHelper.ToJson(err);
  6490. actionResult.Status = (int)Constant.PDAResult.Success;
  6491. }
  6492. catch (Exception ex)
  6493. {
  6494. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6495. OutputLog.TraceLog(LogPriority.Error,
  6496. this.ToString(),
  6497. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6498. ex.ToString(),
  6499. LocalPath.LogExePath);
  6500. actionResult.Status = (int)Constant.PDAResult.Exception;
  6501. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6502. }
  6503. return actionResult;
  6504. }
  6505. /// <summary>
  6506. /// 根据所选工号,查出缺陷责任员工
  6507. /// </summary>
  6508. /// <param name="sUserInfo"></param>
  6509. /// <returns></returns>
  6510. public ActionResult GetSemiCheckDefectStaffByUserIDGet(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6511. {
  6512. ActionResult actionResult = new ActionResult();
  6513. try
  6514. {
  6515. // 验证请求头信息
  6516. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6517. // 验证失败
  6518. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6519. {
  6520. return actionResult;
  6521. }
  6522. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6523. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  6524. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6525. actionResult.Status = (int)Constant.PDAResult.Success;
  6526. }
  6527. catch (Exception ex)
  6528. {
  6529. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6530. OutputLog.TraceLog(LogPriority.Error,
  6531. this.ToString(),
  6532. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6533. ex.ToString(),
  6534. LocalPath.LogExePath);
  6535. actionResult.Status = (int)Constant.PDAResult.Exception;
  6536. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6537. }
  6538. return actionResult;
  6539. }
  6540. /// <summary>
  6541. /// 获取半成品缺陷管理的全部数据
  6542. /// </summary>
  6543. /// <param name="sUserInfo"></param>
  6544. /// <returns></returns>
  6545. public ActionResult GetAllSemicheckDefectGet(string accountCode, string userCode, string userPassword, string sessionKey)
  6546. {
  6547. ActionResult actionResult = new ActionResult();
  6548. try
  6549. {
  6550. // 验证请求头信息
  6551. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6552. // 验证失败
  6553. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6554. {
  6555. return actionResult;
  6556. }
  6557. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6558. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  6559. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6560. actionResult.Status = (int)Constant.PDAResult.Success;
  6561. }
  6562. catch (Exception ex)
  6563. {
  6564. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6565. OutputLog.TraceLog(LogPriority.Error,
  6566. this.ToString(),
  6567. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6568. ex.ToString(),
  6569. LocalPath.LogExePath);
  6570. actionResult.Status = (int)Constant.PDAResult.Exception;
  6571. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6572. }
  6573. return actionResult;
  6574. }
  6575. /// <summary>
  6576. /// 获取半成品缺陷位置管理的全部数据
  6577. /// </summary>
  6578. /// <param name="sUserInfo"></param>
  6579. /// <returns></returns>
  6580. public ActionResult GetAllScdefectPositionGet(string accountCode, string userCode, string userPassword, string sessionKey)
  6581. {
  6582. ActionResult actionResult = new ActionResult();
  6583. try
  6584. {
  6585. // 验证请求头信息
  6586. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6587. // 验证失败
  6588. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6589. {
  6590. return actionResult;
  6591. }
  6592. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6593. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  6594. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6595. actionResult.Status = (int)Constant.PDAResult.Success;
  6596. }
  6597. catch (Exception ex)
  6598. {
  6599. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6600. OutputLog.TraceLog(LogPriority.Error,
  6601. this.ToString(),
  6602. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6603. ex.ToString(),
  6604. LocalPath.LogExePath);
  6605. actionResult.Status = (int)Constant.PDAResult.Exception;
  6606. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6607. }
  6608. return actionResult;
  6609. }
  6610. /// <summary>
  6611. /// 复检验条码
  6612. /// </summary>
  6613. /// <param name="sUserInfo"></param>
  6614. /// <returns></returns>
  6615. public ActionResult ReSemiCheckBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6616. {
  6617. ActionResult actionResult = new ActionResult();
  6618. try
  6619. {
  6620. // 验证请求头信息
  6621. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6622. // 验证失败
  6623. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6624. {
  6625. return actionResult;
  6626. }
  6627. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6628. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  6629. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6630. if (Convert.ToInt32(resultEntity.Result) < 0)
  6631. {
  6632. actionResult.Status = (int)Constant.PDAResult.Fail;
  6633. }
  6634. else
  6635. {
  6636. actionResult.Status = (int)Constant.PDAResult.Success;
  6637. }
  6638. actionResult.Message = resultEntity.Message;
  6639. }
  6640. catch (Exception ex)
  6641. {
  6642. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6643. OutputLog.TraceLog(LogPriority.Error,
  6644. this.ToString(),
  6645. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6646. ex.ToString(),
  6647. LocalPath.LogExePath);
  6648. actionResult.Status = (int)Constant.PDAResult.Exception;
  6649. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6650. }
  6651. return actionResult;
  6652. }
  6653. /// <summary>
  6654. /// 撤销复检验条码
  6655. /// </summary>
  6656. /// <param name="sUserInfo"></param>
  6657. /// <returns></returns>
  6658. public ActionResult CancelSemiCheckBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6659. {
  6660. ActionResult actionResult = new ActionResult();
  6661. try
  6662. {
  6663. // 验证请求头信息
  6664. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6665. // 验证失败
  6666. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6667. {
  6668. return actionResult;
  6669. }
  6670. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6671. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  6672. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6673. if (Convert.ToInt32(resultEntity.Result) < 0)
  6674. {
  6675. actionResult.Status = (int)Constant.PDAResult.Fail;
  6676. }
  6677. else
  6678. {
  6679. actionResult.Status = (int)Constant.PDAResult.Success;
  6680. }
  6681. actionResult.Message = resultEntity.Message;
  6682. }
  6683. catch (Exception ex)
  6684. {
  6685. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6686. OutputLog.TraceLog(LogPriority.Error,
  6687. this.ToString(),
  6688. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6689. ex.ToString(),
  6690. LocalPath.LogExePath);
  6691. actionResult.Status = (int)Constant.PDAResult.Exception;
  6692. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6693. }
  6694. return actionResult;
  6695. }
  6696. /// <summary>
  6697. /// 恢复数据
  6698. /// </summary>
  6699. /// <param name="sUserInfo"></param>
  6700. /// <returns></returns>
  6701. public ActionResult ResetBarCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6702. {
  6703. ActionResult actionResult = new ActionResult();
  6704. try
  6705. {
  6706. // 验证请求头信息
  6707. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6708. // 验证失败
  6709. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6710. {
  6711. return actionResult;
  6712. }
  6713. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6714. () => PMModuleLogicDAL.ResetBarCode(barcode));
  6715. if (resultEntity > 0)
  6716. {
  6717. actionResult.Status = (int)Constant.PDAResult.Success;
  6718. actionResult.Message = "恢复数据成功";
  6719. }
  6720. else
  6721. {
  6722. actionResult.Status = (int)Constant.PDAResult.Fail;
  6723. if (resultEntity == -1)
  6724. {
  6725. actionResult.Message = "此条码没有清除,不能恢复";
  6726. }
  6727. else if (resultEntity == 0)
  6728. {
  6729. actionResult.Message = "没有可恢复的数据";
  6730. }
  6731. }
  6732. }
  6733. catch (Exception ex)
  6734. {
  6735. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6736. OutputLog.TraceLog(LogPriority.Error,
  6737. this.ToString(),
  6738. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6739. ex.ToString(),
  6740. LocalPath.LogExePath);
  6741. actionResult.Status = (int)Constant.PDAResult.Exception;
  6742. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6743. }
  6744. return actionResult;
  6745. }
  6746. /// <summary>
  6747. /// 通过SettingCode获取系统参数管理的数据
  6748. /// </summary>
  6749. /// <param name="accountCode"></param>
  6750. /// <param name="userCode"></param>
  6751. /// <param name="userPassword"></param>
  6752. /// <param name="sessionKey"></param>
  6753. /// <param name="settingcode">设置编码</param>
  6754. /// <returns></returns>
  6755. public ActionResult GetSystemSettingDataByCodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  6756. {
  6757. ActionResult actionResult = new ActionResult();
  6758. try
  6759. {
  6760. // 验证请求头信息
  6761. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6762. // 验证失败
  6763. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6764. {
  6765. return actionResult;
  6766. }
  6767. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6768. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  6769. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6770. actionResult.Status = (int)Constant.PDAResult.Success;
  6771. }
  6772. catch (Exception ex)
  6773. {
  6774. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6775. OutputLog.TraceLog(LogPriority.Error,
  6776. this.ToString(),
  6777. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6778. ex.ToString(),
  6779. LocalPath.LogExePath);
  6780. actionResult.Status = (int)Constant.PDAResult.Exception;
  6781. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6782. }
  6783. return actionResult;
  6784. }
  6785. /// <summary>
  6786. /// 校验条码是否允许撤销,如果不允许提示错误消息
  6787. /// </summary>
  6788. /// <param name="accountCode"></param>
  6789. /// <param name="userCode"></param>
  6790. /// <param name="userPassword"></param>
  6791. /// <param name="sessionKey"></param>
  6792. /// <param name="orgTime">原时间</param>
  6793. /// <param name="days">允许撤销天数</param>
  6794. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  6795. /// <returns></returns>
  6796. public ActionResult BarcodeAllowCancelGet(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  6797. {
  6798. ActionResult actionResult = new ActionResult();
  6799. try
  6800. {
  6801. // 验证请求头信息
  6802. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6803. // 验证失败
  6804. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6805. {
  6806. return actionResult;
  6807. }
  6808. string[] subOrgTime = orgTime.Split('-');
  6809. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  6810. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6811. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  6812. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6813. if (Convert.ToInt32(resultEntity.Result) < 0)
  6814. {
  6815. actionResult.Status = (int)Constant.PDAResult.Fail;
  6816. }
  6817. else
  6818. {
  6819. actionResult.Status = (int)Constant.PDAResult.Success;
  6820. }
  6821. actionResult.Message = resultEntity.Message;
  6822. }
  6823. catch (Exception ex)
  6824. {
  6825. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6826. OutputLog.TraceLog(LogPriority.Error,
  6827. this.ToString(),
  6828. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6829. ex.ToString(),
  6830. LocalPath.LogExePath);
  6831. actionResult.Status = (int)Constant.PDAResult.Exception;
  6832. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6833. }
  6834. return actionResult;
  6835. }
  6836. /// <summary>
  6837. /// 获取生产订单管理的全部数据
  6838. /// </summary>
  6839. /// <param name="sUserInfo"></param>
  6840. /// <returns></returns>
  6841. public ActionResult GetOrderListGet(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  6842. {
  6843. ActionResult actionResult = new ActionResult();
  6844. try
  6845. {
  6846. // 验证请求头信息
  6847. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6848. // 验证失败
  6849. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6850. {
  6851. return actionResult;
  6852. }
  6853. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6854. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  6855. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6856. actionResult.Status = (int)Constant.PDAResult.Success;
  6857. }
  6858. catch (Exception ex)
  6859. {
  6860. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6861. OutputLog.TraceLog(LogPriority.Error,
  6862. this.ToString(),
  6863. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6864. ex.ToString(),
  6865. LocalPath.LogExePath);
  6866. actionResult.Status = (int)Constant.PDAResult.Exception;
  6867. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6868. }
  6869. return actionResult;
  6870. }
  6871. public ActionResult FinishedHandoverBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6872. {
  6873. ActionResult actionResult = new ActionResult();
  6874. try
  6875. {
  6876. // 验证请求头信息
  6877. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6878. // 验证失败
  6879. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6880. {
  6881. return actionResult;
  6882. }
  6883. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6884. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  6885. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6886. if (Convert.ToInt32(resultEntity.Result) < 0)
  6887. {
  6888. actionResult.Status = (int)Constant.PDAResult.Fail;
  6889. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  6890. }
  6891. else
  6892. {
  6893. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  6894. actionResult.Status = (int)Constant.PDAResult.Success;
  6895. }
  6896. actionResult.Message = resultEntity.Message;
  6897. }
  6898. catch (Exception ex)
  6899. {
  6900. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6901. OutputLog.TraceLog(LogPriority.Error,
  6902. this.ToString(),
  6903. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6904. ex.ToString(),
  6905. LocalPath.LogExePath);
  6906. actionResult.Status = (int)Constant.PDAResult.Exception;
  6907. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6908. }
  6909. return actionResult;
  6910. }
  6911. public ActionResult GetSystemDataGet(string accountCode, string userCode, string userPassword, string sessionKey)
  6912. {
  6913. ActionResult actionResult = new ActionResult();
  6914. try
  6915. {
  6916. // 验证请求头信息
  6917. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6918. // 验证失败
  6919. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6920. {
  6921. return actionResult;
  6922. }
  6923. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6924. () => SystemModuleLogic.GetSystemData(sUserInfo));
  6925. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6926. actionResult.Status = (int)Constant.PDAResult.Success;
  6927. }
  6928. catch (Exception ex)
  6929. {
  6930. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6931. OutputLog.TraceLog(LogPriority.Error,
  6932. this.ToString(),
  6933. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6934. ex.ToString(),
  6935. LocalPath.LogExePath);
  6936. actionResult.Status = (int)Constant.PDAResult.Exception;
  6937. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6938. }
  6939. return actionResult;
  6940. }
  6941. public ActionResult SaveFinishedHandoverGet(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  6942. {
  6943. ActionResult actionResult = new ActionResult();
  6944. try
  6945. {
  6946. // 验证请求头信息
  6947. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6948. // 验证失败
  6949. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6950. {
  6951. return actionResult;
  6952. }
  6953. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  6954. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6955. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  6956. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6957. if (Convert.ToInt32(resultEntity.Result) < 0)
  6958. {
  6959. actionResult.Status = (int)Constant.PDAResult.Fail;
  6960. }
  6961. else
  6962. {
  6963. actionResult.Status = (int)Constant.PDAResult.Success;
  6964. }
  6965. actionResult.Message = resultEntity.Message;
  6966. }
  6967. catch (Exception ex)
  6968. {
  6969. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6970. OutputLog.TraceLog(LogPriority.Error,
  6971. this.ToString(),
  6972. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6973. ex.ToString(),
  6974. LocalPath.LogExePath);
  6975. actionResult.Status = (int)Constant.PDAResult.Exception;
  6976. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6977. }
  6978. return actionResult;
  6979. }
  6980. public ActionResult CancelFinishedHandoverBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6981. {
  6982. ActionResult actionResult = new ActionResult();
  6983. try
  6984. {
  6985. // 验证请求头信息
  6986. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6987. // 验证失败
  6988. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6989. {
  6990. return actionResult;
  6991. }
  6992. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6993. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  6994. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6995. if (Convert.ToInt32(resultEntity.Result) < 0)
  6996. {
  6997. actionResult.Status = (int)Constant.PDAResult.Fail;
  6998. }
  6999. else
  7000. {
  7001. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7002. actionResult.Status = (int)Constant.PDAResult.Success;
  7003. }
  7004. actionResult.Message = resultEntity.Message;
  7005. }
  7006. catch (Exception ex)
  7007. {
  7008. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7009. OutputLog.TraceLog(LogPriority.Error,
  7010. this.ToString(),
  7011. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7012. ex.ToString(),
  7013. LocalPath.LogExePath);
  7014. actionResult.Status = (int)Constant.PDAResult.Exception;
  7015. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7016. }
  7017. return actionResult;
  7018. }
  7019. public ActionResult SaveCancelFinishedHandoverByBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7020. {
  7021. ActionResult actionResult = new ActionResult();
  7022. try
  7023. {
  7024. // 验证请求头信息
  7025. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7026. // 验证失败
  7027. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7028. {
  7029. return actionResult;
  7030. }
  7031. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7032. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7033. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7034. if (Convert.ToInt32(resultEntity.Result) < 0)
  7035. {
  7036. actionResult.Status = (int)Constant.PDAResult.Fail;
  7037. }
  7038. else
  7039. {
  7040. actionResult.Status = (int)Constant.PDAResult.Success;
  7041. }
  7042. actionResult.Message = resultEntity.Message;
  7043. }
  7044. catch (Exception ex)
  7045. {
  7046. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7047. OutputLog.TraceLog(LogPriority.Error,
  7048. this.ToString(),
  7049. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7050. ex.ToString(),
  7051. LocalPath.LogExePath);
  7052. actionResult.Status = (int)Constant.PDAResult.Exception;
  7053. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7054. }
  7055. return actionResult;
  7056. }
  7057. public ActionResult SaveChangeFinishedHandoverByBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7058. {
  7059. ActionResult actionResult = new ActionResult();
  7060. try
  7061. {
  7062. // 验证请求头信息
  7063. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7064. // 验证失败
  7065. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7066. {
  7067. return actionResult;
  7068. }
  7069. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7070. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7071. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7072. if (Convert.ToInt32(resultEntity.Result) < 0)
  7073. {
  7074. actionResult.Status = (int)Constant.PDAResult.Fail;
  7075. }
  7076. else
  7077. {
  7078. actionResult.Status = (int)Constant.PDAResult.Success;
  7079. }
  7080. actionResult.Message = resultEntity.Message;
  7081. }
  7082. catch (Exception ex)
  7083. {
  7084. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7085. OutputLog.TraceLog(LogPriority.Error,
  7086. this.ToString(),
  7087. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7088. ex.ToString(),
  7089. LocalPath.LogExePath);
  7090. actionResult.Status = (int)Constant.PDAResult.Exception;
  7091. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7092. }
  7093. return actionResult;
  7094. }
  7095. #region PDA条码打印
  7096. /// <summary>
  7097. /// 获取条码打印机
  7098. /// </summary>
  7099. /// <param name="accountCode"></param>
  7100. /// <param name="userCode"></param>
  7101. /// <param name="userPassword"></param>
  7102. /// <param name="sessionKey"></param>
  7103. /// <returns></returns>
  7104. public ActionResult GetBarcodePrinterGet(string accountCode, string userCode, string userPassword, string sessionKey, int printType = 0)
  7105. {
  7106. ActionResult actionResult = new ActionResult();
  7107. try
  7108. {
  7109. // 验证请求头信息
  7110. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7111. // 验证失败
  7112. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7113. {
  7114. return actionResult;
  7115. }
  7116. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType);
  7117. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7118. actionResult.Status = (int)Constant.PDAResult.Success;
  7119. }
  7120. catch (Exception ex)
  7121. {
  7122. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7123. OutputLog.TraceLog(LogPriority.Error,
  7124. this.ToString(),
  7125. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7126. ex.ToString(),
  7127. LocalPath.LogExePath);
  7128. actionResult.Status = (int)Constant.PDAResult.Exception;
  7129. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7130. }
  7131. return actionResult;
  7132. }
  7133. /// <summary>
  7134. /// 打印条码样式
  7135. /// </summary>
  7136. /// <param name="accountCode"></param>
  7137. /// <param name="userCode"></param>
  7138. /// <param name="userPassword"></param>
  7139. /// <param name="sessionKey"></param>
  7140. /// <returns></returns>
  7141. public ActionResult PrintBarcodeLayoutGet(string accountCode, string userCode, string userPassword, string sessionKey
  7142. , string barcode, int copies, int printerID)
  7143. {
  7144. ActionResult actionResult = new ActionResult();
  7145. try
  7146. {
  7147. // 验证请求头信息
  7148. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7149. // 验证失败
  7150. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7151. {
  7152. return actionResult;
  7153. }
  7154. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7155. copies, printerID, sUserInfo);
  7156. if (sre.Status != Constant.ServiceResultStatus.Success)
  7157. {
  7158. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7159. actionResult.Message = sre.Message;
  7160. return actionResult;
  7161. }
  7162. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7163. actionResult.Status = (int)Constant.PDAResult.Success;
  7164. }
  7165. catch (Exception ex)
  7166. {
  7167. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7168. OutputLog.TraceLog(LogPriority.Error,
  7169. this.ToString(),
  7170. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7171. ex.ToString(),
  7172. LocalPath.LogExePath);
  7173. actionResult.Status = (int)Constant.PDAResult.Exception;
  7174. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7175. }
  7176. return actionResult;
  7177. }
  7178. #endregion PDA条码打印
  7179. #region 统计报表
  7180. /// <summary>
  7181. /// 成型结算报表
  7182. /// </summary>
  7183. /// <param name="accountCode"></param>
  7184. /// <param name="userCode"></param>
  7185. /// <param name="userPassword"></param>
  7186. /// <param name="sessionKey"></param>
  7187. /// <returns></returns>
  7188. public ActionResult GetGroutingSettlementInfoGet(string accountCode, string userCode, string userPassword, string sessionKey,
  7189. int currentMonth)
  7190. {
  7191. ActionResult actionResult = new ActionResult();
  7192. try
  7193. {
  7194. // 验证请求头信息
  7195. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7196. // 验证失败
  7197. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7198. {
  7199. return actionResult;
  7200. }
  7201. DateTime date = DateTime.Now;
  7202. if (currentMonth != 1)
  7203. {
  7204. date = date.AddMonths(-1);
  7205. }
  7206. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7207. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7208. if (resultEntity == null || resultEntity.Data == null)
  7209. {
  7210. actionResult.Status = (int)Constant.PDAResult.Fail;
  7211. actionResult.Message = "查询失败";
  7212. return actionResult;
  7213. }
  7214. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7215. {
  7216. actionResult.Status = (int)Constant.PDAResult.Fail;
  7217. actionResult.Message = resultEntity.Message;
  7218. return actionResult;
  7219. }
  7220. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7221. actionResult.Status = (int)Constant.PDAResult.Success;
  7222. }
  7223. catch (Exception ex)
  7224. {
  7225. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7226. OutputLog.TraceLog(LogPriority.Error,
  7227. this.ToString(),
  7228. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7229. ex.ToString(),
  7230. LocalPath.LogExePath);
  7231. actionResult.Status = (int)Constant.PDAResult.Exception;
  7232. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7233. }
  7234. return actionResult;
  7235. }
  7236. #endregion
  7237. #region 设置当期用户默认打印机配置
  7238. /// <summary>
  7239. /// 设置当期用户默认打印机配置
  7240. /// </summary>
  7241. /// <param name="accountCode"></param>
  7242. /// <param name="userCode"></param>
  7243. /// <param name="userPassword"></param>
  7244. /// <param name="sessionKey"></param>
  7245. /// <param name="printerID"></param>
  7246. /// <returns></returns>
  7247. public ActionResult SetCurrentUserPrinterGet(string accountCode, string userCode, string userPassword, string sessionKey,
  7248. int printerID)
  7249. {
  7250. ActionResult actionResult = new ActionResult();
  7251. try
  7252. {
  7253. // 验证请求头信息
  7254. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7255. // 验证失败
  7256. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7257. {
  7258. return actionResult;
  7259. }
  7260. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7261. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7262. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7263. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7264. {
  7265. actionResult.Status = (int)Constant.PDAResult.Fail;
  7266. }
  7267. else
  7268. {
  7269. actionResult.Status = (int)Constant.PDAResult.Success;
  7270. }
  7271. actionResult.Message = resultEntity.Message;
  7272. }
  7273. catch (Exception ex)
  7274. {
  7275. OutputLog.TraceLog(LogPriority.Error,
  7276. this.ToString(),
  7277. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7278. ex.ToString(),
  7279. LocalPath.LogExePath);
  7280. actionResult.Status = (int)Constant.PDAResult.Exception;
  7281. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7282. }
  7283. return actionResult;
  7284. }
  7285. /// <summary>
  7286. /// 校验产品条码是否可以进行回收
  7287. /// </summary>
  7288. /// <param name="accountCode">帐套code</param>
  7289. /// <param name="userCode">用户code</param>
  7290. /// <param name="userPassword">用户密码</param>
  7291. /// <param name="sessionKey">本次登陆密钥</param>
  7292. /// <param name="procedureID">工序ID</param>
  7293. /// <param name="barcode">条码</param>
  7294. /// <returns></returns>
  7295. /// <remarks>
  7296. /// 王鑫 2017.7.21 新建
  7297. /// </remarks>
  7298. public ActionResult CheckRecydingFlagBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7299. {
  7300. ActionResult actionResult = new ActionResult();
  7301. try
  7302. {
  7303. // 验证请求头信息
  7304. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7305. // 验证失败
  7306. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7307. {
  7308. return actionResult;
  7309. }
  7310. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7311. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7312. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7313. {
  7314. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7315. actionResult.Status = (int)Constant.PDAResult.Success;
  7316. }
  7317. else
  7318. {
  7319. actionResult.Status = (int)Constant.PDAResult.Fail;
  7320. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7321. }
  7322. }
  7323. catch (Exception ex)
  7324. {
  7325. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7326. OutputLog.TraceLog(LogPriority.Error,
  7327. this.ToString(),
  7328. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7329. ex.ToString(),
  7330. LocalPath.LogExePath);
  7331. actionResult.Status = (int)Constant.PDAResult.Exception;
  7332. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7333. }
  7334. return actionResult;
  7335. }
  7336. /// <summary>
  7337. /// 获取回收标识
  7338. /// </summary>
  7339. /// <param name="accountCode"></param>
  7340. /// <param name="userCode"></param>
  7341. /// <param name="userPassword"></param>
  7342. /// <param name="sessionKey"></param>
  7343. /// <param name="usercode">工号编码</param>
  7344. /// <returns></returns>
  7345. public ActionResult GetRecyclingflagByBarcodeGet(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7346. {
  7347. ActionResult actionResult = new ActionResult();
  7348. try
  7349. {
  7350. // 验证请求头信息
  7351. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7352. // 验证失败
  7353. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7354. {
  7355. return actionResult;
  7356. }
  7357. int returnValue = ServiceInvoker.Invoke<int>(this,
  7358. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7359. actionResult.Result = JsonHelper.ToJson(returnValue);
  7360. actionResult.Status = (int)Constant.PDAResult.Success;
  7361. }
  7362. catch (Exception ex)
  7363. {
  7364. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7365. OutputLog.TraceLog(LogPriority.Error,
  7366. this.ToString(),
  7367. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7368. ex.ToString(),
  7369. LocalPath.LogExePath);
  7370. actionResult.Status = (int)Constant.PDAResult.Exception;
  7371. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7372. }
  7373. return actionResult;
  7374. }
  7375. #endregion
  7376. #region 注浆盘点
  7377. /// <summary>
  7378. /// 获取注浆盘点单列表
  7379. /// </summary>
  7380. /// <param name="sUserInfo"></param>
  7381. /// <returns></returns>
  7382. public ActionResult GetAllGBCheckedGet(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7383. {
  7384. ActionResult actionResult = new ActionResult();
  7385. try
  7386. {
  7387. // 验证请求头信息
  7388. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7389. // 验证失败
  7390. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7391. {
  7392. return actionResult;
  7393. }
  7394. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7395. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7396. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7397. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7398. actionResult.Result = JsonHelper.ToJson(ds);
  7399. actionResult.Status = (int)Constant.PDAResult.Success;
  7400. }
  7401. catch (Exception ex)
  7402. {
  7403. string json = JsonHelper.ToJson(entity);
  7404. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7405. OutputLog.TraceLog(LogPriority.Error,
  7406. this.ToString(),
  7407. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7408. ex.ToString(),
  7409. LocalPath.LogExePath);
  7410. actionResult.Status = (int)Constant.PDAResult.Exception;
  7411. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7412. }
  7413. return actionResult;
  7414. }
  7415. /// <summary>
  7416. /// 进行盘点操作
  7417. /// </summary>
  7418. /// <param name="accountCode"></param>
  7419. /// <param name="userCode"></param>
  7420. /// <param name="userPassword"></param>
  7421. /// <param name="sessionKey"></param>
  7422. /// <param name="InCheckedID">盘点单ID</param>
  7423. /// <param name="BarCode">产品条码</param>
  7424. /// <returns></returns>
  7425. public ActionResult UpdateGBCheckedGet(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7426. {
  7427. ActionResult actionResult = new ActionResult();
  7428. try
  7429. {
  7430. // 验证请求头信息
  7431. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7432. // 验证失败
  7433. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7434. {
  7435. return actionResult;
  7436. }
  7437. ClientRequestEntity cre = new ClientRequestEntity();
  7438. cre.Properties["CheckedID"] = CheckedID;
  7439. cre.Properties["Barcode"] = BarCode;
  7440. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7441. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7442. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7443. {
  7444. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7445. actionResult.Status = (int)Constant.PDAResult.Success;
  7446. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7447. }
  7448. else
  7449. {
  7450. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7451. actionResult.Status = (int)Constant.PDAResult.Fail;
  7452. actionResult.Message = returnValue.Message;
  7453. }
  7454. }
  7455. catch (Exception ex)
  7456. {
  7457. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7458. OutputLog.TraceLog(LogPriority.Error,
  7459. this.ToString(),
  7460. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7461. ex.ToString(),
  7462. LocalPath.LogExePath);
  7463. actionResult.Status = (int)Constant.PDAResult.Exception;
  7464. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7465. }
  7466. return actionResult;
  7467. }
  7468. /// <summary>
  7469. /// 获取盘点单明细
  7470. /// </summary>
  7471. /// <param name="sUserInfo"></param>
  7472. /// <returns></returns>
  7473. public ActionResult GetUpdateGBCheckedInfoGet(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7474. {
  7475. ActionResult actionResult = new ActionResult();
  7476. try
  7477. {
  7478. // 验证请求头信息
  7479. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7480. // 验证失败
  7481. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7482. {
  7483. return actionResult;
  7484. }
  7485. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7486. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  7487. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  7488. actionResult.Result = JsonHelper.ToJson(ds);
  7489. actionResult.Status = (int)Constant.PDAResult.Success;
  7490. }
  7491. catch (Exception ex)
  7492. {
  7493. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7494. OutputLog.TraceLog(LogPriority.Error,
  7495. this.ToString(),
  7496. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7497. ex.ToString(),
  7498. LocalPath.LogExePath);
  7499. actionResult.Status = (int)Constant.PDAResult.Exception;
  7500. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7501. }
  7502. return actionResult;
  7503. }
  7504. #endregion
  7505. #region 模具盘点
  7506. /// <summary>
  7507. /// 获取模具盘点单列表
  7508. /// </summary>
  7509. /// <param name="sUserInfo"></param>
  7510. /// <returns></returns>
  7511. public ActionResult GetAllMouldCheckedGet(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7512. {
  7513. ActionResult actionResult = new ActionResult();
  7514. try
  7515. {
  7516. // 验证请求头信息
  7517. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7518. // 验证失败
  7519. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7520. {
  7521. return actionResult;
  7522. }
  7523. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7524. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7525. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7526. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  7527. actionResult.Result = JsonHelper.ToJson(ds);
  7528. actionResult.Status = (int)Constant.PDAResult.Success;
  7529. }
  7530. catch (Exception ex)
  7531. {
  7532. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7533. OutputLog.TraceLog(LogPriority.Error,
  7534. this.ToString(),
  7535. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7536. ex.ToString(),
  7537. LocalPath.LogExePath);
  7538. actionResult.Status = (int)Constant.PDAResult.Exception;
  7539. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7540. }
  7541. return actionResult;
  7542. }
  7543. /// <summary>
  7544. /// 进行盘点操作
  7545. /// </summary>
  7546. /// <param name="accountCode"></param>
  7547. /// <param name="userCode"></param>
  7548. /// <param name="userPassword"></param>
  7549. /// <param name="sessionKey"></param>
  7550. /// <param name="InCheckedID">盘点单ID</param>
  7551. /// <param name="BarCode">产品条码</param>
  7552. /// <returns></returns>
  7553. public ActionResult UpdateMouldCheckedGet(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7554. {
  7555. ActionResult actionResult = new ActionResult();
  7556. try
  7557. {
  7558. // 验证请求头信息
  7559. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7560. // 验证失败
  7561. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7562. {
  7563. return actionResult;
  7564. }
  7565. ClientRequestEntity cre = new ClientRequestEntity();
  7566. cre.Properties["CheckedID"] = CheckedID;
  7567. cre.Properties["Barcode"] = BarCode;
  7568. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7569. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  7570. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7571. {
  7572. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7573. actionResult.Status = (int)Constant.PDAResult.Success;
  7574. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7575. }
  7576. else
  7577. {
  7578. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7579. actionResult.Status = (int)Constant.PDAResult.Fail;
  7580. actionResult.Message = returnValue.Message;
  7581. }
  7582. }
  7583. catch (Exception ex)
  7584. {
  7585. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7586. OutputLog.TraceLog(LogPriority.Error,
  7587. this.ToString(),
  7588. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7589. ex.ToString(),
  7590. LocalPath.LogExePath);
  7591. actionResult.Status = (int)Constant.PDAResult.Exception;
  7592. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7593. }
  7594. return actionResult;
  7595. }
  7596. /// <summary>
  7597. /// 获取盘点单明细
  7598. /// </summary>
  7599. /// <param name="sUserInfo"></param>
  7600. /// <returns></returns>
  7601. public ActionResult GetUpdateMouldCheckedInfoGet(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7602. {
  7603. ActionResult actionResult = new ActionResult();
  7604. try
  7605. {
  7606. // 验证请求头信息
  7607. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7608. // 验证失败
  7609. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7610. {
  7611. return actionResult;
  7612. }
  7613. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7614. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  7615. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  7616. actionResult.Result = JsonHelper.ToJson(ds);
  7617. actionResult.Status = (int)Constant.PDAResult.Success;
  7618. }
  7619. catch (Exception ex)
  7620. {
  7621. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7622. OutputLog.TraceLog(LogPriority.Error,
  7623. this.ToString(),
  7624. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7625. ex.ToString(),
  7626. LocalPath.LogExePath);
  7627. actionResult.Status = (int)Constant.PDAResult.Exception;
  7628. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7629. }
  7630. return actionResult;
  7631. }
  7632. #endregion
  7633. #region 通用接口
  7634. /// <summary>
  7635. /// PDA调用通用接口
  7636. /// </summary>
  7637. /// <param name="accountCode"></param>
  7638. /// <param name="userCode"></param>
  7639. /// <param name="userPassword"></param>
  7640. /// <param name="sessionKey"></param>
  7641. /// <param name="module"></param>
  7642. /// <param name="action"></param>
  7643. /// <param name="data"></param>
  7644. /// <returns></returns>
  7645. public ActionResult DoActionGet(string accountCode, string userCode, string userPassword, string sessionKey,
  7646. string module, string action, string jsonData)
  7647. {
  7648. ActionResult actionResult = null;
  7649. try
  7650. {
  7651. // 验证请求头信息
  7652. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7653. // 验证失败
  7654. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7655. {
  7656. return actionResult;
  7657. }
  7658. actionResult.Status = (int)Constant.PDAResult.Fail;
  7659. Dictionary<string, object> data = null;
  7660. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  7661. {
  7662. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  7663. }
  7664. #region PDA报表
  7665. if (module == "Report")
  7666. {
  7667. // 成型月度结算
  7668. if (action == "GetGroutingSettlementInfo")
  7669. {
  7670. DateTime month = DateTime.Now;
  7671. month = new DateTime(month.Year, month.Month, 1);
  7672. //month = new DateTime(2017, 6, 1);
  7673. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7674. if (currentMonth != 1)
  7675. {
  7676. month = month.AddMonths(-1);
  7677. }
  7678. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  7679. if (sre.Status == Constant.ServiceResultStatus.Success)
  7680. {
  7681. actionResult.Status = (int)Constant.PDAResult.Success;
  7682. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7683. }
  7684. else
  7685. {
  7686. actionResult.Status = (int)Constant.PDAResult.Fail;
  7687. actionResult.Message = sre.Message;
  7688. }
  7689. return actionResult;
  7690. }
  7691. // 成型月度结算-明细
  7692. if (action == "GetGroutingSettlementDetail")
  7693. {
  7694. DateTime month = DateTime.Now;
  7695. month = new DateTime(month.Year, month.Month, 1);
  7696. //month = new DateTime(2017, 6, 1);
  7697. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7698. if (currentMonth != 1)
  7699. {
  7700. month = month.AddMonths(-1);
  7701. }
  7702. string goodsCode = data["GoodsCode"].ToString();
  7703. string detailDate = data["DetailDate"].ToString();
  7704. DateTime? date = null;
  7705. if (detailDate != "合计")
  7706. {
  7707. date = DateTime.Parse(detailDate);
  7708. }
  7709. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  7710. if (sre.Status == Constant.ServiceResultStatus.Success)
  7711. {
  7712. actionResult.Status = (int)Constant.PDAResult.Success;
  7713. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7714. }
  7715. else
  7716. {
  7717. actionResult.Status = (int)Constant.PDAResult.Fail;
  7718. actionResult.Message = sre.Message;
  7719. }
  7720. return actionResult;
  7721. }
  7722. // 产成品交接汇总
  7723. if (action == "GetFinishedProductHandoverSum")
  7724. {
  7725. DateTime date = DateTime.Parse(data["date"].ToString());
  7726. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  7727. data["goodscode"] as string, sUserInfo);
  7728. if (sre.Status == Constant.ServiceResultStatus.Success)
  7729. {
  7730. actionResult.Status = (int)Constant.PDAResult.Success;
  7731. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7732. }
  7733. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  7734. {
  7735. actionResult.Status = (int)Constant.PDAResult.Success;
  7736. }
  7737. else
  7738. {
  7739. actionResult.Status = (int)Constant.PDAResult.Fail;
  7740. actionResult.Message = sre.Message;
  7741. }
  7742. return actionResult;
  7743. }
  7744. //xuwei add 2019-10-21
  7745. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  7746. if (action == "GetSemiReworkDayCount")
  7747. {
  7748. //不指定参数查询当天
  7749. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  7750. //dateStr = "2019-10-17";
  7751. //指定参数查询特定日期
  7752. if(data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  7753. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  7754. if (sre.Status == Constant.ServiceResultStatus.Success)
  7755. {
  7756. actionResult.Status = (int)Constant.PDAResult.Success;
  7757. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7758. }
  7759. else
  7760. {
  7761. actionResult.Status = (int)Constant.PDAResult.Fail;
  7762. actionResult.Message = sre.Message;
  7763. }
  7764. return actionResult;
  7765. }
  7766. //xuwe end
  7767. return actionResult;
  7768. }
  7769. #endregion
  7770. #region 模具管理
  7771. if (module == "PC_Mould")
  7772. {
  7773. #region 模具新建画面数据初始化
  7774. if (action == "GetMouldAddInit")
  7775. {
  7776. ClientRequestEntity cre = new ClientRequestEntity();
  7777. cre.Properties["MouldID"] = 0;
  7778. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  7779. if (sre.Status == Constant.ServiceResultStatus.Success)
  7780. {
  7781. actionResult.Status = (int)Constant.PDAResult.Success;
  7782. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7783. }
  7784. else
  7785. {
  7786. actionResult.Status = (int)Constant.PDAResult.Fail;
  7787. actionResult.Message = sre.Message;
  7788. }
  7789. return actionResult;
  7790. }
  7791. #endregion
  7792. #region 验证模具产品型号
  7793. if (action == "CheckGoodsCodeOnMould")
  7794. {
  7795. ClientRequestEntity cre = new ClientRequestEntity();
  7796. cre.Properties["GoodsCode"] = data["GoodsCode"];
  7797. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  7798. if (sre.Status == Constant.ServiceResultStatus.Success &&
  7799. sre.Data.Tables[0].Rows.Count > 0)
  7800. {
  7801. actionResult.Status = (int)Constant.PDAResult.Success;
  7802. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7803. }
  7804. else
  7805. {
  7806. actionResult.Status = (int)Constant.PDAResult.Fail;
  7807. actionResult.Message = "无效产品型号";
  7808. }
  7809. return actionResult;
  7810. }
  7811. #endregion
  7812. #region 验证模具生产工号
  7813. if (action == "CheckUserCodeOnMould")
  7814. {
  7815. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  7816. if (sre != null && sre.Rows.Count > 0)
  7817. {
  7818. actionResult.Status = (int)Constant.PDAResult.Success;
  7819. actionResult.Result = JsonHelper.ToJson(sre);
  7820. }
  7821. else
  7822. {
  7823. actionResult.Status = (int)Constant.PDAResult.Fail;
  7824. actionResult.Message = "无效生产工号";
  7825. }
  7826. return actionResult;
  7827. }
  7828. #endregion
  7829. #region 新建保存
  7830. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  7831. {
  7832. ClientRequestEntity cre = new ClientRequestEntity();
  7833. foreach (string item in data.Keys)
  7834. {
  7835. if (item == "ProductionDate")
  7836. {
  7837. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  7838. }
  7839. else
  7840. {
  7841. cre.Properties.Add(item, data[item]);
  7842. }
  7843. }
  7844. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  7845. if (sre.Status == Constant.ServiceResultStatus.Success)
  7846. {
  7847. actionResult.Status = (int)Constant.PDAResult.Success;
  7848. }
  7849. else
  7850. {
  7851. actionResult.Status = (int)Constant.PDAResult.Fail;
  7852. actionResult.Result = sre.OtherStatus;
  7853. actionResult.Message = sre.Message;
  7854. }
  7855. return actionResult;
  7856. }
  7857. #endregion
  7858. #region 模具编辑画面数据初始化
  7859. if (action == "GetMouldEditInfo")
  7860. {
  7861. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  7862. if (sre != null && sre.Rows.Count > 0)
  7863. {
  7864. actionResult.Status = (int)Constant.PDAResult.Success;
  7865. actionResult.Result = JsonHelper.ToJson(sre);
  7866. }
  7867. else
  7868. {
  7869. actionResult.Status = (int)Constant.PDAResult.Fail;
  7870. actionResult.Message = "无效模具条码";
  7871. }
  7872. return actionResult;
  7873. }
  7874. #endregion
  7875. #region 模具操作-画面初始化
  7876. if (action == "GetMouldOperationInit")
  7877. {
  7878. ClientRequestEntity cre = new ClientRequestEntity();
  7879. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  7880. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  7881. if (sre.Status == Constant.ServiceResultStatus.Success)
  7882. {
  7883. actionResult.Status = (int)Constant.PDAResult.Success;
  7884. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7885. }
  7886. else
  7887. {
  7888. actionResult.Status = (int)Constant.PDAResult.Fail;
  7889. actionResult.Result = sre.OtherStatus;
  7890. actionResult.Message = sre.Message;
  7891. }
  7892. return actionResult;
  7893. }
  7894. #endregion
  7895. #region 模具操作-验证模具条码
  7896. if (action == "CheckMouldBarcode")
  7897. {
  7898. ClientRequestEntity cre = new ClientRequestEntity();
  7899. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  7900. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  7901. if (sre.Status == Constant.ServiceResultStatus.Success)
  7902. {
  7903. if (sre.Data.Tables[0].Rows.Count == 0)
  7904. {
  7905. actionResult.Status = (int)Constant.PDAResult.Fail;
  7906. actionResult.Result = -1;
  7907. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  7908. return actionResult;
  7909. }
  7910. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  7911. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  7912. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  7913. #region 报损
  7914. if (mouldOperationType == 2)
  7915. {
  7916. if (mouldStatusID == 1 || mouldStatusID == 3)
  7917. {
  7918. actionResult.Status = (int)Constant.PDAResult.Success;
  7919. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7920. }
  7921. else
  7922. {
  7923. actionResult.Status = (int)Constant.PDAResult.Fail;
  7924. actionResult.Result = -2;
  7925. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  7926. }
  7927. return actionResult;
  7928. }
  7929. #endregion
  7930. #region 撤销
  7931. if (mouldOperationType == 3)
  7932. {
  7933. if (mouldStatusID == 4)
  7934. {
  7935. actionResult.Status = (int)Constant.PDAResult.Success;
  7936. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7937. }
  7938. else
  7939. {
  7940. actionResult.Status = (int)Constant.PDAResult.Fail;
  7941. actionResult.Result = -2;
  7942. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  7943. }
  7944. return actionResult;
  7945. }
  7946. #endregion
  7947. #region 领用
  7948. if (mouldOperationType == 4)
  7949. {
  7950. if (mouldStatusID == 1)
  7951. {
  7952. actionResult.Status = (int)Constant.PDAResult.Success;
  7953. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7954. }
  7955. else
  7956. {
  7957. actionResult.Status = (int)Constant.PDAResult.Fail;
  7958. actionResult.Result = -2;
  7959. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  7960. }
  7961. return actionResult;
  7962. }
  7963. #endregion
  7964. #region 回收
  7965. if (mouldOperationType == 5)
  7966. {
  7967. if (mouldStatusID == 3)
  7968. {
  7969. actionResult.Status = (int)Constant.PDAResult.Success;
  7970. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7971. }
  7972. else
  7973. {
  7974. actionResult.Status = (int)Constant.PDAResult.Fail;
  7975. actionResult.Result = -2;
  7976. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  7977. }
  7978. return actionResult;
  7979. }
  7980. #endregion
  7981. #region 变更型号
  7982. if (mouldOperationType == -1)
  7983. {
  7984. if (mouldStatusID != 4)
  7985. {
  7986. actionResult.Status = (int)Constant.PDAResult.Success;
  7987. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7988. }
  7989. else
  7990. {
  7991. actionResult.Status = (int)Constant.PDAResult.Fail;
  7992. actionResult.Result = -2;
  7993. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  7994. }
  7995. return actionResult;
  7996. }
  7997. #endregion
  7998. #region 替换条码
  7999. if (mouldOperationType == -2)
  8000. {
  8001. actionResult.Status = (int)Constant.PDAResult.Success;
  8002. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8003. return actionResult;
  8004. }
  8005. #endregion
  8006. return actionResult;
  8007. }
  8008. }
  8009. #endregion
  8010. #region 模具操作-保存
  8011. if (action == "SetMouldOperation")
  8012. {
  8013. ClientRequestEntity cre = new ClientRequestEntity();
  8014. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8015. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8016. cre.Properties["Remarks"] = data["Remarks"];
  8017. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8018. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8019. {
  8020. cre.Properties["GoodsID"] = data["GoodsID"];
  8021. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8022. }
  8023. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8024. {
  8025. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8026. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8027. }
  8028. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8029. if (sre.Status == Constant.ServiceResultStatus.Success)
  8030. {
  8031. actionResult.Status = (int)Constant.PDAResult.Success;
  8032. }
  8033. else
  8034. {
  8035. actionResult.Status = (int)Constant.PDAResult.Fail;
  8036. }
  8037. return actionResult;
  8038. }
  8039. #endregion
  8040. #region 模具操作-替换条码
  8041. if (action == "ChangedMouldBarcode")
  8042. {
  8043. ClientRequestEntity cre = new ClientRequestEntity();
  8044. cre.Properties["MouldID"] = data["MouldID"];
  8045. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8046. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8047. cre.Properties["Remarks"] = data["Remarks"];
  8048. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8049. if (sre.Status == Constant.ServiceResultStatus.Success)
  8050. {
  8051. actionResult.Status = (int)Constant.PDAResult.Success;
  8052. }
  8053. else
  8054. {
  8055. actionResult.Status = (int)Constant.PDAResult.Fail;
  8056. actionResult.Result = sre.OtherStatus;
  8057. actionResult.Message = sre.Message;
  8058. }
  8059. return actionResult;
  8060. }
  8061. #endregion
  8062. #region 模具跟踪表
  8063. if (action == "GetMoldTracking")
  8064. {
  8065. ClientRequestEntity cre = new ClientRequestEntity();
  8066. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8067. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8068. if (sre.Status == Constant.ServiceResultStatus.Success)
  8069. {
  8070. actionResult.Status = (int)Constant.PDAResult.Success;
  8071. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8072. }
  8073. else
  8074. {
  8075. actionResult.Status = (int)Constant.PDAResult.Fail;
  8076. actionResult.Message = "此模具条码不存在";
  8077. }
  8078. return actionResult;
  8079. }
  8080. #endregion
  8081. return actionResult;
  8082. }
  8083. #endregion
  8084. #region 成型线模具管理
  8085. if (module == "PC_GroutingLineMould")
  8086. {
  8087. #region 获取当前用户成型线模具管理权限
  8088. if (action == "GetGMouldStatusRight")
  8089. {
  8090. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8091. actionResult.Status = (int)Constant.PDAResult.Success;
  8092. if (right != null && right.Rows.Count > 0)
  8093. {
  8094. actionResult.Result = JsonHelper.ToJson(right);
  8095. }
  8096. return actionResult;
  8097. }
  8098. #endregion
  8099. #region 获取成型线状态等信息,和成型模具信息
  8100. if (action == "GetGroutingLineMould")
  8101. {
  8102. int? groutingLineID = null;
  8103. string groutingLineCode = null;
  8104. if (data.ContainsKey("GroutingLineID"))
  8105. {
  8106. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8107. }
  8108. else
  8109. {
  8110. groutingLineCode = data["GroutingLineCode"] + "";
  8111. }
  8112. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8113. if (lineInfo == null)
  8114. {
  8115. actionResult.Status = (int)Constant.PDAResult.Fail;
  8116. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8117. }
  8118. else
  8119. {
  8120. actionResult.Status = (int)Constant.PDAResult.Success;
  8121. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8122. }
  8123. return actionResult;
  8124. }
  8125. #endregion
  8126. #region 模具操作-画面初始化
  8127. if (action == "GetMouldOperationInit")
  8128. {
  8129. ClientRequestEntity cre = new ClientRequestEntity();
  8130. cre.Properties["MouldOperationType"] = 2;
  8131. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8132. if (sre.Status == Constant.ServiceResultStatus.Success)
  8133. {
  8134. actionResult.Status = (int)Constant.PDAResult.Success;
  8135. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8136. }
  8137. else
  8138. {
  8139. actionResult.Status = (int)Constant.PDAResult.Fail;
  8140. actionResult.Result = sre.OtherStatus;
  8141. actionResult.Message = sre.Message;
  8142. }
  8143. return actionResult;
  8144. }
  8145. #endregion
  8146. #region 成型模具操作-画面初始化
  8147. if (action == "GetGroutingMouldOperationInit")
  8148. {
  8149. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8150. if (initData != null && initData.Rows.Count > 0)
  8151. {
  8152. actionResult.Status = (int)Constant.PDAResult.Success;
  8153. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8154. foreach (DataRow item in initData.Rows)
  8155. {
  8156. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8157. }
  8158. actionResult.Result = JsonHelper.ToJson(syssetting);
  8159. }
  8160. else
  8161. {
  8162. actionResult.Status = (int)Constant.PDAResult.Fail;
  8163. }
  8164. return actionResult;
  8165. }
  8166. #endregion
  8167. #region 模具操作-验证模具条码
  8168. if (action == "CheckMouldBarcode")
  8169. {
  8170. ClientRequestEntity cre = new ClientRequestEntity();
  8171. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8172. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8173. if (sre.Status == Constant.ServiceResultStatus.Success)
  8174. {
  8175. if (sre.Data.Tables[0].Rows.Count == 0)
  8176. {
  8177. actionResult.Status = (int)Constant.PDAResult.Fail;
  8178. actionResult.Result = -1;
  8179. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8180. return actionResult;
  8181. }
  8182. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8183. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8184. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8185. #region 上线
  8186. if (mouldOperationType == 6)
  8187. {
  8188. if (mouldStatusID == 1 || mouldStatusID == 3)
  8189. {
  8190. if (data.ContainsKey("GoodsID"))
  8191. {
  8192. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8193. {
  8194. actionResult.Status = (int)Constant.PDAResult.Fail;
  8195. actionResult.Result = -3;
  8196. actionResult.Message =
  8197. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8198. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8199. "】与当前不一致";
  8200. return actionResult;
  8201. }
  8202. }
  8203. actionResult.Status = (int)Constant.PDAResult.Success;
  8204. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8205. }
  8206. else
  8207. {
  8208. actionResult.Status = (int)Constant.PDAResult.Fail;
  8209. actionResult.Result = -2;
  8210. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8211. }
  8212. return actionResult;
  8213. }
  8214. #endregion
  8215. return actionResult;
  8216. }
  8217. }
  8218. #endregion
  8219. #region 停用
  8220. if (action == "StopGroutingLineDetail")
  8221. {
  8222. if (data == null || !data.ContainsKey("Details"))
  8223. {
  8224. actionResult.Status = (int)Constant.PDAResult.Fail;
  8225. actionResult.Message = "参数错误";
  8226. return actionResult;
  8227. }
  8228. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8229. DataTable gTable = new DataTable();
  8230. gTable.Columns.Add("GroutingLineID", typeof(int));
  8231. gTable.Columns.Add("GroutingLineCode");
  8232. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8233. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8234. gTable.Columns.Add("GroutingMouldCode");
  8235. gTable.Columns.Add("RecordRemarks");
  8236. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8237. gTable.Columns.Add("MouldID", typeof(int));
  8238. gTable.Columns.Add("MouldCode");
  8239. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8240. string groutingLineCode = data["GroutingLineCode"] + "";
  8241. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8242. foreach (Dictionary<string, object> item in details)
  8243. {
  8244. int? mouldID = null;
  8245. if (item.ContainsKey("MouldID"))
  8246. {
  8247. mouldID = Convert.ToInt32(item["MouldID"]);
  8248. if (mouldID == 0)
  8249. {
  8250. mouldID = null;
  8251. }
  8252. }
  8253. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8254. item["GLineDetailID"], item["GLineDetailCode"],
  8255. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8256. mouldID, item["MouldCode"]);
  8257. }
  8258. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8259. if (result > 0)
  8260. {
  8261. actionResult.Status = (int)Constant.PDAResult.Success;
  8262. }
  8263. else
  8264. {
  8265. actionResult.Status = (int)Constant.PDAResult.Fail;
  8266. actionResult.Result = result;
  8267. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8268. return actionResult;
  8269. }
  8270. return actionResult;
  8271. }
  8272. #endregion
  8273. #region 启用
  8274. if (action == "StartGroutingLineDetail")
  8275. {
  8276. if (data == null || !data.ContainsKey("Details"))
  8277. {
  8278. actionResult.Status = (int)Constant.PDAResult.Fail;
  8279. actionResult.Message = "参数错误";
  8280. return actionResult;
  8281. }
  8282. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8283. DataTable gTable = new DataTable();
  8284. gTable.Columns.Add("GroutingLineID", typeof(int));
  8285. gTable.Columns.Add("GroutingLineCode");
  8286. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8287. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8288. gTable.Columns.Add("GroutingMouldCode");
  8289. gTable.Columns.Add("RecordRemarks");
  8290. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8291. gTable.Columns.Add("MouldID", typeof(int));
  8292. gTable.Columns.Add("MouldCode");
  8293. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8294. string groutingLineCode = data["GroutingLineCode"] + "";
  8295. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8296. foreach (Dictionary<string, object> item in details)
  8297. {
  8298. int? mouldID = null;
  8299. if (item.ContainsKey("MouldID"))
  8300. {
  8301. mouldID = Convert.ToInt32(item["MouldID"]);
  8302. if (mouldID == 0)
  8303. {
  8304. mouldID = null;
  8305. }
  8306. }
  8307. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8308. item["GLineDetailID"], item["GLineDetailCode"],
  8309. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8310. mouldID, item["MouldCode"]);
  8311. }
  8312. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8313. if (result > 0)
  8314. {
  8315. actionResult.Status = (int)Constant.PDAResult.Success;
  8316. }
  8317. else
  8318. {
  8319. actionResult.Status = (int)Constant.PDAResult.Fail;
  8320. actionResult.Result = result;
  8321. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8322. return actionResult;
  8323. }
  8324. return actionResult;
  8325. }
  8326. #endregion
  8327. #region 维修
  8328. if (action == "RepairStartGroutingLineDetail")
  8329. {
  8330. if (data == null || !data.ContainsKey("Details"))
  8331. {
  8332. actionResult.Status = (int)Constant.PDAResult.Fail;
  8333. actionResult.Message = "参数错误";
  8334. return actionResult;
  8335. }
  8336. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8337. DataTable gTable = new DataTable();
  8338. gTable.Columns.Add("GroutingLineID", typeof(int));
  8339. gTable.Columns.Add("GroutingLineCode");
  8340. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8341. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8342. gTable.Columns.Add("GroutingMouldCode");
  8343. gTable.Columns.Add("RecordRemarks");
  8344. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8345. gTable.Columns.Add("MouldID", typeof(int));
  8346. gTable.Columns.Add("MouldCode");
  8347. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8348. string groutingLineCode = data["GroutingLineCode"] + "";
  8349. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8350. foreach (Dictionary<string, object> item in details)
  8351. {
  8352. int? mouldID = null;
  8353. if (item.ContainsKey("MouldID"))
  8354. {
  8355. mouldID = Convert.ToInt32(item["MouldID"]);
  8356. if (mouldID == 0)
  8357. {
  8358. mouldID = null;
  8359. }
  8360. }
  8361. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8362. item["GLineDetailID"], item["GLineDetailCode"],
  8363. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8364. mouldID, item["MouldCode"]);
  8365. }
  8366. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8367. if (result > 0)
  8368. {
  8369. actionResult.Status = (int)Constant.PDAResult.Success;
  8370. }
  8371. else
  8372. {
  8373. actionResult.Status = (int)Constant.PDAResult.Fail;
  8374. actionResult.Result = result;
  8375. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8376. return actionResult;
  8377. }
  8378. return actionResult;
  8379. }
  8380. #endregion
  8381. #region 结束维修
  8382. if (action == "RepairEndGroutingLineDetail")
  8383. {
  8384. if (data == null || !data.ContainsKey("Details"))
  8385. {
  8386. actionResult.Status = (int)Constant.PDAResult.Fail;
  8387. actionResult.Message = "参数错误";
  8388. return actionResult;
  8389. }
  8390. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8391. DataTable gTable = new DataTable();
  8392. gTable.Columns.Add("GroutingLineID", typeof(int));
  8393. gTable.Columns.Add("GroutingLineCode");
  8394. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8395. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8396. gTable.Columns.Add("GroutingMouldCode");
  8397. gTable.Columns.Add("RecordRemarks");
  8398. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8399. gTable.Columns.Add("MouldID", typeof(int));
  8400. gTable.Columns.Add("MouldCode");
  8401. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8402. string groutingLineCode = data["GroutingLineCode"] + "";
  8403. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8404. foreach (Dictionary<string, object> item in details)
  8405. {
  8406. int? mouldID = null;
  8407. if (item.ContainsKey("MouldID"))
  8408. {
  8409. mouldID = Convert.ToInt32(item["MouldID"]);
  8410. if (mouldID == 0)
  8411. {
  8412. mouldID = null;
  8413. }
  8414. }
  8415. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8416. item["GLineDetailID"], item["GLineDetailCode"],
  8417. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8418. mouldID, item["MouldCode"]);
  8419. }
  8420. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8421. if (result > 0)
  8422. {
  8423. actionResult.Status = (int)Constant.PDAResult.Success;
  8424. }
  8425. else
  8426. {
  8427. actionResult.Status = (int)Constant.PDAResult.Fail;
  8428. actionResult.Result = result;
  8429. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8430. return actionResult;
  8431. }
  8432. return actionResult;
  8433. }
  8434. #endregion
  8435. #region 换模
  8436. if (action == "ChangeGMouldStartGroutingLineDetail")
  8437. {
  8438. if (data == null || !data.ContainsKey("Details"))
  8439. {
  8440. actionResult.Status = (int)Constant.PDAResult.Fail;
  8441. actionResult.Message = "参数错误";
  8442. return actionResult;
  8443. }
  8444. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8445. DataTable gTable = new DataTable();
  8446. gTable.Columns.Add("GroutingLineID", typeof(int));
  8447. gTable.Columns.Add("GroutingLineCode");
  8448. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8449. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8450. gTable.Columns.Add("GroutingMouldCode");
  8451. gTable.Columns.Add("RecordRemarks");
  8452. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8453. gTable.Columns.Add("MouldID", typeof(int));
  8454. gTable.Columns.Add("MouldCode");
  8455. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8456. gTable.Columns.Add("MouldStatus", typeof(int));
  8457. gTable.Columns.Add("ScrapReason", typeof(int));
  8458. gTable.Columns.Add("ScrapResponsibility");
  8459. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8460. string groutingLineCode = data["GroutingLineCode"] + "";
  8461. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8462. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8463. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8464. string scrapResponsibility = data["ScrapRemarks"] + "";
  8465. foreach (Dictionary<string, object> item in details)
  8466. {
  8467. int? mouldID = null;
  8468. if (item.ContainsKey("MouldID"))
  8469. {
  8470. mouldID = Convert.ToInt32(item["MouldID"]);
  8471. if (mouldID == 0)
  8472. {
  8473. mouldID = null;
  8474. }
  8475. }
  8476. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8477. item["GLineDetailID"], item["GLineDetailCode"],
  8478. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8479. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8480. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8481. }
  8482. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  8483. if (result > 0)
  8484. {
  8485. actionResult.Status = (int)Constant.PDAResult.Success;
  8486. }
  8487. else
  8488. {
  8489. actionResult.Status = (int)Constant.PDAResult.Fail;
  8490. actionResult.Result = result;
  8491. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8492. return actionResult;
  8493. }
  8494. return actionResult;
  8495. }
  8496. #endregion
  8497. #region 变产
  8498. if (action == "UpdateLineStartGroutingLineDetail")
  8499. {
  8500. if (data == null || !data.ContainsKey("Details"))
  8501. {
  8502. actionResult.Status = (int)Constant.PDAResult.Fail;
  8503. actionResult.Message = "参数错误";
  8504. return actionResult;
  8505. }
  8506. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8507. DataTable gTable = new DataTable();
  8508. gTable.Columns.Add("GroutingLineID", typeof(int));
  8509. gTable.Columns.Add("GroutingLineCode");
  8510. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8511. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8512. gTable.Columns.Add("GroutingMouldCode");
  8513. gTable.Columns.Add("RecordRemarks");
  8514. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8515. gTable.Columns.Add("MouldID", typeof(int));
  8516. gTable.Columns.Add("MouldCode");
  8517. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8518. gTable.Columns.Add("MouldStatus", typeof(int));
  8519. gTable.Columns.Add("ScrapReason", typeof(int));
  8520. gTable.Columns.Add("ScrapResponsibility");
  8521. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8522. string groutingLineCode = data["GroutingLineCode"] + "";
  8523. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8524. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8525. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8526. string scrapResponsibility = data["ScrapRemarks"] + "";
  8527. foreach (Dictionary<string, object> item in details)
  8528. {
  8529. int? mouldID = null;
  8530. if (item.ContainsKey("MouldID"))
  8531. {
  8532. mouldID = Convert.ToInt32(item["MouldID"]);
  8533. if (mouldID == 0)
  8534. {
  8535. mouldID = null;
  8536. }
  8537. }
  8538. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8539. item["GLineDetailID"], item["GLineDetailCode"],
  8540. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8541. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8542. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8543. }
  8544. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  8545. if (result > 0)
  8546. {
  8547. actionResult.Status = (int)Constant.PDAResult.Success;
  8548. }
  8549. else
  8550. {
  8551. actionResult.Status = (int)Constant.PDAResult.Fail;
  8552. actionResult.Result = result;
  8553. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8554. return actionResult;
  8555. }
  8556. return actionResult;
  8557. }
  8558. #endregion
  8559. #region 整线变产
  8560. if (action == "UpdateAllLineStartGroutingLineDetail")
  8561. {
  8562. if (data == null || !data.ContainsKey("Details"))
  8563. {
  8564. actionResult.Status = (int)Constant.PDAResult.Fail;
  8565. actionResult.Message = "参数错误";
  8566. return actionResult;
  8567. }
  8568. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8569. DataTable gTable = new DataTable();
  8570. gTable.Columns.Add("GroutingLineID", typeof(int));
  8571. gTable.Columns.Add("GroutingLineCode");
  8572. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8573. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8574. gTable.Columns.Add("GroutingMouldCode");
  8575. gTable.Columns.Add("RecordRemarks");
  8576. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8577. gTable.Columns.Add("MouldID", typeof(int));
  8578. gTable.Columns.Add("MouldCode");
  8579. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8580. gTable.Columns.Add("MouldStatus", typeof(int));
  8581. gTable.Columns.Add("ScrapReason", typeof(int));
  8582. gTable.Columns.Add("ScrapResponsibility");
  8583. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8584. string groutingLineCode = data["GroutingLineCode"] + "";
  8585. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8586. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8587. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8588. string scrapResponsibility = data["ScrapRemarks"] + "";
  8589. foreach (Dictionary<string, object> item in details)
  8590. {
  8591. int? mouldID = null;
  8592. if (item.ContainsKey("MouldID"))
  8593. {
  8594. mouldID = Convert.ToInt32(item["MouldID"]);
  8595. if (mouldID == 0)
  8596. {
  8597. mouldID = null;
  8598. }
  8599. }
  8600. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8601. item["GLineDetailID"], item["GLineDetailCode"],
  8602. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8603. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8604. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8605. }
  8606. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  8607. if (result > 0)
  8608. {
  8609. actionResult.Status = (int)Constant.PDAResult.Success;
  8610. }
  8611. else
  8612. {
  8613. actionResult.Status = (int)Constant.PDAResult.Fail;
  8614. actionResult.Result = result;
  8615. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8616. return actionResult;
  8617. }
  8618. return actionResult;
  8619. }
  8620. #endregion
  8621. #region 卸模
  8622. if (action == "UnloadGroutingLineDetail")
  8623. {
  8624. if (data == null || !data.ContainsKey("Details"))
  8625. {
  8626. actionResult.Status = (int)Constant.PDAResult.Fail;
  8627. actionResult.Message = "参数错误";
  8628. return actionResult;
  8629. }
  8630. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8631. DataTable gTable = new DataTable();
  8632. gTable.Columns.Add("GroutingLineID", typeof(int));
  8633. gTable.Columns.Add("GroutingLineCode");
  8634. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8635. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8636. gTable.Columns.Add("GroutingMouldCode");
  8637. gTable.Columns.Add("RecordRemarks");
  8638. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8639. gTable.Columns.Add("MouldID", typeof(int));
  8640. gTable.Columns.Add("MouldCode");
  8641. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8642. gTable.Columns.Add("MouldStatus", typeof(int));
  8643. gTable.Columns.Add("ScrapReason", typeof(int));
  8644. gTable.Columns.Add("ScrapResponsibility");
  8645. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8646. string groutingLineCode = data["GroutingLineCode"] + "";
  8647. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8648. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8649. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8650. string scrapResponsibility = data["ScrapRemarks"] + "";
  8651. foreach (Dictionary<string, object> item in details)
  8652. {
  8653. int? mouldID = null;
  8654. if (item.ContainsKey("MouldID"))
  8655. {
  8656. mouldID = Convert.ToInt32(item["MouldID"]);
  8657. if (mouldID == 0)
  8658. {
  8659. mouldID = null;
  8660. }
  8661. }
  8662. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8663. item["GLineDetailID"], item["GLineDetailCode"],
  8664. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8665. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8666. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8667. }
  8668. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  8669. if (result > 0)
  8670. {
  8671. actionResult.Status = (int)Constant.PDAResult.Success;
  8672. }
  8673. else
  8674. {
  8675. actionResult.Status = (int)Constant.PDAResult.Fail;
  8676. actionResult.Result = result;
  8677. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8678. return actionResult;
  8679. }
  8680. return actionResult;
  8681. }
  8682. #endregion
  8683. #region 结束换模
  8684. if (action == "ChangeGMouldEndGroutingLineDetail")
  8685. {
  8686. if (data == null || !data.ContainsKey("Details"))
  8687. {
  8688. actionResult.Status = (int)Constant.PDAResult.Fail;
  8689. actionResult.Message = "参数错误";
  8690. return actionResult;
  8691. }
  8692. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8693. DataTable gTable = new DataTable();
  8694. gTable.Columns.Add("GroutingLineID", typeof(int));
  8695. gTable.Columns.Add("GroutingLineCode");
  8696. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8697. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8698. gTable.Columns.Add("GroutingMouldCode");
  8699. gTable.Columns.Add("RreasonRemarks");
  8700. gTable.Columns.Add("RecordRemarks");
  8701. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8702. gTable.Columns.Add("MouldID", typeof(int));
  8703. gTable.Columns.Add("MouldCode");
  8704. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8705. gTable.Columns.Add("GoodsID", typeof(int));
  8706. gTable.Columns.Add("GoodsCode");
  8707. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8708. gTable.Columns.Add("GroutingCount", typeof(int));
  8709. gTable.Columns.Add("MouldSource");
  8710. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8711. string groutingLineCode = data["GroutingLineCode"] + "";
  8712. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8713. foreach (Dictionary<string, object> item in details)
  8714. {
  8715. int? mouldID = null;
  8716. if (item.ContainsKey("MouldID"))
  8717. {
  8718. mouldID = Convert.ToInt32(item["MouldID"]);
  8719. if (mouldID == 0)
  8720. {
  8721. mouldID = null;
  8722. }
  8723. }
  8724. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8725. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8726. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8727. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8728. item["GoodsID"], item["GoodsCode"],
  8729. item["StandardGroutingCount"], item["GroutingCount"],
  8730. (mouldID == null ? "0" : "1"));
  8731. }
  8732. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  8733. if (result.Status == Constant.ServiceResultStatus.Success)
  8734. {
  8735. actionResult.Status = (int)Constant.PDAResult.Success;
  8736. }
  8737. else if (result.OtherStatus == -100)
  8738. {
  8739. actionResult.Status = (int)Constant.PDAResult.Fail;
  8740. actionResult.Result = -100;
  8741. actionResult.Message = result.Message;
  8742. return actionResult;
  8743. }
  8744. else
  8745. {
  8746. actionResult.Status = (int)Constant.PDAResult.Fail;
  8747. actionResult.Result = -500;
  8748. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8749. return actionResult;
  8750. }
  8751. return actionResult;
  8752. }
  8753. #endregion
  8754. #region 结束变产
  8755. if (action == "UpdateLineEndGroutingLineDetail")
  8756. {
  8757. if (data == null || !data.ContainsKey("Details"))
  8758. {
  8759. actionResult.Status = (int)Constant.PDAResult.Fail;
  8760. actionResult.Message = "参数错误";
  8761. return actionResult;
  8762. }
  8763. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8764. DataTable gTable = new DataTable();
  8765. gTable.Columns.Add("GroutingLineID", typeof(int));
  8766. gTable.Columns.Add("GroutingLineCode");
  8767. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8768. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8769. gTable.Columns.Add("GroutingMouldCode");
  8770. gTable.Columns.Add("RreasonRemarks");
  8771. gTable.Columns.Add("RecordRemarks");
  8772. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8773. gTable.Columns.Add("MouldID", typeof(int));
  8774. gTable.Columns.Add("MouldCode");
  8775. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8776. gTable.Columns.Add("GoodsID", typeof(int));
  8777. gTable.Columns.Add("GoodsCode");
  8778. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8779. gTable.Columns.Add("GroutingCount", typeof(int));
  8780. gTable.Columns.Add("MouldSource");
  8781. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8782. string groutingLineCode = data["GroutingLineCode"] + "";
  8783. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8784. foreach (Dictionary<string, object> item in details)
  8785. {
  8786. int? mouldID = null;
  8787. if (item.ContainsKey("MouldID"))
  8788. {
  8789. mouldID = Convert.ToInt32(item["MouldID"]);
  8790. if (mouldID == 0)
  8791. {
  8792. mouldID = null;
  8793. }
  8794. }
  8795. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8796. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8797. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8798. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8799. item["GoodsID"], item["GoodsCode"],
  8800. item["StandardGroutingCount"], item["GroutingCount"],
  8801. (mouldID == null ? "0" : "1"));
  8802. }
  8803. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  8804. if (result.Status == Constant.ServiceResultStatus.Success)
  8805. {
  8806. actionResult.Status = (int)Constant.PDAResult.Success;
  8807. }
  8808. else if (result.OtherStatus == -100)
  8809. {
  8810. actionResult.Status = (int)Constant.PDAResult.Fail;
  8811. actionResult.Result = -100;
  8812. actionResult.Message = result.Message;
  8813. return actionResult;
  8814. }
  8815. else
  8816. {
  8817. actionResult.Status = (int)Constant.PDAResult.Fail;
  8818. actionResult.Result = -500;
  8819. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8820. return actionResult;
  8821. }
  8822. return actionResult;
  8823. }
  8824. #endregion
  8825. #region 结束整线变产
  8826. if (action == "UpdateAllLineEndGroutingLineDetail")
  8827. {
  8828. if (data == null || !data.ContainsKey("Details"))
  8829. {
  8830. actionResult.Status = (int)Constant.PDAResult.Fail;
  8831. actionResult.Message = "参数错误";
  8832. return actionResult;
  8833. }
  8834. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8835. DataTable gTable = new DataTable();
  8836. gTable.Columns.Add("GroutingLineID", typeof(int));
  8837. gTable.Columns.Add("GroutingLineCode");
  8838. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8839. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8840. gTable.Columns.Add("GroutingMouldCode");
  8841. gTable.Columns.Add("Remarks");
  8842. gTable.Columns.Add("RecordRemarks");
  8843. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8844. gTable.Columns.Add("MouldID", typeof(int));
  8845. gTable.Columns.Add("MouldCode");
  8846. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8847. gTable.Columns.Add("GoodsID", typeof(int));
  8848. gTable.Columns.Add("GoodsCode");
  8849. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8850. gTable.Columns.Add("GroutingCount", typeof(int));
  8851. gTable.Columns.Add("MouldSource");
  8852. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8853. string groutingLineCode = data["GroutingLineCode"] + "";
  8854. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8855. foreach (Dictionary<string, object> item in details)
  8856. {
  8857. int? mouldID = null;
  8858. if (item.ContainsKey("MouldID"))
  8859. {
  8860. mouldID = Convert.ToInt32(item["MouldID"]);
  8861. if (mouldID == 0)
  8862. {
  8863. mouldID = null;
  8864. }
  8865. }
  8866. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8867. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8868. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  8869. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8870. item["GoodsID"], item["GoodsCode"],
  8871. item["StandardGroutingCount"], item["GroutingCount"],
  8872. (mouldID == null ? "0" : "1"));
  8873. }
  8874. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  8875. if (result.Status == Constant.ServiceResultStatus.Success)
  8876. {
  8877. actionResult.Status = (int)Constant.PDAResult.Success;
  8878. }
  8879. else if (result.OtherStatus == -100)
  8880. {
  8881. actionResult.Status = (int)Constant.PDAResult.Fail;
  8882. actionResult.Result = -100;
  8883. actionResult.Message = result.Message;
  8884. return actionResult;
  8885. }
  8886. else
  8887. {
  8888. actionResult.Status = (int)Constant.PDAResult.Fail;
  8889. actionResult.Result = -500;
  8890. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8891. return actionResult;
  8892. }
  8893. return actionResult;
  8894. }
  8895. #endregion
  8896. #region 上模
  8897. if (action == "UpdateGroutingLine_AddMould")
  8898. {
  8899. if (data == null || !data.ContainsKey("Details"))
  8900. {
  8901. actionResult.Status = (int)Constant.PDAResult.Fail;
  8902. actionResult.Message = "参数错误";
  8903. return actionResult;
  8904. }
  8905. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8906. DataTable gTable = new DataTable();
  8907. gTable.Columns.Add("GroutingLineID", typeof(int));
  8908. gTable.Columns.Add("GroutingLineCode");
  8909. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8910. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8911. gTable.Columns.Add("GroutingMouldCode");
  8912. gTable.Columns.Add("Remarks");
  8913. gTable.Columns.Add("RecordRemarks");
  8914. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8915. gTable.Columns.Add("MouldID", typeof(int));
  8916. gTable.Columns.Add("MouldCode");
  8917. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8918. gTable.Columns.Add("GoodsID", typeof(int));
  8919. gTable.Columns.Add("GoodsCode");
  8920. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8921. gTable.Columns.Add("GroutingCount", typeof(int));
  8922. gTable.Columns.Add("MouldSource");
  8923. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8924. string groutingLineCode = data["GroutingLineCode"] + "";
  8925. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8926. foreach (Dictionary<string, object> item in details)
  8927. {
  8928. int? mouldID = null;
  8929. if (item.ContainsKey("MouldID"))
  8930. {
  8931. mouldID = Convert.ToInt32(item["MouldID"]);
  8932. if (mouldID == 0)
  8933. {
  8934. mouldID = null;
  8935. }
  8936. }
  8937. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  8938. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8939. gldID, item["GLineDetailCode"],
  8940. item["DetailRemarks"], item["RecordRemarks"],
  8941. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  8942. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8943. item["GoodsID"], item["GoodsCode"],
  8944. item["StandardGroutingCount"], item["GroutingCount"],
  8945. (mouldID == null ? "0" : "1"));
  8946. }
  8947. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  8948. if (result.Status == Constant.ServiceResultStatus.Success)
  8949. {
  8950. actionResult.Status = (int)Constant.PDAResult.Success;
  8951. }
  8952. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  8953. {
  8954. actionResult.Status = (int)Constant.PDAResult.Fail;
  8955. actionResult.Result = result.OtherStatus;
  8956. actionResult.Message = result.Message;
  8957. return actionResult;
  8958. }
  8959. else
  8960. {
  8961. actionResult.Status = (int)Constant.PDAResult.Fail;
  8962. actionResult.Result = -500;
  8963. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8964. return actionResult;
  8965. }
  8966. return actionResult;
  8967. }
  8968. #endregion
  8969. return actionResult;
  8970. }
  8971. #endregion
  8972. #region 包装装板限制
  8973. if (module == "FinishedLoadingCar")
  8974. {
  8975. if (action == "GetSetting")
  8976. {
  8977. ClientRequestEntity cre = new ClientRequestEntity();
  8978. cre.Properties["GoodsID"] = data["GoodsID"];
  8979. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  8980. if (sre.Status == Constant.ServiceResultStatus.Success)
  8981. {
  8982. actionResult.Status = (int)Constant.PDAResult.Success;
  8983. foreach (DataRow item in sre.Data.Tables[0].Rows)
  8984. {
  8985. if (item["settingcode"].ToString() == "S_PM_011")
  8986. {
  8987. cre.Properties["S_PM_011"] = item["settingvalue"];
  8988. }
  8989. else if (item["settingcode"].ToString() == "S_PM_012")
  8990. {
  8991. cre.Properties["S_PM_012"] = item["settingvalue"];
  8992. }
  8993. else if (item["settingcode"].ToString() == "S_PM_013")
  8994. {
  8995. cre.Properties["S_PM_013"] = item["settingvalue"];
  8996. }
  8997. }
  8998. cre.Properties["PlatelitNum"] = sre.Result;
  8999. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9000. }
  9001. else
  9002. {
  9003. actionResult.Status = (int)Constant.PDAResult.Fail;
  9004. actionResult.Message = "";
  9005. }
  9006. return actionResult;
  9007. }
  9008. }
  9009. #endregion
  9010. #region 成型报损
  9011. if (module == "GroutingScrapProduct")
  9012. {
  9013. // 查询注浆日报明细表
  9014. if ("GetGroutingDailyDetail" == action)
  9015. {
  9016. ClientRequestEntity cre = new ClientRequestEntity();
  9017. cre.NameSpace = module;
  9018. cre.Name = action;
  9019. if (!string.IsNullOrEmpty(jsonData))
  9020. {
  9021. cre.Properties["BarCode"] = data["BarCode"];
  9022. }
  9023. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9024. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9025. actionResult.Status = (int)Constant.PDAResult.Success;
  9026. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9027. || sre.Data.Tables[0].Rows.Count == 0)
  9028. {
  9029. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9030. actionResult.Status = (int)Constant.PDAResult.Fail;
  9031. }
  9032. else
  9033. {
  9034. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9035. // 判断是否进行了注浆
  9036. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9037. {
  9038. actionResult.Message = "该产品还未进行注浆!";
  9039. actionResult.Status = (int)Constant.PDAResult.Fail;
  9040. }
  9041. // 判断是否进行了交坯
  9042. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9043. {
  9044. actionResult.Message = "该产品已经交坯!";
  9045. actionResult.Status = (int)Constant.PDAResult.Fail;
  9046. }
  9047. // 判断是否已经报损
  9048. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9049. {
  9050. actionResult.Message = "该产品已经报损!";
  9051. actionResult.Status = (int)Constant.PDAResult.Fail;
  9052. }
  9053. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9054. }
  9055. }
  9056. // 获取成型报损原因
  9057. else if ("GetScrapReasonData" == action)
  9058. {
  9059. ClientRequestEntity cre = new ClientRequestEntity();
  9060. cre.NameSpace = module;
  9061. cre.Name = action;
  9062. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo);
  9063. actionResult.Status = (int)Constant.PDAResult.Success;
  9064. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9065. }
  9066. // 保存成型报损
  9067. else if ("SaveGroutingScrapProduct" == action)
  9068. {
  9069. ClientRequestEntity cre = new ClientRequestEntity();
  9070. cre.NameSpace = module;
  9071. cre.Name = action;
  9072. if (!string.IsNullOrEmpty(jsonData))
  9073. {
  9074. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9075. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9076. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9077. if (dt != null && dt.Rows.Count > 0)
  9078. {
  9079. // 总单信息
  9080. DataRow properties = dt.Rows[0];
  9081. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9082. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9083. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9084. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9085. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9086. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9087. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9088. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9089. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9090. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9091. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9092. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9093. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9094. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9095. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9096. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9097. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9098. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9099. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9100. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9101. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9102. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9103. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9104. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9105. // 责任员工
  9106. cre.Data = new DataSet();
  9107. //DataTable returnTable = returnData.Tables[1].Copy();
  9108. cre.Data.Tables.Add(dtResponsible);
  9109. }
  9110. }
  9111. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9112. if (sre.Status == Constant.ServiceResultStatus.Success)
  9113. {
  9114. actionResult.Status = (int)Constant.PDAResult.Success;
  9115. actionResult.Result = sre.Result;
  9116. }
  9117. else
  9118. {
  9119. actionResult.Status = (int)Constant.PDAResult.Fail;
  9120. actionResult.Result = sre.OtherStatus;
  9121. actionResult.Message = sre.Message;
  9122. }
  9123. }
  9124. // 获取成型报损信息 用于撤销使用
  9125. else if ("GetGroutingScrapProduct" == action)
  9126. {
  9127. ClientRequestEntity cre = new ClientRequestEntity();
  9128. cre.NameSpace = module;
  9129. cre.Name = action;
  9130. if (!string.IsNullOrEmpty(jsonData))
  9131. {
  9132. cre.Properties["BarCode"] = data["BarCode"];
  9133. }
  9134. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9135. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9136. actionResult.Status = (int)Constant.PDAResult.Success;
  9137. }
  9138. // 撤销成型报损
  9139. else if ("ReverseGroutingScrapProduct" == action)
  9140. {
  9141. ClientRequestEntity cre = new ClientRequestEntity();
  9142. cre.NameSpace = module;
  9143. cre.Name = action;
  9144. if (!string.IsNullOrEmpty(jsonData))
  9145. {
  9146. cre.Properties["BarCode"] = data["BarCode"];
  9147. }
  9148. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9149. if (sre.Status == Constant.ServiceResultStatus.Success)
  9150. {
  9151. actionResult.Status = (int)Constant.PDAResult.Success;
  9152. actionResult.Result = sre.Result;
  9153. }
  9154. else
  9155. {
  9156. actionResult.Status = (int)Constant.PDAResult.Fail;
  9157. actionResult.Result = sre.OtherStatus;
  9158. actionResult.Message = sre.Message;
  9159. }
  9160. }
  9161. }
  9162. #endregion
  9163. #region 产品挂起
  9164. if (module == "ProductSuspend")
  9165. {
  9166. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9167. if (action == "GetSuspendProcedure")
  9168. {
  9169. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9170. if (sre.Status == Constant.ServiceResultStatus.Success)
  9171. {
  9172. actionResult.Status = (int)Constant.PDAResult.Success;
  9173. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9174. }
  9175. else
  9176. {
  9177. actionResult.Status = (int)Constant.PDAResult.Fail;
  9178. actionResult.Message = sre.Message;
  9179. }
  9180. return actionResult;
  9181. }
  9182. // 验证挂起条码
  9183. if (action == "CheckSuspendBarcode")
  9184. {
  9185. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9186. if (sre.Status == Constant.ServiceResultStatus.Success)
  9187. {
  9188. actionResult.Status = (int)Constant.PDAResult.Success;
  9189. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9190. }
  9191. else
  9192. {
  9193. actionResult.Status = (int)Constant.PDAResult.Fail;
  9194. actionResult.Message = sre.Message;
  9195. }
  9196. return actionResult;
  9197. }
  9198. // 挂起条码
  9199. if (action == "SaveSuspendProduct")
  9200. {
  9201. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9202. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9203. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9204. if (sre.Status == Constant.ServiceResultStatus.Success)
  9205. {
  9206. actionResult.Status = (int)Constant.PDAResult.Success;
  9207. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9208. }
  9209. else
  9210. {
  9211. actionResult.Status = (int)Constant.PDAResult.Fail;
  9212. actionResult.Message = sre.Message;
  9213. }
  9214. return actionResult;
  9215. }
  9216. // 撤销挂起条码
  9217. if (action == "DeleteSuspendProduct")
  9218. {
  9219. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9220. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9221. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9222. if (sre.Status == Constant.ServiceResultStatus.Success)
  9223. {
  9224. actionResult.Status = (int)Constant.PDAResult.Success;
  9225. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9226. }
  9227. else
  9228. {
  9229. actionResult.Status = (int)Constant.PDAResult.Fail;
  9230. actionResult.Message = sre.Message;
  9231. }
  9232. return actionResult;
  9233. }
  9234. // 查询挂起条码
  9235. if (action == "GetSuspendProduct")
  9236. {
  9237. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9238. if (sre.Status == Constant.ServiceResultStatus.Success)
  9239. {
  9240. if (sre.Data.Tables[0].Rows.Count == 0)
  9241. {
  9242. actionResult.Status = (int)Constant.PDAResult.Fail;
  9243. actionResult.Message = "此条码没有可撤销的挂起信息";
  9244. }
  9245. else
  9246. {
  9247. actionResult.Status = (int)Constant.PDAResult.Success;
  9248. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9249. }
  9250. }
  9251. else
  9252. {
  9253. actionResult.Status = (int)Constant.PDAResult.Fail;
  9254. actionResult.Message = sre.Message;
  9255. }
  9256. return actionResult;
  9257. }
  9258. }
  9259. #endregion
  9260. #region 品保抽查
  9261. if (module == "QASpotCheck")
  9262. {
  9263. if (action == "GetAllQASpotCheck")
  9264. {
  9265. ClientRequestEntity cre = new ClientRequestEntity();
  9266. cre.NameSpace = module;
  9267. cre.Name = action;
  9268. if (data != null && data.Count > 0)
  9269. {
  9270. foreach (string item in data.Keys)
  9271. {
  9272. if (item.StartsWith("checktime"))
  9273. {
  9274. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9275. }
  9276. else
  9277. {
  9278. cre.Properties.Add(item, data[item]);
  9279. }
  9280. }
  9281. }
  9282. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9283. if (sre.Status == Constant.ServiceResultStatus.Success)
  9284. {
  9285. actionResult.Status = (int)Constant.PDAResult.Success;
  9286. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9287. }
  9288. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9289. {
  9290. actionResult.Status = (int)Constant.PDAResult.Success;
  9291. }
  9292. else
  9293. {
  9294. actionResult.Status = (int)Constant.PDAResult.Fail;
  9295. actionResult.Message = sre.Message;
  9296. }
  9297. return actionResult;
  9298. }
  9299. if (action == "AutoSaveQASpotCheck")
  9300. {
  9301. string barcode = data["barcode"] + "";
  9302. string remarks = data["remarks"] + "";
  9303. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9304. if (sre.Status == Constant.ServiceResultStatus.Success)
  9305. {
  9306. actionResult.Status = (int)Constant.PDAResult.Success;
  9307. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9308. }
  9309. else
  9310. {
  9311. actionResult.Status = (int)Constant.PDAResult.Fail;
  9312. actionResult.Message = sre.Message;
  9313. }
  9314. return actionResult;
  9315. }
  9316. if (action == "CheckQASpotCheck")
  9317. {
  9318. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9319. if (sre.Status == Constant.ServiceResultStatus.Success)
  9320. {
  9321. actionResult.Status = (int)Constant.PDAResult.Success;
  9322. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9323. }
  9324. else
  9325. {
  9326. actionResult.Status = (int)Constant.PDAResult.Fail;
  9327. actionResult.Message = sre.Message;
  9328. }
  9329. return actionResult;
  9330. }
  9331. if (action == "SaveQASpotCheck")
  9332. {
  9333. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9334. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9335. if (sre.Status == Constant.ServiceResultStatus.Success)
  9336. {
  9337. actionResult.Status = (int)Constant.PDAResult.Success;
  9338. }
  9339. else
  9340. {
  9341. actionResult.Status = (int)Constant.PDAResult.Fail;
  9342. actionResult.Message = sre.Message;
  9343. }
  9344. return actionResult;
  9345. }
  9346. return null;
  9347. }
  9348. #endregion
  9349. #region 产成品交接
  9350. if (module == "FinishedProduct")
  9351. {
  9352. // 设定商标
  9353. if (action == "GetFinishedBarcode")
  9354. {
  9355. string barcode = data["barcode"].ToString();
  9356. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  9357. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9358. if (Convert.ToInt32(resultEntity.Result) < 0)
  9359. {
  9360. actionResult.Status = (int)Constant.PDAResult.Fail;
  9361. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9362. actionResult.Message = resultEntity.Message;
  9363. }
  9364. else
  9365. {
  9366. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9367. actionResult.Status = (int)Constant.PDAResult.Success;
  9368. actionResult.Message = resultEntity.Message;
  9369. }
  9370. return actionResult;
  9371. }
  9372. if (action == "GetHandoveredBarcode")
  9373. {
  9374. string barcode = data["barcode"].ToString();
  9375. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  9376. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9377. if (Convert.ToInt32(resultEntity.Result) < 0)
  9378. {
  9379. actionResult.Status = (int)Constant.PDAResult.Fail;
  9380. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9381. actionResult.Message = resultEntity.Message;
  9382. }
  9383. else
  9384. {
  9385. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9386. actionResult.Status = (int)Constant.PDAResult.Success;
  9387. actionResult.Message = resultEntity.Message;
  9388. }
  9389. return actionResult;
  9390. }
  9391. if (action == "SetFinishedLogo")
  9392. {
  9393. int logoid = Convert.ToInt32(data["logoid"]);
  9394. string[] barcodes = data["barcodes"].ToString().Split(',');
  9395. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo);
  9396. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9397. if (result < 0)
  9398. {
  9399. actionResult.Status = (int)Constant.PDAResult.Fail;
  9400. }
  9401. else
  9402. {
  9403. actionResult.Status = (int)Constant.PDAResult.Success;
  9404. }
  9405. return actionResult;
  9406. }
  9407. if (action == "SetHandoveredOrder")
  9408. {
  9409. int orderID = Convert.ToInt32(data["orderID"]);
  9410. string[] barcodes = data["barcodes"].ToString().Split(',');
  9411. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  9412. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9413. if (result < 0)
  9414. {
  9415. actionResult.Status = (int)Constant.PDAResult.Fail;
  9416. }
  9417. else
  9418. {
  9419. actionResult.Status = (int)Constant.PDAResult.Success;
  9420. }
  9421. return actionResult;
  9422. }
  9423. }
  9424. #endregion
  9425. #region 产成品装车
  9426. /*
  9427. if (module == "FinishedLoading")
  9428. {
  9429. // 设定商标
  9430. if (action == "GetMaxLoadingNo")
  9431. {
  9432. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  9433. actionResult.Status = (int)Constant.PDAResult.Success;
  9434. actionResult.Result = no;
  9435. return actionResult;
  9436. }
  9437. if (action == "CheckFinishedLaodingBarcode")
  9438. {
  9439. string barcode = data["barcode"].ToString();
  9440. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  9441. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  9442. {
  9443. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9444. actionResult.Status = (int)Constant.PDAResult.Success;
  9445. actionResult.Message = resultEntity.Message;
  9446. }
  9447. else
  9448. {
  9449. actionResult.Status = (int)Constant.PDAResult.Fail;
  9450. actionResult.Result = resultEntity.OtherStatus;
  9451. actionResult.Message = resultEntity.Message;
  9452. }
  9453. return actionResult;
  9454. }
  9455. if (action == "SaveFinishedLoading")
  9456. {
  9457. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  9458. string carLicense = data["carLicense"] + "";
  9459. int palletNum = Convert.ToInt32(data["palletNum"]);
  9460. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  9461. string remarks = data["remarks"] + "";
  9462. Dictionary<string, object>[] details =
  9463. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  9464. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  9465. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  9466. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  9467. if (result.Status == Constant.ServiceResultStatus.Success)
  9468. {
  9469. actionResult.Status = (int)Constant.PDAResult.Success;
  9470. actionResult.Message = result.Message;
  9471. }
  9472. else
  9473. {
  9474. actionResult.Status = (int)Constant.PDAResult.Fail;
  9475. actionResult.Result = result.OtherStatus;
  9476. actionResult.Message = result.Message;
  9477. }
  9478. return actionResult;
  9479. }
  9480. }
  9481. */
  9482. #endregion
  9483. #region 产成品质量改判
  9484. if (module == "FinishedProductTamper")
  9485. {
  9486. // 获取产成品信息及缺陷数据
  9487. if (action == "GetDefectData")
  9488. {
  9489. string barcode = data["barcode"].ToString();
  9490. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  9491. if (sre.Status == Constant.ServiceResultStatus.Success)
  9492. {
  9493. actionResult.Status = (int)Constant.PDAResult.Success;
  9494. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9495. actionResult.Message = sre.Message;
  9496. }
  9497. else
  9498. {
  9499. actionResult.Status = (int)Constant.PDAResult.Fail;
  9500. actionResult.Result = sre.OtherStatus;
  9501. actionResult.Message = sre.Message;
  9502. }
  9503. return actionResult;
  9504. }
  9505. // 获取产成品信息及缺陷数据
  9506. if (action == "SaveDefectData")
  9507. {
  9508. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  9509. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  9510. if (sre.Status == Constant.ServiceResultStatus.Success)
  9511. {
  9512. actionResult.Status = (int)Constant.PDAResult.Success;
  9513. actionResult.Message = sre.Message;
  9514. }
  9515. else
  9516. {
  9517. actionResult.Status = (int)Constant.PDAResult.Fail;
  9518. actionResult.Message = sre.Message;
  9519. }
  9520. return actionResult;
  9521. }
  9522. // 通过条码查出责任工序(成品改判用)
  9523. if (action == "GetDutyProcedureByBarCodeForTamper")
  9524. {
  9525. string barcode = data["barcode"] + "";
  9526. int defectid = int.Parse(data["defectid"] + "");
  9527. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  9528. if (sre.Status == Constant.ServiceResultStatus.Success)
  9529. {
  9530. actionResult.Status = (int)Constant.PDAResult.Success;
  9531. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9532. actionResult.Message = sre.Message;
  9533. }
  9534. else
  9535. {
  9536. actionResult.Status = (int)Constant.PDAResult.Fail;
  9537. actionResult.Result = sre.OtherStatus;
  9538. actionResult.Message = sre.Message;
  9539. }
  9540. return actionResult;
  9541. }
  9542. }
  9543. #endregion
  9544. #region PDA独立功能
  9545. #region 水效标识
  9546. if (module == "WaterEffect")
  9547. {
  9548. // 获取产成品信息及水效标识
  9549. if (action == "GetGoodsByBarCode")
  9550. {
  9551. string barcode = data["barcode"].ToString();
  9552. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  9553. if (sre.Status == Constant.ServiceResultStatus.Success)
  9554. {
  9555. actionResult.Status = (int)Constant.PDAResult.Success;
  9556. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9557. actionResult.Message = sre.Message;
  9558. }
  9559. else
  9560. {
  9561. actionResult.Status = (int)Constant.PDAResult.Fail;
  9562. actionResult.Result = sre.OtherStatus;
  9563. actionResult.Message = sre.Message;
  9564. }
  9565. return actionResult;
  9566. }
  9567. }
  9568. #endregion
  9569. #region 盖板型号
  9570. if (module == "SeatCoverType")
  9571. {
  9572. // 获取产成品信息及水效标识
  9573. if (action == "SendGoodsCodeToPLC")
  9574. {
  9575. string barcode = data["barcode"].ToString();
  9576. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  9577. if (sre == 0)
  9578. {
  9579. actionResult.Status = (int)Constant.PDAResult.Success;
  9580. }
  9581. else
  9582. {
  9583. actionResult.Status = (int)Constant.PDAResult.Fail;
  9584. actionResult.Result = sre;
  9585. switch (sre)
  9586. {
  9587. case 1:
  9588. case 2:
  9589. actionResult.Message = "无效条码";
  9590. break;
  9591. case 3:
  9592. actionResult.Message = "此产品型号没有设置盖板标识码";
  9593. break;
  9594. case 4:
  9595. actionResult.Message = "当前用户没有设置PLC参数";
  9596. break;
  9597. case 5:
  9598. actionResult.Message = "PLC参数设置不全";
  9599. break;
  9600. default:
  9601. actionResult.Message = "PLC通信异常";
  9602. break;
  9603. }
  9604. }
  9605. return actionResult;
  9606. }
  9607. }
  9608. #endregion
  9609. #region PDA PLC 相关功能
  9610. if (module == "PDA_FUN_PLC")
  9611. {
  9612. // PDA扫码发送到PLCServer
  9613. if (action == "SendBarcodeToPLCServer")
  9614. {
  9615. string barcode = data["barcode"].ToString();
  9616. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  9617. if (sre == 0)
  9618. {
  9619. actionResult.Status = (int)Constant.PDAResult.Success;
  9620. }
  9621. else
  9622. {
  9623. actionResult.Status = (int)Constant.PDAResult.Fail;
  9624. actionResult.Result = sre;
  9625. switch (sre)
  9626. {
  9627. case 1:
  9628. case 2:
  9629. actionResult.Message = "无效条码";
  9630. break;
  9631. case 3:
  9632. actionResult.Message = "PLC通信异常";
  9633. break;
  9634. case 4:
  9635. actionResult.Message = "当前用户没有设置PLC参数";
  9636. break;
  9637. case 5:
  9638. actionResult.Message = "PLC参数设置不全";
  9639. break;
  9640. default:
  9641. actionResult.Message = "PLC通信异常";
  9642. break;
  9643. }
  9644. }
  9645. return actionResult;
  9646. }
  9647. }
  9648. #endregion
  9649. #endregion
  9650. #region 半检返修
  9651. if (module == "SemiRework")
  9652. {
  9653. // 验证半检返修条码
  9654. if (action == "CheckSemiReworkBarcode")
  9655. {
  9656. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9657. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  9658. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9659. if (Convert.ToInt32(resultEntity.Result) < 0)
  9660. {
  9661. actionResult.Status = (int)Constant.PDAResult.Fail;
  9662. }
  9663. else
  9664. {
  9665. actionResult.Status = (int)Constant.PDAResult.Success;
  9666. }
  9667. actionResult.Message = resultEntity.Message;
  9668. return actionResult;
  9669. }
  9670. // 可以返修的工序
  9671. if (action == "GetSemiReworkProcedure")
  9672. {
  9673. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9674. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  9675. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9676. actionResult.Status = (int)Constant.PDAResult.Success;
  9677. return actionResult;
  9678. }
  9679. // 根据条码获取经过的工序,用于责任工序
  9680. if (action == "GetSemiReworkPassProcedure")
  9681. {
  9682. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9683. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  9684. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9685. actionResult.Status = (int)Constant.PDAResult.Success;
  9686. return actionResult;
  9687. }
  9688. // 根据所选生产工序(生产数据ID)查询责任员工
  9689. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  9690. {
  9691. int productionDataID = Convert.ToInt32(jsonData);
  9692. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9693. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  9694. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9695. actionResult.Status = (int)Constant.PDAResult.Success;
  9696. return actionResult;
  9697. }
  9698. // 根据所选工号,查出缺陷责任员工
  9699. if (action == "GetSemiReworkDefectStaffByUserID")
  9700. {
  9701. int userID = Convert.ToInt32(jsonData);
  9702. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9703. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  9704. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9705. actionResult.Status = (int)Constant.PDAResult.Success;
  9706. return actionResult;
  9707. }
  9708. // 新建半检返修
  9709. if (action == "AddSemiRework")
  9710. {
  9711. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"]+"");
  9712. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9713. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  9714. actionResult.Result = resultEntity.Result;
  9715. actionResult.Message = resultEntity.Message;
  9716. if (Convert.ToInt32(resultEntity.Result) > 0)
  9717. {
  9718. actionResult.Status = (int)Constant.PDAResult.Success;
  9719. }
  9720. else
  9721. {
  9722. actionResult.Status = (int)Constant.PDAResult.Fail;
  9723. }
  9724. return actionResult;
  9725. }
  9726. // 编辑半检返修
  9727. if (action == "EditSemiRework")
  9728. {
  9729. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9730. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9731. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  9732. actionResult.Result = resultEntity.Result;
  9733. actionResult.Message = resultEntity.Message;
  9734. if (Convert.ToInt32(resultEntity.Result) > 0)
  9735. {
  9736. actionResult.Status = (int)Constant.PDAResult.Success;
  9737. }
  9738. else
  9739. {
  9740. actionResult.Status = (int)Constant.PDAResult.Fail;
  9741. }
  9742. return actionResult;
  9743. }
  9744. // 撤销半检返修
  9745. if (action == "CancelSemiRework")
  9746. {
  9747. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9748. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9749. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  9750. actionResult.Result = resultEntity.Result;
  9751. actionResult.Message = resultEntity.Message;
  9752. if (Convert.ToInt32(resultEntity.Result) > 0)
  9753. {
  9754. actionResult.Status = (int)Constant.PDAResult.Success;
  9755. }
  9756. else
  9757. {
  9758. actionResult.Status = (int)Constant.PDAResult.Fail;
  9759. }
  9760. return actionResult;
  9761. }
  9762. // 获取半检返修数据(PDA编辑用)
  9763. if (action == "GetSemiReworkByID")
  9764. {
  9765. int id = Convert.ToInt32(jsonData);
  9766. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9767. PMModuleLogic.GetSemiReworkByID(id, sUserInfo.UserCode);
  9768. DataTable data1 = resultEntity.Data.Tables[0];
  9769. DataTable data2 = resultEntity.Data.Tables[1];
  9770. DataTable data3 = resultEntity.Data.Tables[2];
  9771. if (data1.Rows.Count == 0)
  9772. {
  9773. actionResult.Status = (int)Constant.PDAResult.Fail;
  9774. actionResult.Message = "半检返修信息不存在";
  9775. return actionResult;
  9776. }
  9777. SemiReworkEntity srEntity = new SemiReworkEntity();
  9778. srEntity.SemiReworkID = id;
  9779. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  9780. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  9781. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  9782. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  9783. foreach (DataRow row2 in data2.Rows)
  9784. {
  9785. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  9786. srEntity.SemiReworkDefects.Add(defectEntity);
  9787. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  9788. defectEntity.SemiReworkID = id;
  9789. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  9790. defectEntity.DefectCode = row2["DefectCode"] + "";
  9791. defectEntity.DefectName = row2["DefectName"] + "";
  9792. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  9793. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  9794. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  9795. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  9796. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  9797. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  9798. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  9799. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  9800. defectEntity.Remarks = row2["Remarks"] + "";
  9801. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  9802. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  9803. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  9804. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  9805. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  9806. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  9807. if (row3s.Length == 0)
  9808. {
  9809. continue;
  9810. }
  9811. foreach (DataRow row3 in row3s)
  9812. {
  9813. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  9814. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  9815. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  9816. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  9817. semiReworkRPS.StaffName = row3["StaffName"] + "";
  9818. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  9819. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  9820. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  9821. semiReworkRPS.UserCode = row3["UserCode"] + "";
  9822. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  9823. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  9824. }
  9825. }
  9826. actionResult.Message = JsonHelper.ToJson(data1);
  9827. actionResult.Result = JsonHelper.ToJson(srEntity);
  9828. actionResult.Status = (int)Constant.PDAResult.Success;
  9829. }
  9830. }
  9831. #endregion
  9832. return actionResult;
  9833. }
  9834. catch (Exception ex)
  9835. {
  9836. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  9837. OutputLog.TraceLog(LogPriority.Error,
  9838. this.ToString(),
  9839. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  9840. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  9841. " module:" + module + " action:" + action + " json:" + jsonData,
  9842. ex.ToString(),
  9843. LocalPath.LogExePath);
  9844. actionResult.Status = (int)Constant.PDAResult.Exception;
  9845. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  9846. }
  9847. return actionResult;
  9848. }
  9849. #endregion
  9850. }
  9851. }