PDAModuleService.cs 375 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:PDAModuleService.cs
  5. * 2.功能描述:PDA模块WCF服务
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 陈晓野 2014/09/16 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.IO;
  14. using System.ServiceModel;
  15. using System.ServiceModel.Activation;
  16. using Dongke.IBOSS.PRD.Basics.BaseResources;
  17. using Dongke.IBOSS.PRD.Basics.Library;
  18. using Dongke.IBOSS.PRD.Service.BarcodePrintService;
  19. using Dongke.IBOSS.PRD.Service.CommonModuleLogic;
  20. using Dongke.IBOSS.PRD.Service.DataModels;
  21. using Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic;
  22. using Dongke.IBOSS.PRD.Service.PCModuleLogic;
  23. using Dongke.IBOSS.PRD.Service.PDAModuleLogic;
  24. using Dongke.IBOSS.PRD.Service.PMModuleLogic;
  25. using Dongke.IBOSS.PRD.Service.PublicModuleService;
  26. using Dongke.IBOSS.PRD.Service.ReportModuleLogic;
  27. using Dongke.IBOSS.PRD.Service.SmartDeviceService;
  28. using Dongke.IBOSS.PRD.Service.SystemModuleLogic;
  29. using Dongke.IBOSS.PRD.WCF.Contracts;
  30. using Dongke.IBOSS.PRD.WCF.DataModels;
  31. using Dongke.IBOSS.PRD.WCF.DataModels.ConfigModule;
  32. using Dongke.IBOSS.PRD.WCF.DataModels.HRModule;
  33. using Dongke.IBOSS.PRD.WCF.DataModels.PCModule;
  34. using Dongke.IBOSS.PRD.WCF.DataModels.PMModule;
  35. namespace Dongke.IBOSS.PRD.WCF.Services
  36. {
  37. // 服务实现类,继承服务声明接口
  38. // 该标签声明该服务可以在ASP.NET下运行
  39. [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
  40. [ServiceBehavior(ConfigurationName = "PDAModuleService",
  41. InstanceContextMode = InstanceContextMode.PerCall,
  42. ConcurrencyMode = ConcurrencyMode.Multiple,
  43. UseSynchronizationContext = false)]
  44. public partial class PDAModuleService : IPDAModule
  45. {
  46. #region 属性
  47. /// <summary>
  48. /// 用户登陆的信息
  49. /// </summary>
  50. SUserInfo sUserInfo
  51. {
  52. get;
  53. set;
  54. }
  55. #endregion
  56. #region 构造函数
  57. /// <summary>
  58. /// 构造函数
  59. /// </summary>
  60. public PDAModuleService()
  61. : base()
  62. {
  63. }
  64. #endregion
  65. #region 验证
  66. /// <summary>
  67. /// 验证访问头
  68. /// </summary>
  69. /// <param name="accountCode">帐套编码</param>
  70. /// <param name="userCode">用户编码</param>
  71. /// <param name="userPassword">用户密码</param>
  72. /// <param name="sessionKey">访问密钥</param>
  73. /// <returns></returns>
  74. private ActionResult DoPDACheck(string accountCode, string userCode, string userPassword, string sessionKey)
  75. {
  76. try
  77. {
  78. ActionResult actionResult = new ActionResult();
  79. LoginRequestEntity requestEntity = new LoginRequestEntity();
  80. requestEntity.AccountCode = accountCode;
  81. requestEntity.UserCode = userCode;
  82. requestEntity.Password = userPassword;
  83. requestEntity.SessionKey = sessionKey;
  84. SUserInfo userInfo = null;
  85. string loginStatus = DKIBOSSPRDLogic.AuthenticateRepeatLogin(requestEntity, out userInfo);
  86. // 用户登录信息错误
  87. if (Constant.INT_IS_ONE.ToString().Equals(loginStatus))
  88. {
  89. actionResult.Status = (int)Constant.PDAResult.LoginInfoError;
  90. actionResult.Message = Constant.PDA_RESULT_LOGININFOERROR;
  91. }
  92. // 用户在其它终端登陆
  93. else if (Constant.INT_IS_TWO.ToString().Equals(loginStatus))
  94. {
  95. actionResult.Status = (int)Constant.PDAResult.RepeatLogin;
  96. actionResult.Message = Constant.PDA_RESULT_REPEATLOGIN;
  97. }
  98. // Lic错误
  99. else if ("3".Equals(loginStatus))
  100. {
  101. actionResult.Status = (int)Constant.PDAResult.LicInfoError;
  102. actionResult.Message = "授权信息错误,请联系管理员。";
  103. }
  104. else
  105. {
  106. actionResult.Status = (int)Constant.PDAResult.Success;
  107. }
  108. sUserInfo = userInfo;
  109. return actionResult;
  110. }
  111. catch (Exception ex)
  112. {
  113. throw ex;
  114. }
  115. }
  116. #endregion
  117. #region WCF服务
  118. /// <summary>
  119. /// 测试PDA连接WCF服务
  120. /// </summary>
  121. /// <param name="value">测试文本</param>
  122. /// <returns>返回文本</returns>
  123. public string TestConnectionEx(string value)
  124. {
  125. return "连接成功!" + value;
  126. }
  127. public string TestConnection()
  128. {
  129. return "连接成功!";
  130. }
  131. #endregion
  132. #region 系统登录
  133. /// <summary>
  134. /// 系统登录
  135. /// </summary>
  136. /// <param name="accountCode"></param>
  137. /// <param name="userCode"></param>
  138. /// <param name="userPassword"></param>
  139. /// <param name="macAddress"></param>
  140. /// <param name="ipAddress"></param>
  141. /// <param name="phoneCode"></param>
  142. /// <param name="phoneType"></param>
  143. /// <param name="appVersion"></param>
  144. /// <param name="systemType"></param>
  145. /// <param name="systemVersion"></param>
  146. /// <returns></returns>
  147. public PDALoginResult DoPDALogin(string accountCode, string userCode, string userPassword,
  148. string macAddress, string ipAddress, string phoneCode, string phoneType,
  149. string appVersion, string systemType, string systemVersion)
  150. {
  151. try
  152. {
  153. LoginRequestEntity requestEntity = new LoginRequestEntity();
  154. requestEntity.AccountCode = accountCode;
  155. requestEntity.UserCode = userCode;
  156. requestEntity.Password = userPassword;
  157. requestEntity.ComputerName = phoneCode;
  158. requestEntity.IPAddress = ipAddress;
  159. requestEntity.MACAddress = macAddress;
  160. PDALoginResult result = ServiceInvoker.Invoke<PDALoginResult>(this,
  161. () => PDAModuleLogic.DoPDALogin(requestEntity));
  162. return result;
  163. }
  164. catch (Exception ex)
  165. {
  166. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  167. OutputLog.TraceLog(LogPriority.Error,
  168. this.ToString(),
  169. System.Reflection.MethodBase.GetCurrentMethod().Name,
  170. ex.ToString(),
  171. LocalPath.LogExePath);
  172. PDALoginResult result = new PDALoginResult();
  173. result.Status = (int)Constant.PDAResult.Exception;
  174. result.Message = Constant.PDA_RESULT_EXCEPTION;
  175. return result;
  176. }
  177. }
  178. /// <summary>
  179. /// 退出
  180. /// </summary>
  181. /// <param name="accountCode">帐套code</param>
  182. /// <param name="userCode">用户code</param>
  183. /// <param name="userPassword">用户密码</param>
  184. /// <param name="sessionKey">本次登陆密钥</param>
  185. /// <returns></returns>
  186. public ActionResult DoPDAOut(string accountCode, string userCode, string userPassword, string sessionKey)
  187. {
  188. ActionResult actionResult = new ActionResult();
  189. try
  190. {
  191. // 验证请求头信息
  192. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  193. // 验证失败
  194. if (actionResult.Status != (int)Constant.PDAResult.Success)
  195. {
  196. return actionResult;
  197. }
  198. bool result = DKIBOSSPRDLogic.Logout(sUserInfo.UserID, "3", sUserInfo);
  199. actionResult.Result = JsonHelper.ToJson(result);
  200. actionResult.Status = (int)Constant.PDAResult.Success;
  201. }
  202. catch (Exception ex)
  203. {
  204. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  205. OutputLog.TraceLog(LogPriority.Error,
  206. this.ToString(),
  207. System.Reflection.MethodBase.GetCurrentMethod().Name,
  208. ex.ToString(),
  209. LocalPath.LogExePath);
  210. actionResult.Status = (int)Constant.PDAResult.Exception;
  211. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  212. }
  213. return actionResult;
  214. }
  215. /// <summary>
  216. /// 修改密码
  217. /// </summary>
  218. /// <param name="accountCode"></param>
  219. /// <param name="userCode"></param>
  220. /// <param name="userPassword"></param>
  221. /// <param name="sessionKey"></param>
  222. /// <returns></returns>
  223. public ActionResult ChangeUserPassword(string accountCode, string userCode, string userPassword, string sessionKey,
  224. string newPassWord)
  225. {
  226. ActionResult actionResult = new ActionResult();
  227. try
  228. {
  229. // 验证请求头信息
  230. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  231. // 验证失败
  232. if (actionResult.Status != (int)Constant.PDAResult.Success)
  233. {
  234. return actionResult;
  235. }
  236. string result = ServiceInvoker.Invoke<string>(this,
  237. () => SystemModuleDAL.SaveUserPassWord(newPassWord, userCode, null, sUserInfo));
  238. actionResult.Status = (int)Constant.PDAResult.Success;
  239. }
  240. catch (Exception ex)
  241. {
  242. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  243. OutputLog.TraceLog(LogPriority.Error,
  244. this.ToString(),
  245. System.Reflection.MethodBase.GetCurrentMethod().Name,
  246. ex.ToString(),
  247. LocalPath.LogExePath);
  248. actionResult.Status = (int)Constant.PDAResult.Exception;
  249. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  250. }
  251. return actionResult;
  252. }
  253. #endregion
  254. #region 取得展示数据
  255. /// <summary>
  256. /// 获得生产线菜单
  257. /// </summary>
  258. /// <param name="accountCode">帐套code</param>
  259. /// <param name="userCode">用户code</param>
  260. /// <param name="userPassword">用户密码</param>
  261. /// <param name="sessionKey">本次登陆密钥</param>
  262. /// <returns></returns>
  263. /// <remarks>
  264. /// 陈冰 2014.09.18 新建
  265. /// </remarks>
  266. public ActionResult GetProductionLineMenu(string accountCode, string userCode, string userPassword, string sessionKey)
  267. {
  268. ActionResult actionResult = new ActionResult();
  269. try
  270. {
  271. // 验证请求头信息
  272. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  273. // 验证失败
  274. if (actionResult.Status != (int)Constant.PDAResult.Success)
  275. {
  276. return actionResult;
  277. }
  278. // 查询菜单
  279. DataTable dtPLM = ServiceInvoker.Invoke<DataTable>(this,
  280. () => PDAModuleLogic.GetProductionLineMenu(sUserInfo));
  281. PDAFunctionResult pdaFunction = new PDAFunctionResult();
  282. pdaFunction.MenuCode = "Root";
  283. DataRow[] navigationRows = dtPLM.Select("LEN(MenuCode) = " + Constant.INT_IS_TWO.ToString(), "MenuCode ASC"); // 编号2为一级菜单
  284. foreach (DataRow newRow in navigationRows)
  285. {
  286. #region 插入子节点数据
  287. int? intProcedureID = null;
  288. int? intModelType = null;
  289. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  290. {
  291. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  292. }
  293. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  294. {
  295. intModelType = Convert.ToInt32(newRow["ModelType"]);
  296. }
  297. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  298. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  299. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  300. pdaFunctionChild.ProcedureID = intProcedureID;
  301. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  302. pdaFunctionChild.ModelType = intModelType;
  303. pdaFunction.PDAFunctions.Add(pdaFunctionChild);
  304. #endregion
  305. InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild);
  306. }
  307. //actionResult.Result = JsonHelper.ToJson(dtPLM);
  308. actionResult.Result = JsonHelper.ToJson(pdaFunction);
  309. actionResult.Status = (int)Constant.PDAResult.Success;
  310. }
  311. catch (Exception ex)
  312. {
  313. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  314. OutputLog.TraceLog(LogPriority.Error,
  315. this.ToString(),
  316. System.Reflection.MethodBase.GetCurrentMethod().Name,
  317. ex.ToString(),
  318. LocalPath.LogExePath);
  319. actionResult.Status = (int)Constant.PDAResult.Exception;
  320. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  321. }
  322. return actionResult;
  323. }
  324. /// <summary>
  325. /// 初始化树形控件
  326. /// </summary>
  327. /// <param name="treeTable">菜单数据表</param>
  328. /// <param name="rows">待处理的菜单集合</param>
  329. /// <param name="node">当前树节点</param>
  330. private void InitTreeView(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions)
  331. {
  332. string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = "
  333. + (pFuncCode.Length + Constant.INT_IS_TWO);
  334. DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC");
  335. //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC");
  336. foreach (DataRow newRow in subRows)
  337. {
  338. #region 插入子节点数据
  339. int? intProcedureID = null;
  340. int? intModelType = null;
  341. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  342. {
  343. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  344. }
  345. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  346. {
  347. intModelType = Convert.ToInt32(newRow["ModelType"]);
  348. }
  349. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  350. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  351. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  352. pdaFunctionChild.ProcedureID = intProcedureID;
  353. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  354. pdaFunctionChild.ModelType = intModelType;
  355. pFunctions.PDAFunctions.Add(pdaFunctionChild);
  356. #endregion
  357. // 递归方法
  358. InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild);
  359. }
  360. }
  361. #endregion
  362. #region 获得工序信息
  363. /// <summary>
  364. /// 获得工序信息
  365. /// </summary>
  366. /// <param name="accountCode">帐套code</param>
  367. /// <param name="userCode">用户code</param>
  368. /// <param name="userPassword">用户密码</param>
  369. /// <param name="sessionKey">本次登陆密钥</param>
  370. /// <param name="procedureID">工序ID</param>
  371. /// <returns></returns>
  372. /// <remarks>
  373. /// 陈冰 2014.09.18 新建
  374. /// </remarks>
  375. public ActionResult GetProcedureByID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  376. {
  377. ActionResult actionResult = new ActionResult();
  378. try
  379. {
  380. // 验证请求头信息
  381. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  382. // 验证失败
  383. if (actionResult.Status != (int)Constant.PDAResult.Success)
  384. {
  385. return actionResult;
  386. }
  387. ProcedureEntity procedureEntity = ServiceInvoker.Invoke<ProcedureEntity>(this,
  388. () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo));
  389. actionResult.Result = JsonHelper.ToJson(procedureEntity);
  390. actionResult.Status = (int)Constant.PDAResult.Success;
  391. }
  392. catch (Exception ex)
  393. {
  394. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  395. OutputLog.TraceLog(LogPriority.Error,
  396. this.ToString(),
  397. System.Reflection.MethodBase.GetCurrentMethod().Name,
  398. ex.ToString(),
  399. LocalPath.LogExePath);
  400. actionResult.Status = (int)Constant.PDAResult.Exception;
  401. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  402. }
  403. return actionResult;
  404. }
  405. #endregion
  406. #region 校验
  407. /// <summary>
  408. /// 校验产品条码是否可以走到该工序
  409. /// </summary>
  410. /// <param name="accountCode">帐套code</param>
  411. /// <param name="userCode">用户code</param>
  412. /// <param name="userPassword">用户密码</param>
  413. /// <param name="sessionKey">本次登陆密钥</param>
  414. /// <param name="procedureID">工序ID</param>
  415. /// <param name="barcode">条码</param>
  416. /// <returns></returns>
  417. /// <remarks>
  418. /// 陈冰 2014.09.18 新建
  419. /// </remarks>
  420. public ActionResult CheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  421. {
  422. ActionResult actionResult = new ActionResult();
  423. try
  424. {
  425. // 验证请求头信息
  426. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  427. // 验证失败
  428. if (actionResult.Status != (int)Constant.PDAResult.Success)
  429. {
  430. return actionResult;
  431. }
  432. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  433. () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo));
  434. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  435. {
  436. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  437. actionResult.Status = (int)Constant.PDAResult.Success;
  438. }
  439. else
  440. {
  441. actionResult.Status = (int)Constant.PDAResult.Fail;
  442. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  443. }
  444. }
  445. catch (Exception ex)
  446. {
  447. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  448. OutputLog.TraceLog(LogPriority.Error,
  449. this.ToString(),
  450. System.Reflection.MethodBase.GetCurrentMethod().Name,
  451. ex.ToString(),
  452. LocalPath.LogExePath);
  453. actionResult.Status = (int)Constant.PDAResult.Exception;
  454. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  455. }
  456. return actionResult;
  457. }
  458. /// <summary>
  459. /// 校验产品条码是否可以进行干补
  460. /// </summary>
  461. /// <param name="accountCode">帐套code</param>
  462. /// <param name="userCode">用户code</param>
  463. /// <param name="userPassword">用户密码</param>
  464. /// <param name="sessionKey">本次登陆密钥</param>
  465. /// <param name="procedureID">工序ID</param>
  466. /// <param name="barcode">条码</param>
  467. /// <returns></returns>
  468. /// <remarks>
  469. /// 袁新成 2015.4.1 新建
  470. /// </remarks>
  471. public ActionResult CheckDryRepairBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  472. {
  473. ActionResult actionResult = new ActionResult();
  474. try
  475. {
  476. // 验证请求头信息
  477. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  478. // 验证失败
  479. if (actionResult.Status != (int)Constant.PDAResult.Success)
  480. {
  481. return actionResult;
  482. }
  483. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  484. () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
  485. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  486. {
  487. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  488. actionResult.Status = (int)Constant.PDAResult.Success;
  489. }
  490. else
  491. {
  492. actionResult.Status = (int)Constant.PDAResult.Fail;
  493. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  494. }
  495. }
  496. catch (Exception ex)
  497. {
  498. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  499. OutputLog.TraceLog(LogPriority.Error,
  500. this.ToString(),
  501. System.Reflection.MethodBase.GetCurrentMethod().Name,
  502. ex.ToString(),
  503. LocalPath.LogExePath);
  504. actionResult.Status = (int)Constant.PDAResult.Exception;
  505. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  506. }
  507. return actionResult;
  508. }
  509. /// <summary>
  510. /// 检验生产工号
  511. /// </summary>
  512. /// <param name="accountCode">帐套code</param>
  513. /// <param name="userCode">用户code</param>
  514. /// <param name="userPassword">用户密码</param>
  515. /// <param name="sessionKey">本次登陆密钥</param>
  516. /// <param name="procedureID">工序ID</param>
  517. /// <param name="procedureUserCode">生产工号</param>
  518. /// <remarks>
  519. /// 陈冰 2014.09.18 新建
  520. /// </remarks>
  521. public ActionResult CheckProcedureUser(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
  522. {
  523. ActionResult actionResult = new ActionResult();
  524. try
  525. {
  526. // 验证请求头信息
  527. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  528. // 验证失败
  529. if (actionResult.Status != (int)Constant.PDAResult.Success)
  530. {
  531. return actionResult;
  532. }
  533. CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
  534. () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
  535. actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
  536. actionResult.Status = (int)Constant.PDAResult.Success;
  537. }
  538. catch (Exception ex)
  539. {
  540. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  541. OutputLog.TraceLog(LogPriority.Error,
  542. this.ToString(),
  543. System.Reflection.MethodBase.GetCurrentMethod().Name,
  544. ex.ToString(),
  545. LocalPath.LogExePath);
  546. actionResult.Status = (int)Constant.PDAResult.Exception;
  547. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  548. }
  549. return actionResult;
  550. }
  551. /// <summary>
  552. /// 校验窑车是否可装车并返回窑车信息
  553. /// </summary>
  554. /// <param name="accountCode">帐套code</param>
  555. /// <param name="userCode">用户code</param>
  556. /// <param name="userPassword">用户密码</param>
  557. /// <param name="sessionKey">本次登陆密钥</param>
  558. /// <param name="kilnCarCode">窑车号</param>
  559. /// <param name="modelType">工序类别</param>
  560. /// <returns></returns>
  561. /// <remarks>
  562. /// 陈冰 2014.10.04 新建
  563. /// </remarks>
  564. public ActionResult CheckKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
  565. {
  566. ActionResult actionResult = new ActionResult();
  567. try
  568. {
  569. // 验证请求头信息
  570. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  571. // 验证失败
  572. if (actionResult.Status != (int)Constant.PDAResult.Success)
  573. {
  574. return actionResult;
  575. }
  576. CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
  577. () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
  578. actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
  579. actionResult.Status = (int)Constant.PDAResult.Success;
  580. }
  581. catch (Exception ex)
  582. {
  583. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  584. OutputLog.TraceLog(LogPriority.Error,
  585. this.ToString(),
  586. System.Reflection.MethodBase.GetCurrentMethod().Name,
  587. ex.ToString(),
  588. LocalPath.LogExePath);
  589. actionResult.Status = (int)Constant.PDAResult.Exception;
  590. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  591. }
  592. return actionResult;
  593. }
  594. #endregion
  595. #region 保存条码信息
  596. /// <summary>
  597. /// 保存条码信息
  598. /// </summary>
  599. /// <param name="accountCode">帐套code</param>
  600. /// <param name="userCode">用户code</param>
  601. /// <param name="userPassword">用户密码</param>
  602. /// <param name="sessionKey">本次登陆密钥</param>
  603. /// <param name="procedureID">工序ID</param>
  604. /// <param name="productionDataEntitys">条码信息</param>
  605. public ActionResult AddWorkPiece(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  606. {
  607. ActionResult actionResult = new ActionResult();
  608. try
  609. {
  610. // 验证请求头信息
  611. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  612. // 验证失败
  613. if (actionResult.Status != (int)Constant.PDAResult.Success)
  614. {
  615. return actionResult;
  616. }
  617. DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
  618. if (!dtProductionData.Columns.Contains("IsPDA"))
  619. {
  620. dtProductionData.Columns.Add("IsPDA");
  621. }
  622. ProcedureEntity procedureInfo = null;
  623. DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
  624. () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
  625. actionResult.Result = JsonHelper.ToJson(resultDT);
  626. actionResult.Status = (int)Constant.PDAResult.Success;
  627. if (resultDT != null)
  628. {
  629. DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
  630. if (drs != null && drs.Length > 0)
  631. {
  632. return actionResult;
  633. }
  634. }
  635. #region PDA条码打印
  636. if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
  637. procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
  638. {
  639. try
  640. {
  641. if (procedureInfo.CollectType == 1)
  642. {
  643. //foreach (DataRow item in dtProductionData.Rows)
  644. //{
  645. // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
  646. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  647. // if (sre.Status != Constant.ServiceResultStatus.Success)
  648. // {
  649. // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  650. // actionResult.Message = sre.Message;
  651. // return actionResult;
  652. // }
  653. //}
  654. }
  655. else
  656. {
  657. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
  658. procedureInfo.BarCodePrintCopies, null, sUserInfo);
  659. if (sre.Status != Constant.ServiceResultStatus.Success)
  660. {
  661. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  662. actionResult.Message = sre.Message;
  663. return actionResult;
  664. }
  665. }
  666. }
  667. catch (Exception ex)
  668. {
  669. OutputLog.TraceLog(LogPriority.Error,
  670. this.ToString(),
  671. System.Reflection.MethodBase.GetCurrentMethod().Name,
  672. ex.ToString(),
  673. LocalPath.LogExePath);
  674. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  675. actionResult.Message = "条码打印异常";
  676. return actionResult;
  677. }
  678. }
  679. #endregion PDA条码打印
  680. }
  681. catch (Exception ex)
  682. {
  683. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  684. OutputLog.TraceLog(LogPriority.Error,
  685. this.ToString(),
  686. System.Reflection.MethodBase.GetCurrentMethod().Name,
  687. ex.ToString(),
  688. LocalPath.LogExePath);
  689. try
  690. {
  691. string ss = JsonHelper.ToJson(productionDataEntitys);
  692. OutputLog.TraceLog(LogPriority.Error,
  693. this.ToString(),
  694. System.Reflection.MethodBase.GetCurrentMethod().Name,
  695. $" userCode:{userCode} procedureID:{procedureID} " + ss,
  696. LocalPath.LogExePath);
  697. }
  698. catch
  699. {
  700. }
  701. actionResult.Status = (int)Constant.PDAResult.Exception;
  702. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  703. }
  704. return actionResult;
  705. }
  706. #endregion
  707. #region 获得系统/基数数据
  708. /// <summary>
  709. /// 获得数据字典
  710. /// </summary>
  711. /// <param name="accountCode">帐套code</param>
  712. /// <param name="userCode">用户code</param>
  713. /// <param name="userPassword">用户密码</param>
  714. /// <param name="sessionKey">本次登陆密钥</param>
  715. /// <param name="dicType">字典类型</param>
  716. /// <returns></returns>
  717. public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  718. {
  719. ActionResult actionResult = new ActionResult();
  720. try
  721. {
  722. // 验证请求头信息
  723. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  724. // 验证失败
  725. if (actionResult.Status != (int)Constant.PDAResult.Success)
  726. {
  727. return actionResult;
  728. }
  729. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  730. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  731. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  732. actionResult.Status = (int)Constant.PDAResult.Success;
  733. }
  734. catch (Exception ex)
  735. {
  736. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  737. OutputLog.TraceLog(LogPriority.Error,
  738. this.ToString(),
  739. System.Reflection.MethodBase.GetCurrentMethod().Name,
  740. ex.ToString(),
  741. LocalPath.LogExePath);
  742. actionResult.Status = (int)Constant.PDAResult.Exception;
  743. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  744. }
  745. return actionResult;
  746. }
  747. #endregion
  748. #region 检验工序接口
  749. /// <summary>
  750. /// 获得检验标识
  751. /// </summary>
  752. /// <param name="accountCode">帐套code</param>
  753. /// <param name="userCode">用户code</param>
  754. /// <param name="userPassword">用户密码</param>
  755. /// <param name="sessionKey">本次登陆密钥</param>
  756. /// <returns></returns>
  757. /// <remarks>
  758. /// 陈冰 2014.10.04 新建
  759. /// </remarks>
  760. public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey)
  761. {
  762. ActionResult actionResult = new ActionResult();
  763. try
  764. {
  765. // 验证请求头信息
  766. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  767. // 验证失败
  768. if (actionResult.Status != (int)Constant.PDAResult.Success)
  769. {
  770. return actionResult;
  771. }
  772. #region 构造缺陷标识的数据源
  773. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  774. #endregion
  775. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  776. actionResult.Status = (int)Constant.PDAResult.Success;
  777. }
  778. catch (Exception ex)
  779. {
  780. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  781. OutputLog.TraceLog(LogPriority.Error,
  782. this.ToString(),
  783. System.Reflection.MethodBase.GetCurrentMethod().Name,
  784. ex.ToString(),
  785. LocalPath.LogExePath);
  786. actionResult.Status = (int)Constant.PDAResult.Exception;
  787. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  788. }
  789. return actionResult;
  790. }
  791. /// <summary>
  792. /// 由条码和当前检验工序获取返工工序
  793. /// </summary>
  794. /// <param name="accountCode">帐套code</param>
  795. /// <param name="userCode">用户code</param>
  796. /// <param name="userPassword">用户密码</param>
  797. /// <param name="sessionKey">本次登陆密钥</param>
  798. /// <param name="procedureID">当前检验工序ID</param>
  799. /// <param name="barcode">条码</param>
  800. /// <returns></returns>
  801. /// <remarks>
  802. /// 陈冰 2014.10.04 新建
  803. /// </remarks>
  804. public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  805. {
  806. ActionResult actionResult = new ActionResult();
  807. try
  808. {
  809. // 验证请求头信息
  810. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  811. // 验证失败
  812. if (actionResult.Status != (int)Constant.PDAResult.Success)
  813. {
  814. return actionResult;
  815. }
  816. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  817. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  818. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  819. {
  820. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  821. actionResult.Status = (int)Constant.PDAResult.Success;
  822. }
  823. else
  824. {
  825. actionResult.Status = (int)Constant.PDAResult.Fail;
  826. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  827. }
  828. }
  829. catch (Exception ex)
  830. {
  831. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  832. OutputLog.TraceLog(LogPriority.Error,
  833. this.ToString(),
  834. System.Reflection.MethodBase.GetCurrentMethod().Name,
  835. ex.ToString(),
  836. LocalPath.LogExePath);
  837. actionResult.Status = (int)Constant.PDAResult.Exception;
  838. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  839. }
  840. return actionResult;
  841. }
  842. /// <summary>
  843. /// 由当前检验工序获取缺陷列表
  844. /// </summary>
  845. /// <param name="accountCode">帐套code</param>
  846. /// <param name="userCode">用户code</param>
  847. /// <param name="userPassword">用户密码</param>
  848. /// <param name="sessionKey">本次登陆密钥</param>
  849. /// <param name="procedureID">当前检验工序ID</param>
  850. /// <param name="defectCode">缺陷编码</param>
  851. /// <returns></returns>
  852. /// <remarks>
  853. /// 陈冰 2014.10.04 新建
  854. /// </remarks>
  855. public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  856. {
  857. ActionResult actionResult = new ActionResult();
  858. try
  859. {
  860. // 验证请求头信息
  861. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  862. // 验证失败
  863. if (actionResult.Status != (int)Constant.PDAResult.Success)
  864. {
  865. return actionResult;
  866. }
  867. object defectDs = ServiceInvoker.Invoke<object>(this,
  868. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  869. if (defectDs != null)
  870. {
  871. actionResult.Result = JsonHelper.ToJson(defectDs);
  872. actionResult.Status = (int)Constant.PDAResult.Success;
  873. }
  874. else
  875. {
  876. actionResult.Status = (int)Constant.PDAResult.Fail;
  877. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  878. }
  879. }
  880. catch (Exception ex)
  881. {
  882. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  883. OutputLog.TraceLog(LogPriority.Error,
  884. this.ToString(),
  885. System.Reflection.MethodBase.GetCurrentMethod().Name,
  886. ex.ToString(),
  887. LocalPath.LogExePath);
  888. actionResult.Status = (int)Constant.PDAResult.Exception;
  889. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  890. }
  891. return actionResult;
  892. }
  893. /// <summary>
  894. /// 根据产品ID查出缺陷位置
  895. /// </summary>
  896. /// <param name="accountCode">帐套code</param>
  897. /// <param name="userCode">用户code</param>
  898. /// <param name="userPassword">用户密码</param>
  899. /// <param name="sessionKey">本次登陆密钥</param>
  900. /// <param name="goodsID">产品ID</param>
  901. /// <param name="positionCode">位置编码</param>
  902. /// <returns></returns>
  903. /// <remarks>
  904. /// 陈冰 2014.10.04 新建
  905. /// </remarks>
  906. public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  907. {
  908. ActionResult actionResult = new ActionResult();
  909. try
  910. {
  911. // 验证请求头信息
  912. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  913. // 验证失败
  914. if (actionResult.Status != (int)Constant.PDAResult.Success)
  915. {
  916. return actionResult;
  917. }
  918. // 缺陷位置已经不用在关联产品
  919. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  920. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  921. if (defectDs != null)
  922. {
  923. actionResult.Result = JsonHelper.ToJson(defectDs);
  924. actionResult.Status = (int)Constant.PDAResult.Success;
  925. }
  926. else
  927. {
  928. actionResult.Status = (int)Constant.PDAResult.Fail;
  929. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  930. }
  931. }
  932. catch (Exception ex)
  933. {
  934. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  935. OutputLog.TraceLog(LogPriority.Error,
  936. this.ToString(),
  937. System.Reflection.MethodBase.GetCurrentMethod().Name,
  938. ex.ToString(),
  939. LocalPath.LogExePath);
  940. actionResult.Status = (int)Constant.PDAResult.Exception;
  941. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  942. }
  943. return actionResult;
  944. }
  945. /// <summary>
  946. /// 通过条码和缺陷查出责任工序
  947. /// </summary>
  948. /// <param name="accountCode">帐套code</param>
  949. /// <param name="userCode">用户code</param>
  950. /// <param name="userPassword">用户密码</param>
  951. /// <param name="sessionKey">本次登陆密钥</param>
  952. /// <param name="barcode">条码</param>
  953. /// <param name="defectid">缺陷ID</param>
  954. /// <returns></returns>
  955. /// <remarks>
  956. /// 陈冰 2014.10.04 新建
  957. /// </remarks>
  958. public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  959. {
  960. ActionResult actionResult = new ActionResult();
  961. try
  962. {
  963. // 验证请求头信息
  964. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  965. // 验证失败
  966. if (actionResult.Status != (int)Constant.PDAResult.Success)
  967. {
  968. return actionResult;
  969. }
  970. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  971. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  972. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  973. {
  974. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  975. actionResult.Status = (int)Constant.PDAResult.Success;
  976. }
  977. else
  978. {
  979. actionResult.Status = (int)Constant.PDAResult.Fail;
  980. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  981. }
  982. }
  983. catch (Exception ex)
  984. {
  985. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  986. OutputLog.TraceLog(LogPriority.Error,
  987. this.ToString(),
  988. System.Reflection.MethodBase.GetCurrentMethod().Name,
  989. ex.ToString(),
  990. LocalPath.LogExePath);
  991. actionResult.Status = (int)Constant.PDAResult.Exception;
  992. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  993. }
  994. return actionResult;
  995. }
  996. /// <summary>
  997. /// 通过条码与工序查出责任工号(己废)
  998. /// </summary>
  999. /// <param name="accountCode">帐套code</param>
  1000. /// <param name="userCode">用户code</param>
  1001. /// <param name="userPassword">用户密码</param>
  1002. /// <param name="sessionKey">本次登陆密钥</param>
  1003. /// <param name="barcode">条码</param>
  1004. /// <param name="dutyProcedureID">责任工序</param>
  1005. /// <returns></returns>
  1006. /// <remarks>
  1007. /// 陈冰 2014.10.04 新建
  1008. /// </remarks>
  1009. public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  1010. {
  1011. ActionResult actionResult = new ActionResult();
  1012. try
  1013. {
  1014. // 验证请求头信息
  1015. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1016. // 验证失败
  1017. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1018. {
  1019. return actionResult;
  1020. }
  1021. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1022. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  1023. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1024. {
  1025. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1026. actionResult.Status = (int)Constant.PDAResult.Success;
  1027. }
  1028. else
  1029. {
  1030. actionResult.Status = (int)Constant.PDAResult.Fail;
  1031. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1032. }
  1033. }
  1034. catch (Exception ex)
  1035. {
  1036. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1037. OutputLog.TraceLog(LogPriority.Error,
  1038. this.ToString(),
  1039. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1040. ex.ToString(),
  1041. LocalPath.LogExePath);
  1042. actionResult.Status = (int)Constant.PDAResult.Exception;
  1043. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1044. }
  1045. return actionResult;
  1046. }
  1047. /// <summary>
  1048. /// 通过条码与工序查出责任工号
  1049. /// </summary>
  1050. /// <param name="accountCode"></param>
  1051. /// <param name="userCode"></param>
  1052. /// <param name="userPassword"></param>
  1053. /// <param name="sessionKey"></param>
  1054. /// <param name="ProductionDataID">生产数据ID</param>
  1055. /// <returns></returns>
  1056. public ActionResult GetDutyProcedureCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1057. {
  1058. ActionResult actionResult = new ActionResult();
  1059. try
  1060. {
  1061. // 验证请求头信息
  1062. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1063. // 验证失败
  1064. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1065. {
  1066. return actionResult;
  1067. }
  1068. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1069. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1070. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1071. {
  1072. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1073. actionResult.Status = (int)Constant.PDAResult.Success;
  1074. }
  1075. else
  1076. {
  1077. actionResult.Status = (int)Constant.PDAResult.Fail;
  1078. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1079. }
  1080. }
  1081. catch (Exception ex)
  1082. {
  1083. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1084. OutputLog.TraceLog(LogPriority.Error,
  1085. this.ToString(),
  1086. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1087. ex.ToString(),
  1088. LocalPath.LogExePath);
  1089. actionResult.Status = (int)Constant.PDAResult.Exception;
  1090. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1091. }
  1092. return actionResult;
  1093. }
  1094. /// <summary>
  1095. /// 通过生产数据与工号ID查询工种
  1096. /// </summary>
  1097. /// <param name="accountCode">帐套code</param>
  1098. /// <param name="userCode">用户code</param>
  1099. /// <param name="userPassword">用户密码</param>
  1100. /// <param name="sessionKey">本次登陆密钥</param>
  1101. /// <param name="productionDataID">生产数据ID</param>
  1102. /// <param name="userID">工号ID</param>
  1103. /// <returns></returns>
  1104. /// <remarks>
  1105. /// 陈冰 2014.10.08 新建
  1106. /// </remarks>
  1107. public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey,
  1108. //int productionDataID, int userID)
  1109. int classesSettingID, int defectid, int procedureID)
  1110. {
  1111. ActionResult actionResult = new ActionResult();
  1112. try
  1113. {
  1114. // 验证请求头信息
  1115. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1116. // 验证失败
  1117. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1118. {
  1119. return actionResult;
  1120. }
  1121. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1122. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1123. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  1124. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1125. {
  1126. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1127. actionResult.Status = (int)Constant.PDAResult.Success;
  1128. }
  1129. else
  1130. {
  1131. actionResult.Status = (int)Constant.PDAResult.Fail;
  1132. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1133. }
  1134. }
  1135. catch (Exception ex)
  1136. {
  1137. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1138. OutputLog.TraceLog(LogPriority.Error,
  1139. this.ToString(),
  1140. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1141. ex.ToString(),
  1142. LocalPath.LogExePath);
  1143. actionResult.Status = (int)Constant.PDAResult.Exception;
  1144. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1145. }
  1146. return actionResult;
  1147. }
  1148. /// <summary>
  1149. /// 根据生产数据ID,用户ID及工种选出责任员工
  1150. /// </summary>
  1151. /// <param name="accountCode">帐套code</param>
  1152. /// <param name="userCode">用户code</param>
  1153. /// <param name="userPassword">用户密码</param>
  1154. /// <param name="sessionKey">本次登陆密钥</param>
  1155. /// <param name="productionDataID">生产数据ID</param>
  1156. /// <param name="userID">工号ID</param>
  1157. /// <param name="jobsID">工种ID</param>
  1158. /// <returns></returns>
  1159. /// <remarks>
  1160. /// 陈冰 2014.10.08 新建
  1161. /// </remarks>
  1162. public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey,
  1163. //int productionDataID, int userID, int jobsID)
  1164. int classesSettingID, int jobsID)
  1165. {
  1166. ActionResult actionResult = new ActionResult();
  1167. try
  1168. {
  1169. // 验证请求头信息
  1170. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1171. // 验证失败
  1172. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1173. {
  1174. return actionResult;
  1175. }
  1176. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1177. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1178. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1179. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1180. {
  1181. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1182. actionResult.Status = (int)Constant.PDAResult.Success;
  1183. }
  1184. else
  1185. {
  1186. actionResult.Status = (int)Constant.PDAResult.Fail;
  1187. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1188. }
  1189. }
  1190. catch (Exception ex)
  1191. {
  1192. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1193. OutputLog.TraceLog(LogPriority.Error,
  1194. this.ToString(),
  1195. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1196. ex.ToString(),
  1197. LocalPath.LogExePath);
  1198. actionResult.Status = (int)Constant.PDAResult.Exception;
  1199. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1200. }
  1201. return actionResult;
  1202. }
  1203. /// <summary>
  1204. /// 获得产品分级
  1205. /// </summary>
  1206. /// <param name="accountCode">帐套code</param>
  1207. /// <param name="userCode">用户code</param>
  1208. /// <param name="userPassword">用户密码</param>
  1209. /// <param name="sessionKey">本次登陆密钥</param>
  1210. /// <returns></returns>
  1211. /// <remarks>
  1212. /// 陈冰 2014.10.08 新建
  1213. /// </remarks>
  1214. public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey)
  1215. {
  1216. ActionResult actionResult = new ActionResult();
  1217. try
  1218. {
  1219. // 验证请求头信息
  1220. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1221. // 验证失败
  1222. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1223. {
  1224. return actionResult;
  1225. }
  1226. #region 构造产品分级的数据源
  1227. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1228. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2, sUserInfo);
  1229. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1230. {
  1231. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1232. actionResult.Status = (int)Constant.PDAResult.Success;
  1233. }
  1234. else
  1235. {
  1236. actionResult.Status = (int)Constant.PDAResult.Fail;
  1237. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1238. }
  1239. #endregion
  1240. }
  1241. catch (Exception ex)
  1242. {
  1243. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1244. OutputLog.TraceLog(LogPriority.Error,
  1245. this.ToString(),
  1246. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1247. ex.ToString(),
  1248. LocalPath.LogExePath);
  1249. OutputLog.TraceLog(LogPriority.Error,
  1250. this.ToString(),
  1251. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1252. ex.ToString(),
  1253. LocalPath.LogExePath);
  1254. actionResult.Status = (int)Constant.PDAResult.Exception;
  1255. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1256. }
  1257. return actionResult;
  1258. }
  1259. #endregion
  1260. #region 保存检验条码
  1261. /// <summary>
  1262. /// 保存检验条码
  1263. /// </summary>
  1264. /// <param name="accountCode">帐套code</param>
  1265. /// <param name="userCode">用户code</param>
  1266. /// <param name="userPassword">用户密码</param>
  1267. /// <param name="sessionKey">本次登陆密钥</param>
  1268. /// <param name="procedureID">工序ID</param>
  1269. /// <param name="productionDataEntitys">条码信息</param>
  1270. /// <returns></returns>
  1271. public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1272. {
  1273. ActionResult actionResult = new ActionResult();
  1274. try
  1275. {
  1276. // 验证请求头信息
  1277. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1278. // 验证失败
  1279. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1280. {
  1281. return actionResult;
  1282. }
  1283. //if(productionDataEntitys.Length>0)
  1284. //{
  1285. // if(productionDataEntitys[0].ProductionDataID>0)
  1286. // {
  1287. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1288. // }
  1289. //}
  1290. string err = ServiceInvoker.Invoke<string>(this,
  1291. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1292. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1293. if (err == null)
  1294. {
  1295. err = "";
  1296. }
  1297. //actionResult.Result = JsonHelper.ToJson(err);
  1298. actionResult.Result = err;// JsonHelper.ToJson(err);
  1299. actionResult.Status = (int)Constant.PDAResult.Success;
  1300. }
  1301. catch (Exception ex)
  1302. {
  1303. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1304. OutputLog.TraceLog(LogPriority.Error,
  1305. this.ToString(),
  1306. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1307. ex.ToString(),
  1308. LocalPath.LogExePath);
  1309. actionResult.Status = (int)Constant.PDAResult.Exception;
  1310. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1311. }
  1312. return actionResult;
  1313. }
  1314. #endregion
  1315. #region 文件上传下载
  1316. /// <summary>
  1317. /// 软件更新
  1318. /// </summary>
  1319. /// <param name="accountCode">帐套code</param>
  1320. /// <param name="userCode">用户code</param>
  1321. /// <param name="userPassword">用户密码</param>
  1322. /// <param name="sessionKey">本次登陆密钥</param>
  1323. /// <returns></returns>
  1324. public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey)
  1325. {
  1326. try
  1327. {
  1328. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1329. }
  1330. catch (Exception ex)
  1331. {
  1332. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1333. OutputLog.TraceLog(LogPriority.Error,
  1334. this.ToString(),
  1335. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1336. ex.ToString(),
  1337. LocalPath.LogExePath);
  1338. return null;
  1339. }
  1340. }
  1341. /// <summary>
  1342. /// 上传临时文件
  1343. /// </summary>
  1344. /// <param name="imgStream"></param>
  1345. /// <returns></returns>
  1346. public ActionResult SaveImg(Stream mageStream)
  1347. {
  1348. ActionResult actionResult = new ActionResult();
  1349. try
  1350. {
  1351. string err = PDAModuleLogic.SaveImg(mageStream);
  1352. if (err == null)
  1353. {
  1354. err = "";
  1355. }
  1356. actionResult.Result = err;
  1357. actionResult.Status = (int)Constant.PDAResult.Success;
  1358. }
  1359. catch (Exception ex)
  1360. {
  1361. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1362. OutputLog.TraceLog(LogPriority.Error,
  1363. this.ToString(),
  1364. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1365. ex.ToString(),
  1366. LocalPath.LogExePath);
  1367. actionResult.Status = (int)Constant.PDAResult.Exception;
  1368. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1369. }
  1370. return actionResult;
  1371. }
  1372. public Stream GetFileTest(string path)
  1373. {
  1374. return PDAModuleLogic.GetImg(path);
  1375. }
  1376. public Stream GetFileStream()
  1377. {
  1378. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1379. long l = fs.Length;
  1380. return fs;
  1381. }
  1382. public byte[] GetFileTestByte(string path)
  1383. {
  1384. FileStream stream = new FileInfo(path).OpenRead();
  1385. Byte[] buffer = new Byte[stream.Length];
  1386. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1387. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1388. return buffer;
  1389. }
  1390. public string GetFile(string path)
  1391. {
  1392. string imgFilePath = path;
  1393. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1394. int i = (int)fs.Length;
  1395. byte[] content = new byte[i];
  1396. fs.Read(content, 0, i);
  1397. string result = Convert.ToBase64String(content);
  1398. fs.Close();
  1399. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1400. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1401. sw.Write(result);
  1402. sw.Close();
  1403. fsTxt.Close();
  1404. return result;
  1405. }
  1406. #endregion
  1407. /// <summary>
  1408. /// 获得产品分级
  1409. /// </summary>
  1410. /// <param name="accountCode">帐套code</param>
  1411. /// <param name="userCode">用户code</param>
  1412. /// <param name="userPassword">用户密码</param>
  1413. /// <param name="sessionKey">本次登陆密钥</param>
  1414. /// <param name="procedureID">当前工序ID</param>
  1415. /// <returns></returns>
  1416. /// <remarks>
  1417. /// 陈冰 2014.10.22 新建
  1418. /// </remarks>
  1419. public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1420. {
  1421. ActionResult actionResult = new ActionResult();
  1422. try
  1423. {
  1424. // 验证请求头信息
  1425. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1426. // 验证失败
  1427. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1428. {
  1429. return actionResult;
  1430. }
  1431. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1432. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1433. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1434. {
  1435. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1436. actionResult.Status = (int)Constant.PDAResult.Success;
  1437. }
  1438. else
  1439. {
  1440. actionResult.Status = (int)Constant.PDAResult.Fail;
  1441. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1442. }
  1443. }
  1444. catch (Exception ex)
  1445. {
  1446. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1447. OutputLog.TraceLog(LogPriority.Error,
  1448. this.ToString(),
  1449. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1450. ex.ToString(),
  1451. LocalPath.LogExePath);
  1452. actionResult.Status = (int)Constant.PDAResult.Exception;
  1453. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1454. }
  1455. return actionResult;
  1456. }
  1457. /// <summary>
  1458. /// 获得产品分级
  1459. /// </summary>
  1460. /// <param name="accountCode">帐套code</param>
  1461. /// <param name="userCode">用户code</param>
  1462. /// <param name="userPassword">用户密码</param>
  1463. /// <param name="sessionKey">本次登陆密钥</param>
  1464. /// <param name="barcode">条码</param>
  1465. /// <returns></returns>
  1466. public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1467. {
  1468. ActionResult actionResult = new ActionResult();
  1469. try
  1470. {
  1471. // 验证请求头信息
  1472. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1473. // 验证失败
  1474. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1475. {
  1476. return actionResult;
  1477. }
  1478. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1479. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1480. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1481. {
  1482. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1483. actionResult.Status = (int)Constant.PDAResult.Success;
  1484. }
  1485. else
  1486. {
  1487. actionResult.Status = (int)Constant.PDAResult.Fail;
  1488. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1489. }
  1490. }
  1491. catch (Exception ex)
  1492. {
  1493. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1494. OutputLog.TraceLog(LogPriority.Error,
  1495. this.ToString(),
  1496. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1497. ex.ToString(),
  1498. LocalPath.LogExePath);
  1499. actionResult.Status = (int)Constant.PDAResult.Exception;
  1500. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1501. }
  1502. return actionResult;
  1503. }
  1504. #region 统计
  1505. /// <summary>
  1506. /// 统计当日计数数量
  1507. /// </summary>
  1508. /// <param name="accountCode">帐套code</param>
  1509. /// <param name="userCode">用户code</param>
  1510. /// <param name="userPassword">用户密码</param>
  1511. /// <param name="sessionKey">本次登陆密钥</param>
  1512. /// <param name="procedureID">工序ID</param>
  1513. /// <returns></returns>
  1514. public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1515. {
  1516. ActionResult actionResult = new ActionResult();
  1517. try
  1518. {
  1519. // 验证请求头信息
  1520. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1521. // 验证失败
  1522. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1523. {
  1524. return actionResult;
  1525. }
  1526. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1527. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1528. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1529. {
  1530. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1531. actionResult.Status = (int)Constant.PDAResult.Success;
  1532. }
  1533. else
  1534. {
  1535. actionResult.Status = (int)Constant.PDAResult.Fail;
  1536. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1537. }
  1538. }
  1539. catch (Exception ex)
  1540. {
  1541. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1542. OutputLog.TraceLog(LogPriority.Error,
  1543. this.ToString(),
  1544. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1545. ex.ToString(),
  1546. LocalPath.LogExePath);
  1547. actionResult.Status = (int)Constant.PDAResult.Exception;
  1548. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1549. }
  1550. return actionResult;
  1551. }
  1552. /// <summary>
  1553. /// 统计当日计数数量
  1554. /// </summary>
  1555. /// <param name="accountCode">帐套code</param>
  1556. /// <param name="userCode">用户code</param>
  1557. /// <param name="userPassword">用户密码</param>
  1558. /// <param name="sessionKey">本次登陆密钥</param>
  1559. /// <param name="procedureID">工序ID</param>
  1560. /// <returns></returns>
  1561. public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1562. {
  1563. ActionResult actionResult = new ActionResult();
  1564. try
  1565. {
  1566. // 验证请求头信息
  1567. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1568. // 验证失败
  1569. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1570. {
  1571. return actionResult;
  1572. }
  1573. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1574. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1575. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1576. {
  1577. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1578. actionResult.Status = (int)Constant.PDAResult.Success;
  1579. }
  1580. else
  1581. {
  1582. actionResult.Status = (int)Constant.PDAResult.Fail;
  1583. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1584. }
  1585. }
  1586. catch (Exception ex)
  1587. {
  1588. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1589. OutputLog.TraceLog(LogPriority.Error,
  1590. this.ToString(),
  1591. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1592. ex.ToString(),
  1593. LocalPath.LogExePath);
  1594. actionResult.Status = (int)Constant.PDAResult.Exception;
  1595. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1596. }
  1597. return actionResult;
  1598. }
  1599. /// <summary>
  1600. /// 统计产品跟踪
  1601. /// </summary>
  1602. /// <param name="accountCode">帐套code</param>
  1603. /// <param name="userCode">用户code</param>
  1604. /// <param name="userPassword">用户密码</param>
  1605. /// <param name="sessionKey">本次登陆密钥</param>
  1606. /// <param name="procedureID">工序ID</param>
  1607. /// <returns></returns>
  1608. public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1609. {
  1610. ActionResult actionResult = new ActionResult();
  1611. try
  1612. {
  1613. // 验证请求头信息
  1614. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1615. // 验证失败
  1616. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1617. {
  1618. return actionResult;
  1619. }
  1620. RPT020101_SE se = new RPT020101_SE();
  1621. se.Barcode = barcode;
  1622. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1623. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1624. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1625. {
  1626. actionResult.Status = (int)Constant.PDAResult.Fail;
  1627. actionResult.Message = Messages.MSG_CMN_I002;
  1628. }
  1629. else
  1630. {
  1631. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1632. actionResult.Status = (int)Constant.PDAResult.Success;
  1633. }
  1634. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1635. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1636. //if (productionDataEntity != null)
  1637. //{
  1638. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1639. // actionResult.Status = (int)Constant.PDAResult.Success;
  1640. //}
  1641. //else
  1642. //{
  1643. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1644. // actionResult.Message = Messages.MSG_CMN_I002;
  1645. //}
  1646. }
  1647. catch (Exception ex)
  1648. {
  1649. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1650. OutputLog.TraceLog(LogPriority.Error,
  1651. this.ToString(),
  1652. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1653. ex.ToString() + ex.HelpLink,
  1654. LocalPath.LogExePath);
  1655. actionResult.Status = (int)Constant.PDAResult.Exception;
  1656. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1657. }
  1658. return actionResult;
  1659. }
  1660. #endregion
  1661. #region 撤销装车及成检
  1662. /// <summary>
  1663. /// 检验条码是否可以撤销装车
  1664. /// </summary>
  1665. /// <param name="accountCode">帐套code</param>
  1666. /// <param name="userCode">用户code</param>
  1667. /// <param name="userPassword">用户密码</param>
  1668. /// <param name="sessionKey">本次登陆密钥</param>
  1669. /// <param name="procedureID">当前工序ID</param>
  1670. /// <param name="barcode">条码</param>
  1671. /// <returns></returns>
  1672. public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1673. {
  1674. ActionResult actionResult = new ActionResult();
  1675. try
  1676. {
  1677. // 验证请求头信息
  1678. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1679. // 验证失败
  1680. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1681. {
  1682. return actionResult;
  1683. }
  1684. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1685. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1686. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1687. actionResult.Status = (int)Constant.PDAResult.Success;
  1688. }
  1689. catch (Exception ex)
  1690. {
  1691. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1692. OutputLog.TraceLog(LogPriority.Error,
  1693. this.ToString(),
  1694. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1695. ex.ToString(),
  1696. LocalPath.LogExePath);
  1697. actionResult.Status = (int)Constant.PDAResult.Exception;
  1698. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1699. }
  1700. return actionResult;
  1701. }
  1702. /// <summary>
  1703. /// 保存撤销装车的条码
  1704. /// </summary>
  1705. /// <param name="accountCode">帐套code</param>
  1706. /// <param name="userCode">用户code</param>
  1707. /// <param name="userPassword">用户密码</param>
  1708. /// <param name="sessionKey">本次登陆密钥</param>
  1709. /// <param name="procedureID">当前工序ID</param>
  1710. /// <param name="barcode">条码</param>
  1711. /// <returns></returns>
  1712. public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1713. {
  1714. ActionResult actionResult = new ActionResult();
  1715. try
  1716. {
  1717. // 验证请求头信息
  1718. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1719. // 验证失败
  1720. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1721. {
  1722. return actionResult;
  1723. }
  1724. string err = ServiceInvoker.Invoke<string>(this,
  1725. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1726. if (err == null)
  1727. {
  1728. err = "";
  1729. }
  1730. actionResult.Result = JsonHelper.ToJson(err);
  1731. actionResult.Status = (int)Constant.PDAResult.Success;
  1732. }
  1733. catch (Exception ex)
  1734. {
  1735. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1736. OutputLog.TraceLog(LogPriority.Error,
  1737. this.ToString(),
  1738. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1739. ex.ToString(),
  1740. LocalPath.LogExePath);
  1741. actionResult.Status = (int)Constant.PDAResult.Exception;
  1742. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1743. }
  1744. return actionResult;
  1745. }
  1746. /// <summary>
  1747. /// 由产品条码获取注浆信息
  1748. /// </summary>
  1749. /// <param name="barcode"></param>
  1750. /// <returns></returns>
  1751. public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1752. {
  1753. ActionResult actionResult = new ActionResult();
  1754. try
  1755. {
  1756. // 验证请求头信息
  1757. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1758. // 验证失败
  1759. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1760. {
  1761. return actionResult;
  1762. }
  1763. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1764. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1765. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1766. {
  1767. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1768. actionResult.Status = (int)Constant.PDAResult.Success;
  1769. }
  1770. else
  1771. {
  1772. actionResult.Status = (int)Constant.PDAResult.Fail;
  1773. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1774. }
  1775. }
  1776. catch (Exception ex)
  1777. {
  1778. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1779. OutputLog.TraceLog(LogPriority.Error,
  1780. this.ToString(),
  1781. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1782. ex.ToString(),
  1783. LocalPath.LogExePath);
  1784. actionResult.Status = (int)Constant.PDAResult.Exception;
  1785. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1786. }
  1787. return actionResult;
  1788. }
  1789. /// <summary>
  1790. /// 获取工号下的所有工种信息
  1791. /// </summary>
  1792. /// <param name="UserID">工号ID</param>
  1793. /// <returns></returns>
  1794. public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1795. {
  1796. ActionResult actionResult = new ActionResult();
  1797. try
  1798. {
  1799. // 验证请求头信息
  1800. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1801. // 验证失败
  1802. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1803. {
  1804. return actionResult;
  1805. }
  1806. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1807. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1808. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1809. {
  1810. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1811. actionResult.Status = (int)Constant.PDAResult.Success;
  1812. }
  1813. else
  1814. {
  1815. actionResult.Status = (int)Constant.PDAResult.Fail;
  1816. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1817. }
  1818. }
  1819. catch (Exception ex)
  1820. {
  1821. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1822. OutputLog.TraceLog(LogPriority.Error,
  1823. this.ToString(),
  1824. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1825. ex.ToString(),
  1826. LocalPath.LogExePath);
  1827. actionResult.Status = (int)Constant.PDAResult.Exception;
  1828. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1829. }
  1830. return actionResult;
  1831. }
  1832. /// <summary>
  1833. /// 根据所选工号对应的工种,查出缺陷责任员工
  1834. /// </summary>
  1835. /// <param name="jobs">工种ID</param>
  1836. /// <returns></returns>
  1837. public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  1838. {
  1839. ActionResult actionResult = new ActionResult();
  1840. try
  1841. {
  1842. // 验证请求头信息
  1843. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1844. // 验证失败
  1845. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1846. {
  1847. return actionResult;
  1848. }
  1849. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1850. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  1851. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1852. {
  1853. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1854. actionResult.Status = (int)Constant.PDAResult.Success;
  1855. }
  1856. else
  1857. {
  1858. actionResult.Status = (int)Constant.PDAResult.Fail;
  1859. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1860. }
  1861. }
  1862. catch (Exception ex)
  1863. {
  1864. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1865. OutputLog.TraceLog(LogPriority.Error,
  1866. this.ToString(),
  1867. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1868. ex.ToString(),
  1869. LocalPath.LogExePath);
  1870. actionResult.Status = (int)Constant.PDAResult.Exception;
  1871. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1872. }
  1873. return actionResult;
  1874. }
  1875. /// <summary>
  1876. /// 根据所选工号,查出漏检责任员工
  1877. /// </summary>
  1878. /// <param name="userid">工号</param>
  1879. /// <returns></returns>
  1880. public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  1881. {
  1882. ActionResult actionResult = new ActionResult();
  1883. try
  1884. {
  1885. // 验证请求头信息
  1886. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1887. // 验证失败
  1888. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1889. {
  1890. return actionResult;
  1891. }
  1892. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1893. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  1894. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1895. {
  1896. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1897. actionResult.Status = (int)Constant.PDAResult.Success;
  1898. }
  1899. else
  1900. {
  1901. actionResult.Status = (int)Constant.PDAResult.Fail;
  1902. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1903. }
  1904. }
  1905. catch (Exception ex)
  1906. {
  1907. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1908. OutputLog.TraceLog(LogPriority.Error,
  1909. this.ToString(),
  1910. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1911. ex.ToString(),
  1912. LocalPath.LogExePath);
  1913. actionResult.Status = (int)Constant.PDAResult.Exception;
  1914. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1915. }
  1916. return actionResult;
  1917. }
  1918. /// <summary>
  1919. /// 获取用户列表
  1920. /// </summary>
  1921. /// <param name="requestEntity">用户实体</param>
  1922. /// <returns></returns>
  1923. public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  1924. {
  1925. ActionResult actionResult = new ActionResult();
  1926. try
  1927. {
  1928. // 验证请求头信息
  1929. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1930. // 验证失败
  1931. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1932. {
  1933. return actionResult;
  1934. }
  1935. SUserEntity requestEntity = new SUserEntity();
  1936. requestEntity.IsWorker = IsWorker;
  1937. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1938. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  1939. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1940. {
  1941. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1942. actionResult.Status = (int)Constant.PDAResult.Success;
  1943. }
  1944. else
  1945. {
  1946. actionResult.Status = (int)Constant.PDAResult.Fail;
  1947. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1948. }
  1949. }
  1950. catch (Exception ex)
  1951. {
  1952. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1953. OutputLog.TraceLog(LogPriority.Error,
  1954. this.ToString(),
  1955. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1956. ex.ToString(),
  1957. LocalPath.LogExePath);
  1958. actionResult.Status = (int)Constant.PDAResult.Exception;
  1959. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1960. }
  1961. return actionResult;
  1962. }
  1963. /// <summary>
  1964. /// 获取数据字典管理的数据
  1965. /// </summary>
  1966. /// <param name="Pvalue">显示停用标识</param>
  1967. /// <param name="dictionaryType">字典类别</param>
  1968. /// <returns></returns>
  1969. /// <remarks>
  1970. /// 2014.12.03 新建
  1971. /// </remarks>
  1972. public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  1973. {
  1974. ActionResult actionResult = new ActionResult();
  1975. try
  1976. {
  1977. // 验证请求头信息
  1978. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1979. // 验证失败
  1980. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1981. {
  1982. return actionResult;
  1983. }
  1984. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1985. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  1986. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1987. {
  1988. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1989. actionResult.Status = (int)Constant.PDAResult.Success;
  1990. }
  1991. else
  1992. {
  1993. actionResult.Status = (int)Constant.PDAResult.Fail;
  1994. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1995. }
  1996. }
  1997. catch (Exception ex)
  1998. {
  1999. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2000. OutputLog.TraceLog(LogPriority.Error,
  2001. this.ToString(),
  2002. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2003. ex.ToString(),
  2004. LocalPath.LogExePath);
  2005. actionResult.Status = (int)Constant.PDAResult.Exception;
  2006. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2007. }
  2008. return actionResult;
  2009. }
  2010. #endregion
  2011. #region 保存半检数据
  2012. /// <summary>
  2013. /// 保存半检数据
  2014. /// </summary>
  2015. /// <param name="accountCode">帐套code</param>
  2016. /// <param name="userCode">用户code</param>
  2017. /// <param name="userPassword">用户密码</param>
  2018. /// <param name="sessionKey">本次登陆密钥</param>
  2019. /// <param name="productionDataEntitys">半检信息</param>
  2020. /// <returns></returns>
  2021. public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  2022. {
  2023. ActionResult actionResult = new ActionResult();
  2024. try
  2025. {
  2026. // 验证请求头信息
  2027. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2028. // 验证失败
  2029. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2030. {
  2031. return actionResult;
  2032. }
  2033. string err = ServiceInvoker.Invoke<string>(this,
  2034. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2035. if (err == null)
  2036. {
  2037. err = "";
  2038. }
  2039. actionResult.Result = JsonHelper.ToJson(err);
  2040. actionResult.Status = (int)Constant.PDAResult.Success;
  2041. }
  2042. catch (Exception ex)
  2043. {
  2044. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2045. OutputLog.TraceLog(LogPriority.Error,
  2046. this.ToString(),
  2047. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2048. ex.ToString(),
  2049. LocalPath.LogExePath);
  2050. actionResult.Status = (int)Constant.PDAResult.Exception;
  2051. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2052. }
  2053. return actionResult;
  2054. }
  2055. #endregion
  2056. /// <summary>
  2057. /// 获取产品列表
  2058. /// </summary>
  2059. /// <returns></returns>
  2060. public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  2061. {
  2062. ActionResult actionResult = new ActionResult();
  2063. try
  2064. {
  2065. // 验证请求头信息
  2066. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2067. // 验证失败
  2068. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2069. {
  2070. return actionResult;
  2071. }
  2072. GoodsEntity goodsEntity = new GoodsEntity();
  2073. goodsEntity.ValueFlag = 1;//有效标记
  2074. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2075. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2076. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2077. {
  2078. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2079. actionResult.Status = (int)Constant.PDAResult.Success;
  2080. }
  2081. else
  2082. {
  2083. actionResult.Status = (int)Constant.PDAResult.Fail;
  2084. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2085. }
  2086. }
  2087. catch (Exception ex)
  2088. {
  2089. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2090. OutputLog.TraceLog(LogPriority.Error,
  2091. this.ToString(),
  2092. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2093. ex.ToString(),
  2094. LocalPath.LogExePath);
  2095. actionResult.Status = (int)Constant.PDAResult.Exception;
  2096. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2097. }
  2098. return actionResult;
  2099. }
  2100. /// <summary>
  2101. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2102. /// </summary>
  2103. /// <param name="searchEntity">生产数据实体类</param>
  2104. /// <returns>DataTable</returns>
  2105. public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2106. {
  2107. ActionResult actionResult = new ActionResult();
  2108. try
  2109. {
  2110. // 验证请求头信息
  2111. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2112. // 验证失败
  2113. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2114. {
  2115. return actionResult;
  2116. }
  2117. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2118. searchEntity.ProcedureID = ProcedureID;
  2119. searchEntity.BarCode = BarCode;
  2120. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2121. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2122. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2123. {
  2124. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2125. actionResult.Status = (int)Constant.PDAResult.Success;
  2126. }
  2127. else
  2128. {
  2129. actionResult.Status = (int)Constant.PDAResult.Fail;
  2130. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2131. }
  2132. }
  2133. catch (Exception ex)
  2134. {
  2135. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2136. OutputLog.TraceLog(LogPriority.Error,
  2137. this.ToString(),
  2138. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2139. ex.ToString(),
  2140. LocalPath.LogExePath);
  2141. actionResult.Status = (int)Constant.PDAResult.Exception;
  2142. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2143. }
  2144. return actionResult;
  2145. }
  2146. /// <summary>
  2147. /// 根据所选生产数据ID,显示成检数据信息
  2148. /// </summary>
  2149. /// <param name="productionDataID">生产数据ID</param>
  2150. /// <returns>DataSet</returns>
  2151. public ActionResult GetProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2152. {
  2153. ActionResult actionResult = new ActionResult();
  2154. try
  2155. {
  2156. // 验证请求头信息
  2157. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2158. // 验证失败
  2159. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2160. {
  2161. return actionResult;
  2162. }
  2163. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2164. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2165. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2166. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2167. {
  2168. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2169. {
  2170. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2171. {
  2172. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2173. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2174. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2175. {
  2176. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2177. }
  2178. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2179. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2180. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2181. {
  2182. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2183. }
  2184. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2185. {
  2186. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2187. }
  2188. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2189. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2190. {
  2191. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2192. }
  2193. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2194. {
  2195. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2196. }
  2197. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2198. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2199. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2200. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2201. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2202. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2203. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2204. {
  2205. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2206. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2207. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2208. }
  2209. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2210. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2211. {
  2212. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2213. }
  2214. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2215. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2216. DataTable dtDefect = dvDefect.ToTable();
  2217. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2218. {
  2219. // 产品缺陷
  2220. PDADefectResult defect = new PDADefectResult();
  2221. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2222. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2223. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2224. {
  2225. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2226. }
  2227. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2228. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2229. {
  2230. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2231. }
  2232. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2233. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2234. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2235. {
  2236. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2237. }
  2238. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2239. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2240. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2241. {
  2242. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2243. }
  2244. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2245. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2246. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2247. {
  2248. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2249. }
  2250. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2251. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2252. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2253. {
  2254. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2255. }
  2256. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2257. {
  2258. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2259. }
  2260. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2261. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2262. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2263. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2264. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2265. {
  2266. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2267. }
  2268. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2269. {
  2270. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2271. }
  2272. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2273. {
  2274. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2275. }
  2276. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2277. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2278. //--------责任员工-------------------
  2279. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2280. if (drRow.Length > Constant.INT_IS_ZERO)
  2281. {
  2282. foreach (DataRow r in drRow)
  2283. {
  2284. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2285. if (r["ProductionDefectID"].ToString() != "")
  2286. {
  2287. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2288. }
  2289. if (r["StaffID"].ToString() != "")
  2290. {
  2291. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2292. }
  2293. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2294. defectResponsible.StaffName = r["StaffName"].ToString();
  2295. if (r["StaffStatus"].ToString() != "")
  2296. {
  2297. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2298. }
  2299. if (r["UJobsID"].ToString() != "")
  2300. {
  2301. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2302. }
  2303. if (r["SJobsID"].ToString() != "")
  2304. {
  2305. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2306. }
  2307. defect.PDADefectResponsibles.Add(defectResponsible);
  2308. }
  2309. }
  2310. //------------------------------
  2311. //--------漏检员工-------------------
  2312. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2313. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2314. {
  2315. foreach (DataRow r in drMissedRow)
  2316. {
  2317. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2318. if (r["ProductionDefectID"].ToString() != "")
  2319. {
  2320. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2321. }
  2322. if (r["StaffID"].ToString() != "")
  2323. {
  2324. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2325. }
  2326. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2327. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2328. if (r["StaffStatus"].ToString() != "")
  2329. {
  2330. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2331. }
  2332. if (r["UJobsID"].ToString() != "")
  2333. {
  2334. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2335. }
  2336. if (r["SJobsID"].ToString() != "")
  2337. {
  2338. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2339. }
  2340. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2341. }
  2342. }
  2343. //------------------------------
  2344. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2345. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2346. {
  2347. foreach (DataRow r in drImageRow)
  2348. {
  2349. PDADefectImageResult defectImage = new PDADefectImageResult();
  2350. if (r["ProductionDefectID"].ToString() != "")
  2351. {
  2352. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2353. }
  2354. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2355. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2356. //{
  2357. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2358. //}
  2359. defect.PDADefectImageResults.Add(defectImage);
  2360. }
  2361. }
  2362. productionData.PDADefects.Add(defect);
  2363. }
  2364. if (productionDatas.PDAProductionData == null)
  2365. {
  2366. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2367. }
  2368. productionDatas.PDAProductionData.Add(productionData);
  2369. //---------------------------------------------------------------------------------
  2370. }
  2371. }
  2372. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2373. actionResult.Status = (int)Constant.PDAResult.Success;
  2374. }
  2375. else
  2376. {
  2377. actionResult.Status = (int)Constant.PDAResult.Fail;
  2378. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2379. }
  2380. }
  2381. catch (Exception ex)
  2382. {
  2383. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2384. OutputLog.TraceLog(LogPriority.Error,
  2385. this.ToString(),
  2386. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2387. ex.ToString(),
  2388. LocalPath.LogExePath);
  2389. actionResult.Status = (int)Constant.PDAResult.Exception;
  2390. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2391. }
  2392. return actionResult;
  2393. }
  2394. /// <summary>
  2395. /// 编辑后删除生产数据
  2396. /// </summary>
  2397. /// <param name="productionDataID">生产数据ID</param>
  2398. /// <returns>int</returns>
  2399. public ActionResult DeleteProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2400. {
  2401. ActionResult actionResult = new ActionResult();
  2402. try
  2403. {
  2404. // 验证请求头信息
  2405. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2406. // 验证失败
  2407. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2408. {
  2409. return actionResult;
  2410. }
  2411. int row = ServiceInvoker.Invoke<int>(this,
  2412. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2413. actionResult.Result = JsonHelper.ToJson(row);
  2414. actionResult.Status = (int)Constant.PDAResult.Success;
  2415. }
  2416. catch (Exception ex)
  2417. {
  2418. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2419. OutputLog.TraceLog(LogPriority.Error,
  2420. this.ToString(),
  2421. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2422. ex.ToString(),
  2423. LocalPath.LogExePath);
  2424. actionResult.Status = (int)Constant.PDAResult.Exception;
  2425. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2426. }
  2427. return actionResult;
  2428. }
  2429. /// <summary>
  2430. /// 获取产品完成工序的ID
  2431. /// </summary>
  2432. /// <param name="barcode">产品条码</param>
  2433. /// <returns>int</returns>
  2434. public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2435. {
  2436. ActionResult actionResult = new ActionResult();
  2437. try
  2438. {
  2439. // 验证请求头信息
  2440. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2441. // 验证失败
  2442. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2443. {
  2444. return actionResult;
  2445. }
  2446. int row = ServiceInvoker.Invoke<int>(this,
  2447. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2448. actionResult.Result = JsonHelper.ToJson(row);
  2449. actionResult.Status = (int)Constant.PDAResult.Success;
  2450. }
  2451. catch (Exception ex)
  2452. {
  2453. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2454. OutputLog.TraceLog(LogPriority.Error,
  2455. this.ToString(),
  2456. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2457. ex.ToString(),
  2458. LocalPath.LogExePath);
  2459. actionResult.Status = (int)Constant.PDAResult.Exception;
  2460. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2461. }
  2462. return actionResult;
  2463. }
  2464. /// <summary>
  2465. /// 绑定图片
  2466. /// </summary>
  2467. /// <param name="accountCode">帐套code</param>
  2468. /// <param name="userCode">用户code</param>
  2469. /// <param name="userPassword">用户密码</param>
  2470. /// <param name="sessionKey">本次登陆密钥</param>
  2471. /// <param name="imagePath">图片路径</param>
  2472. /// <returns></returns>
  2473. public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2474. {
  2475. try
  2476. {
  2477. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2478. }
  2479. catch (Exception ex)
  2480. {
  2481. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2482. OutputLog.TraceLog(LogPriority.Error,
  2483. this.ToString(),
  2484. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2485. ex.ToString(),
  2486. LocalPath.LogExePath);
  2487. return null;
  2488. }
  2489. }
  2490. /// <summary>
  2491. /// 根据所选工号对应的工种,查出缺陷责任员工
  2492. /// </summary>
  2493. /// <param name="jobs">工种ID</param>
  2494. /// <returns></returns>
  2495. public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2496. {
  2497. ActionResult actionResult = new ActionResult();
  2498. try
  2499. {
  2500. // 验证请求头信息
  2501. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2502. // 验证失败
  2503. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2504. {
  2505. return actionResult;
  2506. }
  2507. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2508. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2509. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2510. {
  2511. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2512. actionResult.Status = (int)Constant.PDAResult.Success;
  2513. }
  2514. else
  2515. {
  2516. actionResult.Status = (int)Constant.PDAResult.Fail;
  2517. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2518. }
  2519. }
  2520. catch (Exception ex)
  2521. {
  2522. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2523. OutputLog.TraceLog(LogPriority.Error,
  2524. this.ToString(),
  2525. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2526. ex.ToString(),
  2527. LocalPath.LogExePath);
  2528. actionResult.Status = (int)Constant.PDAResult.Exception;
  2529. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2530. }
  2531. return actionResult;
  2532. }
  2533. #region 产品报废
  2534. /// <summary>
  2535. /// 验证废弃产品唯一性
  2536. /// </summary>
  2537. /// <param name="barcode">产品条码</param>
  2538. /// <returns>int</returns>
  2539. public ActionResult ScrapProductChack(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2540. {
  2541. ActionResult actionResult = new ActionResult();
  2542. try
  2543. {
  2544. // 验证请求头信息
  2545. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2546. // 验证失败
  2547. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2548. {
  2549. return actionResult;
  2550. }
  2551. string row = ServiceInvoker.Invoke<string>(this,
  2552. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2553. string[] rm = row.Split(':');
  2554. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2555. if (rm.Length > 1)
  2556. {
  2557. actionResult.Message = rm[1];
  2558. }
  2559. actionResult.Status = (int)Constant.PDAResult.Success;
  2560. }
  2561. catch (Exception ex)
  2562. {
  2563. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2564. OutputLog.TraceLog(LogPriority.Error,
  2565. this.ToString(),
  2566. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2567. ex.ToString(),
  2568. LocalPath.LogExePath);
  2569. actionResult.Status = (int)Constant.PDAResult.Exception;
  2570. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2571. }
  2572. return actionResult;
  2573. }
  2574. /// <summary>
  2575. /// 根据条码获取该产品的在产信息以及生产数据
  2576. /// </summary>
  2577. /// <param name="Barcode">产品条码</param>
  2578. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2579. public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2580. {
  2581. ActionResult actionResult = new ActionResult();
  2582. try
  2583. {
  2584. // 验证请求头信息
  2585. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2586. // 验证失败
  2587. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2588. {
  2589. return actionResult;
  2590. }
  2591. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2592. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2593. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2594. {
  2595. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2596. actionResult.Status = (int)Constant.PDAResult.Success;
  2597. }
  2598. else
  2599. {
  2600. actionResult.Status = (int)Constant.PDAResult.Fail;
  2601. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2602. }
  2603. }
  2604. catch (Exception ex)
  2605. {
  2606. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2607. OutputLog.TraceLog(LogPriority.Error,
  2608. this.ToString(),
  2609. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2610. ex.ToString(),
  2611. LocalPath.LogExePath);
  2612. actionResult.Status = (int)Constant.PDAResult.Exception;
  2613. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2614. }
  2615. return actionResult;
  2616. }
  2617. /// <summary>
  2618. /// 根据工号查询员工档案信息
  2619. /// </summary>
  2620. /// <param name="accountCode"></param>
  2621. /// <param name="userCode"></param>
  2622. /// <param name="userPassword"></param>
  2623. /// <param name="sessionKey"></param>
  2624. /// <param name="userId"></param>
  2625. /// <returns></returns>
  2626. public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2627. {
  2628. ActionResult actionResult = new ActionResult();
  2629. try
  2630. {
  2631. // 验证请求头信息
  2632. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2633. // 验证失败
  2634. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2635. {
  2636. return actionResult;
  2637. }
  2638. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2639. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2640. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2641. {
  2642. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2643. actionResult.Status = (int)Constant.PDAResult.Success;
  2644. }
  2645. else
  2646. {
  2647. actionResult.Status = (int)Constant.PDAResult.Fail;
  2648. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2649. }
  2650. }
  2651. catch (Exception ex)
  2652. {
  2653. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2654. OutputLog.TraceLog(LogPriority.Error,
  2655. this.ToString(),
  2656. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2657. ex.ToString(),
  2658. LocalPath.LogExePath);
  2659. actionResult.Status = (int)Constant.PDAResult.Exception;
  2660. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2661. }
  2662. return actionResult;
  2663. }
  2664. /// <summary>
  2665. /// 添加废弃产品记录
  2666. /// </summary>
  2667. /// <param name="SProductEntity">废弃产品实体</param>
  2668. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2669. /// <param name="SResponsibleList">责任者集合</param>
  2670. /// <param name="userInfo">用户基本信息</param>
  2671. /// <returns>int结果返回值</returns>
  2672. /// <remarks>
  2673. /// 庄天威 2014.09.24 新建
  2674. /// </remarks>
  2675. public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey,
  2676. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2677. ScrapResponsibleEntity[] SResponsibleList)
  2678. {
  2679. ActionResult actionResult = new ActionResult();
  2680. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2681. {
  2682. actionResult.Status = (int)Constant.PDAResult.Fail;
  2683. actionResult.Message = "没有选择责任人";
  2684. }
  2685. try
  2686. {
  2687. // 验证请求头信息
  2688. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2689. // 验证失败
  2690. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2691. {
  2692. return actionResult;
  2693. }
  2694. int addRow = ServiceInvoker.Invoke<int>(this,
  2695. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  2696. actionResult.Result = JsonHelper.ToJson(addRow);
  2697. actionResult.Status = (int)Constant.PDAResult.Success;
  2698. }
  2699. catch (Exception ex)
  2700. {
  2701. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2702. OutputLog.TraceLog(LogPriority.Error,
  2703. this.ToString(),
  2704. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2705. ex.ToString(),
  2706. LocalPath.LogExePath);
  2707. actionResult.Status = (int)Constant.PDAResult.Exception;
  2708. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2709. // TODO 空指针异常问题检测
  2710. try
  2711. {
  2712. OutputLog.TraceLog(LogPriority.Error,
  2713. this.ToString(),
  2714. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2715. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  2716. LocalPath.LogExePath);
  2717. string json1 = JsonHelper.ToJson(SProductEntity);
  2718. OutputLog.TraceLog(LogPriority.Error,
  2719. this.ToString(),
  2720. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2721. "SProductEntity:" + json1,
  2722. LocalPath.LogExePath);
  2723. string json2 = JsonHelper.ToJson(RProcedureEntity);
  2724. OutputLog.TraceLog(LogPriority.Error,
  2725. this.ToString(),
  2726. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2727. "RProcedureEntity:" + json2,
  2728. LocalPath.LogExePath);
  2729. string json3 = JsonHelper.ToJson(SResponsibleList);
  2730. OutputLog.TraceLog(LogPriority.Error,
  2731. this.ToString(),
  2732. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2733. "SResponsibleList:" + json3,
  2734. LocalPath.LogExePath);
  2735. }
  2736. catch (Exception exc)
  2737. {
  2738. OutputLog.TraceLog(LogPriority.Error,
  2739. this.ToString(),
  2740. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2741. "参数输入异常:" + exc.Message,
  2742. LocalPath.LogExePath);
  2743. }
  2744. }
  2745. return actionResult;
  2746. }
  2747. /// <summary>
  2748. /// 获取产品分级的数据(根据ID)
  2749. /// </summary>
  2750. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  2751. /// <param name="GoodsLevelID">分类ID</param>
  2752. /// <param name="sUserInfo">用户基本信息</param>
  2753. /// <returns>DataSet</returns>
  2754. /// <remarks>
  2755. /// 2014.10.22 庄天威 新建
  2756. public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  2757. {
  2758. ActionResult actionResult = new ActionResult();
  2759. try
  2760. {
  2761. // 验证请求头信息
  2762. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2763. // 验证失败
  2764. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2765. {
  2766. return actionResult;
  2767. }
  2768. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2769. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  2770. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2771. {
  2772. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2773. actionResult.Status = (int)Constant.PDAResult.Success;
  2774. }
  2775. else
  2776. {
  2777. actionResult.Status = (int)Constant.PDAResult.Fail;
  2778. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2779. }
  2780. }
  2781. catch (Exception ex)
  2782. {
  2783. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2784. OutputLog.TraceLog(LogPriority.Error,
  2785. this.ToString(),
  2786. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2787. ex.ToString(),
  2788. LocalPath.LogExePath);
  2789. actionResult.Status = (int)Constant.PDAResult.Exception;
  2790. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2791. }
  2792. return actionResult;
  2793. }
  2794. /// <summary>
  2795. /// 获取账务日期
  2796. /// </summary>
  2797. /// <param name="accountCode"></param>
  2798. /// <param name="userCode"></param>
  2799. /// <param name="userPassword"></param>
  2800. /// <param name="sessionKey"></param>
  2801. /// <returns></returns>
  2802. public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey)
  2803. {
  2804. ActionResult actionResult = new ActionResult();
  2805. try
  2806. {
  2807. // 验证请求头信息
  2808. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2809. // 验证失败
  2810. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2811. {
  2812. return actionResult;
  2813. }
  2814. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  2815. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  2816. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2817. actionResult.Status = (int)Constant.PDAResult.Success;
  2818. }
  2819. catch (Exception ex)
  2820. {
  2821. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2822. OutputLog.TraceLog(LogPriority.Error,
  2823. this.ToString(),
  2824. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2825. ex.ToString(),
  2826. LocalPath.LogExePath);
  2827. actionResult.Status = (int)Constant.PDAResult.Exception;
  2828. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2829. }
  2830. return actionResult;
  2831. }
  2832. /// <summary>
  2833. /// 获取登陆帐户有无报损权限
  2834. /// </summary>
  2835. /// <param name="accountCode"></param>
  2836. /// <param name="userCode"></param>
  2837. /// <param name="userPassword"></param>
  2838. /// <param name="sessionKey"></param>
  2839. /// <param name="usercode">工号编码</param>
  2840. /// <returns></returns>
  2841. public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  2842. {
  2843. ActionResult actionResult = new ActionResult();
  2844. try
  2845. {
  2846. // 验证请求头信息
  2847. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2848. // 验证失败
  2849. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2850. {
  2851. return actionResult;
  2852. }
  2853. int returnValue = ServiceInvoker.Invoke<int>(this,
  2854. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  2855. actionResult.Result = JsonHelper.ToJson(returnValue);
  2856. actionResult.Status = (int)Constant.PDAResult.Success;
  2857. }
  2858. catch (Exception ex)
  2859. {
  2860. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2861. OutputLog.TraceLog(LogPriority.Error,
  2862. this.ToString(),
  2863. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2864. ex.ToString(),
  2865. LocalPath.LogExePath);
  2866. actionResult.Status = (int)Constant.PDAResult.Exception;
  2867. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2868. }
  2869. return actionResult;
  2870. }
  2871. #endregion
  2872. /// <summary>
  2873. /// 获取是否存在报损未审核产品
  2874. /// </summary>
  2875. /// <param name="barcode">产品条码</param>
  2876. /// <returns>int</returns>
  2877. public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2878. {
  2879. ActionResult actionResult = new ActionResult();
  2880. try
  2881. {
  2882. // 验证请求头信息
  2883. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2884. // 验证失败
  2885. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2886. {
  2887. return actionResult;
  2888. }
  2889. int row = ServiceInvoker.Invoke<int>(this,
  2890. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  2891. actionResult.Result = JsonHelper.ToJson(row);
  2892. actionResult.Status = (int)Constant.PDAResult.Success;
  2893. }
  2894. catch (Exception ex)
  2895. {
  2896. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2897. OutputLog.TraceLog(LogPriority.Error,
  2898. this.ToString(),
  2899. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2900. ex.ToString(),
  2901. LocalPath.LogExePath);
  2902. actionResult.Status = (int)Constant.PDAResult.Exception;
  2903. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2904. }
  2905. return actionResult;
  2906. }
  2907. /// <summary>
  2908. /// 查询报废产品信息
  2909. /// </summary>
  2910. /// <param name="accountCode"></param>
  2911. /// <param name="userCode"></param>
  2912. /// <param name="userPassword"></param>
  2913. /// <param name="sessionKey"></param>
  2914. /// <param name="barCode">产品条码</param>
  2915. /// <param name="scrapProductID">报废产品ID</param>
  2916. /// <returns></returns>
  2917. public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  2918. {
  2919. ActionResult actionResult = new ActionResult();
  2920. try
  2921. {
  2922. // 验证请求头信息
  2923. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2924. // 验证失败
  2925. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2926. {
  2927. return actionResult;
  2928. }
  2929. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  2930. selectProEntity.BarCode = barCode;
  2931. selectProEntity.ScrapProductID = scrapProductID;
  2932. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2933. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  2934. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2935. {
  2936. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2937. actionResult.Status = (int)Constant.PDAResult.Success;
  2938. }
  2939. else
  2940. {
  2941. actionResult.Status = (int)Constant.PDAResult.Fail;
  2942. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2943. }
  2944. }
  2945. catch (Exception ex)
  2946. {
  2947. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2948. OutputLog.TraceLog(LogPriority.Error,
  2949. this.ToString(),
  2950. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2951. ex.ToString(),
  2952. LocalPath.LogExePath);
  2953. actionResult.Status = (int)Constant.PDAResult.Exception;
  2954. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2955. }
  2956. return actionResult;
  2957. }
  2958. /// <summary>
  2959. /// 根据废弃产品ID获取责任工序
  2960. /// </summary>
  2961. /// <param name="accountCode"></param>
  2962. /// <param name="userCode"></param>
  2963. /// <param name="userPassword"></param>
  2964. /// <param name="sessionKey"></param>
  2965. /// <param name="scrapProductID">报废产品ID</param>
  2966. /// <returns></returns>
  2967. public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  2968. {
  2969. ActionResult actionResult = new ActionResult();
  2970. try
  2971. {
  2972. // 验证请求头信息
  2973. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2974. // 验证失败
  2975. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2976. {
  2977. return actionResult;
  2978. }
  2979. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2980. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  2981. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2982. {
  2983. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2984. actionResult.Status = (int)Constant.PDAResult.Success;
  2985. }
  2986. else
  2987. {
  2988. actionResult.Status = (int)Constant.PDAResult.Fail;
  2989. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2990. }
  2991. }
  2992. catch (Exception ex)
  2993. {
  2994. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2995. OutputLog.TraceLog(LogPriority.Error,
  2996. this.ToString(),
  2997. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2998. ex.ToString(),
  2999. LocalPath.LogExePath);
  3000. actionResult.Status = (int)Constant.PDAResult.Exception;
  3001. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3002. }
  3003. return actionResult;
  3004. }
  3005. /// <summary>
  3006. /// 根据废弃产品ID获取责任人列表
  3007. /// </summary>
  3008. /// <param name="accountCode"></param>
  3009. /// <param name="userCode"></param>
  3010. /// <param name="userPassword"></param>
  3011. /// <param name="sessionKey"></param>
  3012. /// <param name="scrapProductID">报废产品ID</param>
  3013. /// <returns></returns>
  3014. public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3015. {
  3016. ActionResult actionResult = new ActionResult();
  3017. try
  3018. {
  3019. // 验证请求头信息
  3020. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3021. // 验证失败
  3022. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3023. {
  3024. return actionResult;
  3025. }
  3026. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3027. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  3028. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3029. {
  3030. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3031. actionResult.Status = (int)Constant.PDAResult.Success;
  3032. }
  3033. else
  3034. {
  3035. actionResult.Status = (int)Constant.PDAResult.Fail;
  3036. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3037. }
  3038. }
  3039. catch (Exception ex)
  3040. {
  3041. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3042. OutputLog.TraceLog(LogPriority.Error,
  3043. this.ToString(),
  3044. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3045. ex.ToString(),
  3046. LocalPath.LogExePath);
  3047. actionResult.Status = (int)Constant.PDAResult.Exception;
  3048. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3049. }
  3050. return actionResult;
  3051. }
  3052. /// <summary>
  3053. /// 添加废弃产品记录
  3054. /// </summary>
  3055. /// <param name="SProductEntity">废弃产品实体</param>
  3056. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3057. /// <param name="SResponsibleList">责任者集合</param>
  3058. /// <param name="userInfo">用户基本信息</param>
  3059. /// <returns>int结果返回值</returns>
  3060. /// <remarks>
  3061. /// 庄天威 2014.09.24 新建
  3062. /// </remarks>
  3063. public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3064. ResponProcedureEntity UpdateRProcedureEntity,
  3065. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3066. {
  3067. ActionResult actionResult = new ActionResult();
  3068. try
  3069. {
  3070. // 验证请求头信息
  3071. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3072. // 验证失败
  3073. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3074. {
  3075. return actionResult;
  3076. }
  3077. int addRow = ServiceInvoker.Invoke<int>(this,
  3078. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3079. actionResult.Result = JsonHelper.ToJson(addRow);
  3080. actionResult.Status = (int)Constant.PDAResult.Success;
  3081. }
  3082. catch (Exception ex)
  3083. {
  3084. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3085. OutputLog.TraceLog(LogPriority.Error,
  3086. this.ToString(),
  3087. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3088. ex.ToString(),
  3089. LocalPath.LogExePath);
  3090. actionResult.Status = (int)Constant.PDAResult.Exception;
  3091. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3092. }
  3093. return actionResult;
  3094. }
  3095. /// <summary>
  3096. /// 获取产品窑炉
  3097. /// </summary>
  3098. /// <param name="accountCode"></param>
  3099. /// <param name="userCode"></param>
  3100. /// <param name="userPassword"></param>
  3101. /// <param name="sessionKey"></param>
  3102. /// <returns>Datase</returns>
  3103. public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  3104. {
  3105. ActionResult actionResult = new ActionResult();
  3106. try
  3107. {
  3108. // 验证请求头信息
  3109. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3110. // 验证失败
  3111. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3112. {
  3113. return actionResult;
  3114. }
  3115. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3116. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3117. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3118. {
  3119. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3120. actionResult.Status = (int)Constant.PDAResult.Success;
  3121. }
  3122. else
  3123. {
  3124. actionResult.Status = (int)Constant.PDAResult.Fail;
  3125. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3126. }
  3127. }
  3128. catch (Exception ex)
  3129. {
  3130. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3131. OutputLog.TraceLog(LogPriority.Error,
  3132. this.ToString(),
  3133. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3134. ex.ToString(),
  3135. LocalPath.LogExePath);
  3136. actionResult.Status = (int)Constant.PDAResult.Exception;
  3137. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3138. }
  3139. return actionResult;
  3140. }
  3141. /// <summary>
  3142. /// 获取次品产品条码允许编辑
  3143. /// </summary>
  3144. /// <param name="accountCode"></param>
  3145. /// <param name="userCode"></param>
  3146. /// <param name="userPassword"></param>
  3147. /// <param name="sessionKey"></param>
  3148. /// <param name="barcode">产品条码</param>
  3149. /// <returns>Datase</returns>
  3150. public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3151. {
  3152. ActionResult actionResult = new ActionResult();
  3153. try
  3154. {
  3155. // 验证请求头信息
  3156. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3157. // 验证失败
  3158. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3159. {
  3160. return actionResult;
  3161. }
  3162. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3163. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3164. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3165. {
  3166. actionResult.Result = JsonHelper.ToJson(1);
  3167. actionResult.Status = (int)Constant.PDAResult.Success;
  3168. }
  3169. else
  3170. {
  3171. actionResult.Result = JsonHelper.ToJson(0);
  3172. actionResult.Status = (int)Constant.PDAResult.Fail;
  3173. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3174. }
  3175. }
  3176. catch (Exception ex)
  3177. {
  3178. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3179. OutputLog.TraceLog(LogPriority.Error,
  3180. this.ToString(),
  3181. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3182. ex.ToString(),
  3183. LocalPath.LogExePath);
  3184. actionResult.Status = (int)Constant.PDAResult.Exception;
  3185. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3186. }
  3187. return actionResult;
  3188. }
  3189. /// <summary>
  3190. /// 获取产品条码是否重烧
  3191. /// </summary>
  3192. /// <param name="accountCode"></param>
  3193. /// <param name="userCode"></param>
  3194. /// <param name="userPassword"></param>
  3195. /// <param name="sessionKey"></param>
  3196. /// <param name="barcode">产品条码</param>
  3197. /// <returns>Datase</returns>
  3198. public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3199. {
  3200. ActionResult actionResult = new ActionResult();
  3201. try
  3202. {
  3203. // 验证请求头信息
  3204. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3205. // 验证失败
  3206. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3207. {
  3208. return actionResult;
  3209. }
  3210. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3211. () => PDAModuleLogic.GetReFine(barcode));
  3212. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3213. {
  3214. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3215. }
  3216. else
  3217. {
  3218. actionResult.Result = JsonHelper.ToJson(0);
  3219. }
  3220. actionResult.Status = (int)Constant.PDAResult.Success;
  3221. }
  3222. catch (Exception ex)
  3223. {
  3224. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3225. OutputLog.TraceLog(LogPriority.Error,
  3226. this.ToString(),
  3227. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3228. ex.ToString(),
  3229. LocalPath.LogExePath);
  3230. actionResult.Status = (int)Constant.PDAResult.Exception;
  3231. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3232. }
  3233. return actionResult;
  3234. }
  3235. /// <summary>
  3236. /// 获取登陆帐户有无成检编辑权限
  3237. /// </summary>
  3238. /// <param name="accountCode"></param>
  3239. /// <param name="userCode"></param>
  3240. /// <param name="userPassword"></param>
  3241. /// <param name="sessionKey"></param>
  3242. /// <param name="usercode">工号编码</param>
  3243. /// <returns></returns>
  3244. public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3245. {
  3246. ActionResult actionResult = new ActionResult();
  3247. try
  3248. {
  3249. // 验证请求头信息
  3250. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3251. // 验证失败
  3252. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3253. {
  3254. return actionResult;
  3255. }
  3256. int returnValue = ServiceInvoker.Invoke<int>(this,
  3257. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3258. actionResult.Result = JsonHelper.ToJson(returnValue);
  3259. actionResult.Status = (int)Constant.PDAResult.Success;
  3260. }
  3261. catch (Exception ex)
  3262. {
  3263. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3264. OutputLog.TraceLog(LogPriority.Error,
  3265. this.ToString(),
  3266. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3267. ex.ToString(),
  3268. LocalPath.LogExePath);
  3269. actionResult.Status = (int)Constant.PDAResult.Exception;
  3270. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3271. }
  3272. return actionResult;
  3273. }
  3274. /// <summary>
  3275. /// 根据条码及工序判断是否漏扫
  3276. /// </summary>
  3277. /// <param name="accountCode"></param>
  3278. /// <param name="userCode"></param>
  3279. /// <param name="userPassword"></param>
  3280. /// <param name="sessionKey"></param>
  3281. /// <param name="usercode">工号编码</param>
  3282. /// <param name="barcode">产品条码</param>
  3283. /// <param name="produceid">工序ID</param>
  3284. /// <returns></returns>
  3285. public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3286. {
  3287. ActionResult actionResult = new ActionResult();
  3288. try
  3289. {
  3290. // 验证请求头信息
  3291. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3292. // 验证失败
  3293. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3294. {
  3295. return actionResult;
  3296. }
  3297. int returnValue = 1;
  3298. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3299. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3300. actionResult.Result = JsonHelper.ToJson(returnValue);
  3301. actionResult.Status = (int)Constant.PDAResult.Success;
  3302. }
  3303. catch (Exception ex)
  3304. {
  3305. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3306. OutputLog.TraceLog(LogPriority.Error,
  3307. this.ToString(),
  3308. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3309. ex.ToString(),
  3310. LocalPath.LogExePath);
  3311. actionResult.Status = (int)Constant.PDAResult.Exception;
  3312. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3313. }
  3314. return actionResult;
  3315. }
  3316. /// <summary>
  3317. /// 获取登陆帐户有无报损审批权限
  3318. /// </summary>
  3319. /// <param name="accountCode"></param>
  3320. /// <param name="userCode"></param>
  3321. /// <param name="userPassword"></param>
  3322. /// <param name="sessionKey"></param>
  3323. /// <param name="usercode">工号编码</param>
  3324. /// <returns></returns>
  3325. public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3326. {
  3327. ActionResult actionResult = new ActionResult();
  3328. try
  3329. {
  3330. // 验证请求头信息
  3331. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3332. // 验证失败
  3333. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3334. {
  3335. return actionResult;
  3336. }
  3337. int returnValue = ServiceInvoker.Invoke<int>(this,
  3338. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3339. actionResult.Result = JsonHelper.ToJson(returnValue);
  3340. actionResult.Status = (int)Constant.PDAResult.Success;
  3341. }
  3342. catch (Exception ex)
  3343. {
  3344. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3345. OutputLog.TraceLog(LogPriority.Error,
  3346. this.ToString(),
  3347. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3348. ex.ToString(),
  3349. LocalPath.LogExePath);
  3350. actionResult.Status = (int)Constant.PDAResult.Exception;
  3351. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3352. }
  3353. return actionResult;
  3354. }
  3355. /// <summary>
  3356. /// 获取登陆帐户有无报损审批权限
  3357. /// </summary>
  3358. /// <param name="accountCode"></param>
  3359. /// <param name="userCode"></param>
  3360. /// <param name="userPassword"></param>
  3361. /// <param name="sessionKey"></param>
  3362. /// <param name="usercode">工号编码</param>
  3363. /// <returns></returns>
  3364. public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3365. {
  3366. ActionResult actionResult = new ActionResult();
  3367. try
  3368. {
  3369. // 验证请求头信息
  3370. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3371. // 验证失败
  3372. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3373. {
  3374. return actionResult;
  3375. }
  3376. int returnValue = ServiceInvoker.Invoke<int>(this,
  3377. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3378. actionResult.Result = JsonHelper.ToJson(returnValue);
  3379. actionResult.Status = (int)Constant.PDAResult.Success;
  3380. }
  3381. catch (Exception ex)
  3382. {
  3383. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3384. OutputLog.TraceLog(LogPriority.Error,
  3385. this.ToString(),
  3386. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3387. ex.ToString(),
  3388. LocalPath.LogExePath);
  3389. actionResult.Status = (int)Constant.PDAResult.Exception;
  3390. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3391. }
  3392. return actionResult;
  3393. }
  3394. /// <summary>
  3395. /// 获取窑车对应产品列表
  3396. /// </summary>
  3397. /// <param name="accountCode"></param>
  3398. /// <param name="userCode"></param>
  3399. /// <param name="userPassword"></param>
  3400. /// <param name="sessionKey"></param>
  3401. /// <param name="KilnCarID">窑车ID</param>
  3402. /// <returns>Dataset</returns>
  3403. public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  3404. {
  3405. ActionResult actionResult = new ActionResult();
  3406. try
  3407. {
  3408. // 验证请求头信息
  3409. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3410. // 验证失败
  3411. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3412. {
  3413. return actionResult;
  3414. }
  3415. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3416. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3417. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3418. {
  3419. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3420. actionResult.Status = (int)Constant.PDAResult.Success;
  3421. }
  3422. else
  3423. {
  3424. actionResult.Status = (int)Constant.PDAResult.Fail;
  3425. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3426. }
  3427. }
  3428. catch (Exception ex)
  3429. {
  3430. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3431. OutputLog.TraceLog(LogPriority.Error,
  3432. this.ToString(),
  3433. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3434. ex.ToString(),
  3435. LocalPath.LogExePath);
  3436. actionResult.Status = (int)Constant.PDAResult.Exception;
  3437. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3438. }
  3439. return actionResult;
  3440. }
  3441. /// <summary>
  3442. /// 更换条码
  3443. /// </summary>
  3444. /// <param name="accountCode"></param>
  3445. /// <param name="userCode"></param>
  3446. /// <param name="userPassword"></param>
  3447. /// <param name="sessionKey"></param>
  3448. ///<param name="barcode">原条码</param>
  3449. /// <param name="newBarcode">新条码</param>
  3450. /// <param name="remarks">备注</param>
  3451. /// <returns>操作结果</returns>
  3452. public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  3453. {
  3454. ActionResult actionResult = new ActionResult();
  3455. try
  3456. {
  3457. // 验证请求头信息
  3458. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3459. // 验证失败
  3460. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3461. {
  3462. return actionResult;
  3463. }
  3464. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3465. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3466. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3467. {
  3468. actionResult.Result = 1;
  3469. actionResult.Status = (int)Constant.PDAResult.Success;
  3470. }
  3471. else
  3472. {
  3473. actionResult.Status = (int)Constant.PDAResult.Fail;
  3474. actionResult.Message = serviceResultEntity.Message;
  3475. }
  3476. }
  3477. catch (Exception ex)
  3478. {
  3479. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3480. OutputLog.TraceLog(LogPriority.Error,
  3481. this.ToString(),
  3482. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3483. ex.ToString(),
  3484. LocalPath.LogExePath);
  3485. actionResult.Status = (int)Constant.PDAResult.Exception;
  3486. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3487. }
  3488. return actionResult;
  3489. }
  3490. /// <summary>
  3491. /// 获取(注浆登记)的查询数据
  3492. /// </summary>
  3493. /// <param name="accountCode"></param>
  3494. /// <param name="userCode"></param>
  3495. /// <param name="userPassword"></param>
  3496. /// <param name="sessionKey"></param>
  3497. /// <param name="se">查询条件</param>
  3498. /// <returns>Dataset</returns>
  3499. public ActionResult GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  3500. {
  3501. ActionResult actionResult = new ActionResult();
  3502. try
  3503. {
  3504. // 验证请求头信息
  3505. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3506. // 验证失败
  3507. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3508. {
  3509. return actionResult;
  3510. }
  3511. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3512. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3513. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3514. {
  3515. // PDA不显示的列删除掉
  3516. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3517. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3518. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3519. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3520. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3521. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3522. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3523. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3524. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3525. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3526. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3527. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3528. actionResult.Status = (int)Constant.PDAResult.Success;
  3529. }
  3530. else
  3531. {
  3532. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3533. actionResult.Message = "无查询数据";
  3534. }
  3535. }
  3536. catch (Exception ex)
  3537. {
  3538. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3539. OutputLog.TraceLog(LogPriority.Error,
  3540. this.ToString(),
  3541. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3542. ex.ToString(),
  3543. LocalPath.LogExePath);
  3544. actionResult.Status = (int)Constant.PDAResult.Exception;
  3545. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3546. }
  3547. return actionResult;
  3548. }
  3549. /// <summary>
  3550. /// 获取(注浆登记)的查询数据
  3551. /// </summary>
  3552. /// <param name="accountCode"></param>
  3553. /// <param name="userCode"></param>
  3554. /// <param name="userPassword"></param>
  3555. /// <param name="sessionKey"></param>
  3556. /// <param name="se">查询条件</param>
  3557. /// <returns>Dataset</returns>
  3558. public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3559. {
  3560. ActionResult actionResult = new ActionResult();
  3561. try
  3562. {
  3563. // 验证请求头信息
  3564. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3565. // 验证失败
  3566. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3567. {
  3568. return actionResult;
  3569. }
  3570. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3571. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3572. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3573. {
  3574. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3575. actionResult.Status = (int)Constant.PDAResult.Success;
  3576. }
  3577. else
  3578. {
  3579. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3580. actionResult.Message = "无查询数据";
  3581. }
  3582. }
  3583. catch (Exception ex)
  3584. {
  3585. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3586. OutputLog.TraceLog(LogPriority.Error,
  3587. this.ToString(),
  3588. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3589. ex.ToString(),
  3590. LocalPath.LogExePath);
  3591. actionResult.Status = (int)Constant.PDAResult.Exception;
  3592. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3593. }
  3594. return actionResult;
  3595. }
  3596. /// <summary>
  3597. ///获得成型线信息
  3598. /// </summary>
  3599. /// <param name="accountCode"></param>
  3600. /// <param name="userCode"></param>
  3601. /// <param name="userPassword"></param>
  3602. /// <param name="sessionKey"></param>
  3603. /// <param name="se">查询条件</param>
  3604. /// <returns>Dataset</returns>
  3605. public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3606. {
  3607. ActionResult actionResult = new ActionResult();
  3608. try
  3609. {
  3610. // 验证请求头信息
  3611. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3612. // 验证失败
  3613. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3614. {
  3615. return actionResult;
  3616. }
  3617. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3618. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3619. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3620. {
  3621. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3622. actionResult.Status = (int)Constant.PDAResult.Success;
  3623. }
  3624. else
  3625. {
  3626. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3627. actionResult.Message = "无查询数据";
  3628. }
  3629. }
  3630. catch (Exception ex)
  3631. {
  3632. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3633. OutputLog.TraceLog(LogPriority.Error,
  3634. this.ToString(),
  3635. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3636. ex.ToString(),
  3637. LocalPath.LogExePath);
  3638. actionResult.Status = (int)Constant.PDAResult.Exception;
  3639. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3640. }
  3641. return actionResult;
  3642. }
  3643. /// <summary>
  3644. ///获取在产产品的信息标识列表
  3645. /// </summary>
  3646. /// <param name="accountCode"></param>
  3647. /// <param name="userCode"></param>
  3648. /// <param name="userPassword"></param>
  3649. /// <param name="sessionKey"></param>
  3650. /// <param name="barcode">查询条件</param>
  3651. /// <returns>Dataset</returns>
  3652. public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3653. {
  3654. ActionResult actionResult = new ActionResult();
  3655. try
  3656. {
  3657. // 验证请求头信息
  3658. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3659. // 验证失败
  3660. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3661. {
  3662. return actionResult;
  3663. }
  3664. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3665. () => PMModuleLogic.GetInProductionDataList(barcode));
  3666. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3667. {
  3668. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3669. actionResult.Status = (int)Constant.PDAResult.Success;
  3670. }
  3671. else
  3672. {
  3673. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3674. actionResult.Message = "无查询数据";
  3675. }
  3676. }
  3677. catch (Exception ex)
  3678. {
  3679. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3680. OutputLog.TraceLog(LogPriority.Error,
  3681. this.ToString(),
  3682. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3683. ex.ToString(),
  3684. LocalPath.LogExePath);
  3685. actionResult.Status = (int)Constant.PDAResult.Exception;
  3686. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3687. }
  3688. return actionResult;
  3689. }
  3690. /// <summary>
  3691. ///获取条码是否注浆登记过,0行无效
  3692. /// </summary>
  3693. /// <param name="accountCode"></param>
  3694. /// <param name="userCode"></param>
  3695. /// <param name="userPassword"></param>
  3696. /// <param name="sessionKey"></param>
  3697. /// <param name="barcode">查询条件</param>
  3698. /// <returns>Dataset</returns>
  3699. public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3700. {
  3701. ActionResult actionResult = new ActionResult();
  3702. try
  3703. {
  3704. // 验证请求头信息
  3705. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3706. // 验证失败
  3707. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3708. {
  3709. return actionResult;
  3710. }
  3711. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3712. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  3713. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3714. {
  3715. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3716. actionResult.Status = (int)Constant.PDAResult.Success;
  3717. }
  3718. else
  3719. {
  3720. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3721. actionResult.Message = "该产品条码无效,无法报损!";
  3722. }
  3723. }
  3724. catch (Exception ex)
  3725. {
  3726. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3727. OutputLog.TraceLog(LogPriority.Error,
  3728. this.ToString(),
  3729. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3730. ex.ToString(),
  3731. LocalPath.LogExePath);
  3732. actionResult.Status = (int)Constant.PDAResult.Exception;
  3733. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3734. }
  3735. return actionResult;
  3736. }
  3737. /// <summary>
  3738. /// 获取登陆帐户有变更条码权限
  3739. /// </summary>
  3740. /// <param name="accountCode"></param>
  3741. /// <param name="userCode"></param>
  3742. /// <param name="userPassword"></param>
  3743. /// <param name="sessionKey"></param>
  3744. /// <returns></returns>
  3745. public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3746. {
  3747. ActionResult actionResult = new ActionResult();
  3748. try
  3749. {
  3750. // 验证请求头信息
  3751. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3752. // 验证失败
  3753. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3754. {
  3755. return actionResult;
  3756. }
  3757. int returnValue = ServiceInvoker.Invoke<int>(this,
  3758. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  3759. actionResult.Result = JsonHelper.ToJson(returnValue);
  3760. actionResult.Status = (int)Constant.PDAResult.Success;
  3761. }
  3762. catch (Exception ex)
  3763. {
  3764. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3765. OutputLog.TraceLog(LogPriority.Error,
  3766. this.ToString(),
  3767. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3768. ex.ToString(),
  3769. LocalPath.LogExePath);
  3770. actionResult.Status = (int)Constant.PDAResult.Exception;
  3771. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3772. }
  3773. return actionResult;
  3774. }
  3775. /// <summary>
  3776. /// 成检时获取此条码是否报损
  3777. /// </summary>
  3778. /// <param name="accountCode"></param>
  3779. /// <param name="userCode"></param>
  3780. /// <param name="userPassword"></param>
  3781. /// <param name="sessionKey"></param>
  3782. /// <param name="barcode">产品条码</param>
  3783. /// <returns></returns>
  3784. public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3785. {
  3786. ActionResult actionResult = new ActionResult();
  3787. try
  3788. {
  3789. // 验证请求头信息
  3790. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3791. // 验证失败
  3792. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3793. {
  3794. return actionResult;
  3795. }
  3796. int returnValue = ServiceInvoker.Invoke<int>(this,
  3797. () => PMModuleLogic.CheckScrapProduct(barcode));
  3798. if (returnValue == -100)
  3799. {
  3800. actionResult.Result = JsonHelper.ToJson(returnValue);
  3801. actionResult.Status = (int)Constant.PDAResult.Success;
  3802. }
  3803. else
  3804. {
  3805. actionResult.Status = (int)Constant.PDAResult.Fail;
  3806. if (returnValue == 0)
  3807. {
  3808. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  3809. }
  3810. else
  3811. {
  3812. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  3813. }
  3814. }
  3815. }
  3816. catch (Exception ex)
  3817. {
  3818. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3819. OutputLog.TraceLog(LogPriority.Error,
  3820. this.ToString(),
  3821. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3822. ex.ToString(),
  3823. LocalPath.LogExePath);
  3824. actionResult.Status = (int)Constant.PDAResult.Exception;
  3825. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3826. }
  3827. return actionResult;
  3828. }
  3829. /// <summary>
  3830. /// 获取产品完成工序的ID(PDA)
  3831. /// </summary>
  3832. /// <param name="barcode">产品条码</param>
  3833. /// <returns>int</returns>
  3834. public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3835. {
  3836. ActionResult actionResult = new ActionResult();
  3837. try
  3838. {
  3839. // 验证请求头信息
  3840. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3841. // 验证失败
  3842. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3843. {
  3844. return actionResult;
  3845. }
  3846. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3847. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  3848. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3849. actionResult.Status = (int)Constant.PDAResult.Success;
  3850. }
  3851. catch (Exception ex)
  3852. {
  3853. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3854. OutputLog.TraceLog(LogPriority.Error,
  3855. this.ToString(),
  3856. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3857. ex.ToString(),
  3858. LocalPath.LogExePath);
  3859. actionResult.Status = (int)Constant.PDAResult.Exception;
  3860. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3861. }
  3862. return actionResult;
  3863. }
  3864. /// <summary>
  3865. /// 获取产品完成工序的ID(PDA)
  3866. /// </summary>
  3867. /// <param name="barcode">产品条码</param>
  3868. /// <returns>int</returns>
  3869. public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3870. {
  3871. ActionResult actionResult = new ActionResult();
  3872. try
  3873. {
  3874. // 验证请求头信息
  3875. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3876. // 验证失败
  3877. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3878. {
  3879. return actionResult;
  3880. }
  3881. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3882. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  3883. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3884. actionResult.Status = (int)Constant.PDAResult.Success;
  3885. }
  3886. catch (Exception ex)
  3887. {
  3888. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3889. OutputLog.TraceLog(LogPriority.Error,
  3890. this.ToString(),
  3891. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3892. ex.ToString(),
  3893. LocalPath.LogExePath);
  3894. actionResult.Status = (int)Constant.PDAResult.Exception;
  3895. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3896. }
  3897. return actionResult;
  3898. }
  3899. /// <summary>
  3900. /// 成检-校验生产工号
  3901. /// </summary>
  3902. /// <param name="usercode">生产工号</param>
  3903. /// <returns>int</returns>
  3904. public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode)
  3905. {
  3906. ActionResult actionResult = new ActionResult();
  3907. try
  3908. {
  3909. // 验证请求头信息
  3910. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3911. // 验证失败
  3912. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3913. {
  3914. return actionResult;
  3915. }
  3916. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3917. () => PDAModuleLogic.GetUserCode(usercode, sUserInfo));
  3918. actionResult.Result = JsonHelper.ToJson(ds);
  3919. actionResult.Status = (int)Constant.PDAResult.Success;
  3920. }
  3921. catch (Exception ex)
  3922. {
  3923. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3924. OutputLog.TraceLog(LogPriority.Error,
  3925. this.ToString(),
  3926. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3927. ex.ToString(),
  3928. LocalPath.LogExePath);
  3929. actionResult.Status = (int)Constant.PDAResult.Exception;
  3930. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3931. }
  3932. return actionResult;
  3933. }
  3934. /// <summary>
  3935. /// 更新漏扫的成型工号
  3936. /// </summary>
  3937. /// <param name="accountCode"></param>
  3938. /// <param name="userCode"></param>
  3939. /// <param name="userPassword"></param>
  3940. /// <param name="sessionKey"></param>
  3941. /// <param name="groutingUserCode">成型工号</param>
  3942. /// <param name="missingID">漏扫ID</param>
  3943. /// <returns></returns>
  3944. public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  3945. {
  3946. ActionResult actionResult = new ActionResult();
  3947. try
  3948. {
  3949. // 验证请求头信息
  3950. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3951. // 验证失败
  3952. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3953. {
  3954. return actionResult;
  3955. }
  3956. int returnValue = ServiceInvoker.Invoke<int>(this,
  3957. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  3958. if (returnValue != -1)
  3959. {
  3960. actionResult.Result = JsonHelper.ToJson(returnValue);
  3961. actionResult.Status = (int)Constant.PDAResult.Success;
  3962. }
  3963. else
  3964. {
  3965. actionResult.Status = (int)Constant.PDAResult.Fail;
  3966. actionResult.Message = "存在无效的漏扫工号";
  3967. }
  3968. }
  3969. catch (Exception ex)
  3970. {
  3971. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3972. OutputLog.TraceLog(LogPriority.Error,
  3973. this.ToString(),
  3974. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3975. ex.ToString(),
  3976. LocalPath.LogExePath);
  3977. actionResult.Status = (int)Constant.PDAResult.Exception;
  3978. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3979. }
  3980. return actionResult;
  3981. }
  3982. /// <summary>
  3983. /// 在入窑工序检验窑车号是否存在
  3984. /// </summary>
  3985. /// <param name="accountCode"></param>
  3986. /// <param name="userCode"></param>
  3987. /// <param name="userPassword"></param>
  3988. /// <param name="sessionKey"></param>
  3989. /// <param name="kilncarcode">窑车编码</param>
  3990. /// <param name="procedureid">工序ID</param>
  3991. /// <returns></returns>
  3992. public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  3993. {
  3994. ActionResult actionResult = new ActionResult();
  3995. try
  3996. {
  3997. // 验证请求头信息
  3998. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3999. // 验证失败
  4000. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4001. {
  4002. return actionResult;
  4003. }
  4004. int returnValue = ServiceInvoker.Invoke<int>(this,
  4005. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  4006. if (returnValue == 1)
  4007. {
  4008. actionResult.Result = JsonHelper.ToJson(returnValue);
  4009. actionResult.Status = (int)Constant.PDAResult.Success;
  4010. }
  4011. else
  4012. {
  4013. actionResult.Status = (int)Constant.PDAResult.Fail;
  4014. if (returnValue == -99)
  4015. actionResult.Message = "窑炉车号无效";
  4016. else if (returnValue == -98)
  4017. actionResult.Message = "窑车己无产品";
  4018. else if (returnValue == -97)
  4019. actionResult.Message = "窑车没有入窑,不可以撤销";
  4020. else if (returnValue == -1)
  4021. actionResult.Message = "保存失败";
  4022. }
  4023. }
  4024. catch (Exception ex)
  4025. {
  4026. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4027. OutputLog.TraceLog(LogPriority.Error,
  4028. this.ToString(),
  4029. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4030. ex.ToString(),
  4031. LocalPath.LogExePath);
  4032. actionResult.Status = (int)Constant.PDAResult.Exception;
  4033. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4034. }
  4035. return actionResult;
  4036. }
  4037. /// <summary>
  4038. /// 获取盘点单列表
  4039. /// </summary>
  4040. /// <param name="sUserInfo"></param>
  4041. /// <returns></returns>
  4042. public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey)
  4043. {
  4044. ActionResult actionResult = new ActionResult();
  4045. try
  4046. {
  4047. // 验证请求头信息
  4048. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4049. // 验证失败
  4050. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4051. {
  4052. return actionResult;
  4053. }
  4054. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4055. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  4056. actionResult.Result = JsonHelper.ToJson(ds);
  4057. actionResult.Status = (int)Constant.PDAResult.Success;
  4058. }
  4059. catch (Exception ex)
  4060. {
  4061. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4062. OutputLog.TraceLog(LogPriority.Error,
  4063. this.ToString(),
  4064. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4065. ex.ToString(),
  4066. LocalPath.LogExePath);
  4067. actionResult.Status = (int)Constant.PDAResult.Exception;
  4068. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4069. }
  4070. return actionResult;
  4071. }
  4072. /// <summary>
  4073. /// 进行盘点操作
  4074. /// </summary>
  4075. /// <param name="accountCode"></param>
  4076. /// <param name="userCode"></param>
  4077. /// <param name="userPassword"></param>
  4078. /// <param name="sessionKey"></param>
  4079. /// <param name="InCheckedID">盘点单ID</param>
  4080. /// <param name="BarCode">产品条码</param>
  4081. /// <returns></returns>
  4082. public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4083. {
  4084. ActionResult actionResult = new ActionResult();
  4085. try
  4086. {
  4087. // 验证请求头信息
  4088. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4089. // 验证失败
  4090. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4091. {
  4092. return actionResult;
  4093. }
  4094. int returnValue = ServiceInvoker.Invoke<int>(this,
  4095. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4096. if (returnValue > 0)
  4097. {
  4098. actionResult.Result = JsonHelper.ToJson(returnValue);
  4099. actionResult.Status = (int)Constant.PDAResult.Success;
  4100. actionResult.Message = "产品" + BarCode + "盘点成功";
  4101. }
  4102. else if (returnValue == 10)
  4103. {
  4104. actionResult.Result = JsonHelper.ToJson(returnValue);
  4105. actionResult.Status = (int)Constant.PDAResult.Success;
  4106. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4107. }
  4108. else
  4109. {
  4110. actionResult.Status = (int)Constant.PDAResult.Fail;
  4111. if (returnValue == -2)
  4112. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4113. //if (returnValue == 10)
  4114. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4115. //if (returnValue > 0)
  4116. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4117. if (returnValue == -22)
  4118. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4119. if (returnValue == -23)
  4120. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4121. if (returnValue == -24)
  4122. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4123. if (returnValue == -25)
  4124. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4125. else if (returnValue == 0)
  4126. actionResult.Message = "盘点失败";
  4127. }
  4128. }
  4129. catch (Exception ex)
  4130. {
  4131. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4132. OutputLog.TraceLog(LogPriority.Error,
  4133. this.ToString(),
  4134. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4135. ex.ToString(),
  4136. LocalPath.LogExePath);
  4137. actionResult.Status = (int)Constant.PDAResult.Exception;
  4138. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4139. }
  4140. return actionResult;
  4141. }
  4142. #region 班次配置
  4143. /// <summary>
  4144. /// 班次配置-通过工号获取工种列表
  4145. /// </summary>
  4146. /// <param name="userId">工号ID</param>
  4147. /// <returns></returns>
  4148. public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4149. {
  4150. ActionResult actionResult = new ActionResult();
  4151. try
  4152. {
  4153. // 验证请求头信息
  4154. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4155. // 验证失败
  4156. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4157. {
  4158. return actionResult;
  4159. }
  4160. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4161. () => SystemModuleLogic.GetJobByUserId(userId));
  4162. actionResult.Result = JsonHelper.ToJson(ds);
  4163. actionResult.Status = (int)Constant.PDAResult.Success;
  4164. }
  4165. catch (Exception ex)
  4166. {
  4167. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4168. OutputLog.TraceLog(LogPriority.Error,
  4169. this.ToString(),
  4170. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4171. ex.ToString(),
  4172. LocalPath.LogExePath);
  4173. actionResult.Status = (int)Constant.PDAResult.Exception;
  4174. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4175. }
  4176. return actionResult;
  4177. }
  4178. ///// <summary>
  4179. ///// 班次配置-根据工号查询员工档案信息
  4180. ///// </summary>
  4181. ///// <param name="userId">工号ID</param>
  4182. ///// <returns></returns>
  4183. //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4184. //{
  4185. // ActionResult actionResult = new ActionResult();
  4186. // try
  4187. // {
  4188. // // 验证请求头信息
  4189. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4190. // // 验证失败
  4191. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4192. // {
  4193. // return actionResult;
  4194. // }
  4195. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4196. // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
  4197. // actionResult.Result = JsonHelper.ToJson(ds);
  4198. // actionResult.Status = (int)Constant.PDAResult.Success;
  4199. // }
  4200. // catch (Exception ex)
  4201. // {
  4202. // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4203. // OutputLog.TraceLog(LogPriority.Error,
  4204. // this.ToString(),
  4205. // System.Reflection.MethodBase.GetCurrentMethod().Name,
  4206. // ex.ToString(),
  4207. // LocalPath.LogExePath);
  4208. // actionResult.Status = (int)Constant.PDAResult.Exception;
  4209. // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4210. // }
  4211. // return actionResult;
  4212. //}
  4213. /// <summary>
  4214. /// 班次配置-根据员工姓名查员工信息
  4215. /// </summary>
  4216. /// <param name="searchStaffEntity"></param>
  4217. /// <returns></returns>
  4218. public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4219. {
  4220. ActionResult actionResult = new ActionResult();
  4221. try
  4222. {
  4223. // 验证请求头信息
  4224. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4225. // 验证失败
  4226. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4227. {
  4228. return actionResult;
  4229. }
  4230. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4231. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4232. actionResult.Result = JsonHelper.ToJson(ds);
  4233. actionResult.Status = (int)Constant.PDAResult.Success;
  4234. }
  4235. catch (Exception ex)
  4236. {
  4237. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4238. OutputLog.TraceLog(LogPriority.Error,
  4239. this.ToString(),
  4240. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4241. ex.ToString(),
  4242. LocalPath.LogExePath);
  4243. actionResult.Status = (int)Constant.PDAResult.Exception;
  4244. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4245. }
  4246. return actionResult;
  4247. }
  4248. /// <summary>
  4249. /// 获取班次配置信息
  4250. /// </summary>
  4251. /// <param name="searchEntity"></param>
  4252. /// <returns></returns>
  4253. public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  4254. {
  4255. ActionResult actionResult = new ActionResult();
  4256. try
  4257. {
  4258. // 验证请求头信息
  4259. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4260. // 验证失败
  4261. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4262. {
  4263. return actionResult;
  4264. }
  4265. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4266. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4267. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4268. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4269. actionResult.Result = JsonHelper.ToJson(ds);
  4270. actionResult.Status = (int)Constant.PDAResult.Success;
  4271. }
  4272. catch (Exception ex)
  4273. {
  4274. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4275. OutputLog.TraceLog(LogPriority.Error,
  4276. this.ToString(),
  4277. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4278. ex.ToString(),
  4279. LocalPath.LogExePath);
  4280. actionResult.Status = (int)Constant.PDAResult.Exception;
  4281. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4282. }
  4283. return actionResult;
  4284. }
  4285. public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4286. {
  4287. ActionResult actionResult = new ActionResult();
  4288. try
  4289. {
  4290. // 验证请求头信息
  4291. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4292. // 验证失败
  4293. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4294. {
  4295. return actionResult;
  4296. }
  4297. int returnValue = ServiceInvoker.Invoke<int>(this,
  4298. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4299. if (returnValue > 0)
  4300. {
  4301. actionResult.Result = JsonHelper.ToJson(returnValue);
  4302. actionResult.Status = (int)Constant.PDAResult.Success;
  4303. }
  4304. else
  4305. {
  4306. actionResult.Status = (int)Constant.PDAResult.Fail;
  4307. actionResult.Message = "保存失败";
  4308. }
  4309. }
  4310. catch (Exception ex)
  4311. {
  4312. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4313. OutputLog.TraceLog(LogPriority.Error,
  4314. this.ToString(),
  4315. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4316. ex.ToString(),
  4317. LocalPath.LogExePath);
  4318. actionResult.Status = (int)Constant.PDAResult.Exception;
  4319. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4320. }
  4321. return actionResult;
  4322. }
  4323. /// <summary>
  4324. /// 班次配置--获取详细信息
  4325. /// </summary>
  4326. /// <param name="searchEntity"></param>
  4327. /// <returns></returns>
  4328. public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4329. {
  4330. ActionResult actionResult = new ActionResult();
  4331. try
  4332. {
  4333. // 验证请求头信息
  4334. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4335. // 验证失败
  4336. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4337. {
  4338. return actionResult;
  4339. }
  4340. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4341. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4342. actionResult.Result = JsonHelper.ToJson(ds);
  4343. actionResult.Status = (int)Constant.PDAResult.Success;
  4344. }
  4345. catch (Exception ex)
  4346. {
  4347. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4348. OutputLog.TraceLog(LogPriority.Error,
  4349. this.ToString(),
  4350. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4351. ex.ToString(),
  4352. LocalPath.LogExePath);
  4353. actionResult.Status = (int)Constant.PDAResult.Exception;
  4354. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4355. }
  4356. return actionResult;
  4357. }
  4358. /// <summary>
  4359. /// 获取用户是否有班次配置权限
  4360. /// </summary>
  4361. /// <param name="accountCode"></param>
  4362. /// <param name="userCode"></param>
  4363. /// <param name="userPassword"></param>
  4364. /// <param name="sessionKey"></param>
  4365. /// <returns></returns>
  4366. public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4367. {
  4368. ActionResult actionResult = new ActionResult();
  4369. try
  4370. {
  4371. // 验证请求头信息
  4372. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4373. // 验证失败
  4374. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4375. {
  4376. return actionResult;
  4377. }
  4378. int returnValue = ServiceInvoker.Invoke<int>(this,
  4379. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4380. actionResult.Result = JsonHelper.ToJson(returnValue);
  4381. actionResult.Status = (int)Constant.PDAResult.Success;
  4382. }
  4383. catch (Exception ex)
  4384. {
  4385. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4386. OutputLog.TraceLog(LogPriority.Error,
  4387. this.ToString(),
  4388. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4389. ex.ToString(),
  4390. LocalPath.LogExePath);
  4391. actionResult.Status = (int)Constant.PDAResult.Exception;
  4392. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4393. }
  4394. return actionResult;
  4395. }
  4396. /// <summary>
  4397. /// 获取盘点单列表
  4398. /// </summary>
  4399. /// <param name="sUserInfo"></param>
  4400. /// <returns></returns>
  4401. public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  4402. {
  4403. ActionResult actionResult = new ActionResult();
  4404. try
  4405. {
  4406. // 验证请求头信息
  4407. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4408. // 验证失败
  4409. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4410. {
  4411. return actionResult;
  4412. }
  4413. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4414. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4415. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4416. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4417. actionResult.Result = JsonHelper.ToJson(ds);
  4418. actionResult.Status = (int)Constant.PDAResult.Success;
  4419. }
  4420. catch (Exception ex)
  4421. {
  4422. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4423. OutputLog.TraceLog(LogPriority.Error,
  4424. this.ToString(),
  4425. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4426. ex.ToString(),
  4427. LocalPath.LogExePath);
  4428. actionResult.Status = (int)Constant.PDAResult.Exception;
  4429. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4430. }
  4431. return actionResult;
  4432. }
  4433. #endregion
  4434. #region PDA报表
  4435. /// <summary>
  4436. /// 产品质量跟踪
  4437. /// </summary>
  4438. /// <param name="accountCode"></param>
  4439. /// <param name="userCode"></param>
  4440. /// <param name="userPassword"></param>
  4441. /// <param name="sessionKey"></param>
  4442. /// <param name="se"></param>
  4443. /// <returns></returns>
  4444. public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4445. {
  4446. ActionResult actionResult = new ActionResult();
  4447. try
  4448. {
  4449. // 验证请求头信息
  4450. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4451. // 验证失败
  4452. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4453. {
  4454. return actionResult;
  4455. }
  4456. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4457. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4458. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4459. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4460. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4461. {
  4462. actionResult.Status = (int)Constant.PDAResult.Fail;
  4463. actionResult.Message = Messages.MSG_CMN_I002;
  4464. }
  4465. else
  4466. {
  4467. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4468. actionResult.Status = (int)Constant.PDAResult.Success;
  4469. }
  4470. }
  4471. catch (Exception ex)
  4472. {
  4473. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4474. OutputLog.TraceLog(LogPriority.Error,
  4475. this.ToString(),
  4476. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4477. ex.ToString(),
  4478. LocalPath.LogExePath);
  4479. actionResult.Status = (int)Constant.PDAResult.Exception;
  4480. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4481. }
  4482. return actionResult;
  4483. }
  4484. /// <summary>
  4485. /// 工号产量质量分析表
  4486. /// </summary>
  4487. /// <param name="accountCode"></param>
  4488. /// <param name="userCode"></param>
  4489. /// <param name="userPassword"></param>
  4490. /// <param name="sessionKey"></param>
  4491. /// <param name="se"></param>
  4492. /// <returns></returns>
  4493. public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4494. int rptSProcedureID, string workcode, string date)
  4495. {
  4496. ActionResult actionResult = new ActionResult();
  4497. try
  4498. {
  4499. // 验证请求头信息
  4500. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4501. // 验证失败
  4502. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4503. {
  4504. return actionResult;
  4505. }
  4506. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4507. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4508. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4509. {
  4510. actionResult.Status = (int)Constant.PDAResult.Fail;
  4511. actionResult.Message = Messages.MSG_CMN_I002;
  4512. }
  4513. else
  4514. {
  4515. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4516. actionResult.Status = (int)Constant.PDAResult.Success;
  4517. }
  4518. }
  4519. catch (Exception ex)
  4520. {
  4521. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4522. OutputLog.TraceLog(LogPriority.Error,
  4523. this.ToString(),
  4524. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4525. ex.ToString(),
  4526. LocalPath.LogExePath);
  4527. actionResult.Status = (int)Constant.PDAResult.Exception;
  4528. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4529. }
  4530. return actionResult;
  4531. }
  4532. /// <summary>
  4533. /// 半检数据统计表
  4534. /// </summary>
  4535. /// <param name="accountCode"></param>
  4536. /// <param name="userCode"></param>
  4537. /// <param name="userPassword"></param>
  4538. /// <param name="sessionKey"></param>
  4539. /// <param name="se"></param>
  4540. /// <returns></returns>
  4541. public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4542. string workcode, string datebegin, string dateend)
  4543. {
  4544. ActionResult actionResult = new ActionResult();
  4545. try
  4546. {
  4547. // 验证请求头信息
  4548. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4549. // 验证失败
  4550. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4551. {
  4552. return actionResult;
  4553. }
  4554. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4555. DateTime datetimeend = Convert.ToDateTime(dateend);
  4556. datetimebegin = datetimebegin.Date;
  4557. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4558. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4559. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4560. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4561. {
  4562. actionResult.Status = (int)Constant.PDAResult.Fail;
  4563. actionResult.Message = Messages.MSG_CMN_I002;
  4564. }
  4565. else
  4566. {
  4567. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4568. actionResult.Status = (int)Constant.PDAResult.Success;
  4569. }
  4570. }
  4571. catch (Exception ex)
  4572. {
  4573. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4574. OutputLog.TraceLog(LogPriority.Error,
  4575. this.ToString(),
  4576. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4577. ex.ToString(),
  4578. LocalPath.LogExePath);
  4579. actionResult.Status = (int)Constant.PDAResult.Exception;
  4580. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4581. }
  4582. return actionResult;
  4583. }
  4584. /// <summary>
  4585. /// 工号质量统计表
  4586. /// </summary>
  4587. /// <param name="accountCode"></param>
  4588. /// <param name="userCode"></param>
  4589. /// <param name="userPassword"></param>
  4590. /// <param name="sessionKey"></param>
  4591. /// <param name="se"></param>
  4592. /// <returns></returns>
  4593. public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4594. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4595. {
  4596. ActionResult actionResult = new ActionResult();
  4597. try
  4598. {
  4599. // 验证请求头信息
  4600. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4601. // 验证失败
  4602. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4603. {
  4604. return actionResult;
  4605. }
  4606. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4607. DateTime datetimeend = Convert.ToDateTime(dateend);
  4608. datetimebegin = datetimebegin.Date;
  4609. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4610. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4611. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4612. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4613. {
  4614. actionResult.Status = (int)Constant.PDAResult.Fail;
  4615. actionResult.Message = Messages.MSG_CMN_I002;
  4616. }
  4617. else
  4618. {
  4619. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4620. actionResult.Status = (int)Constant.PDAResult.Success;
  4621. }
  4622. }
  4623. catch (Exception ex)
  4624. {
  4625. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4626. OutputLog.TraceLog(LogPriority.Error,
  4627. this.ToString(),
  4628. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4629. ex.ToString(),
  4630. LocalPath.LogExePath);
  4631. actionResult.Status = (int)Constant.PDAResult.Exception;
  4632. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4633. }
  4634. return actionResult;
  4635. }
  4636. /// <summary>
  4637. /// 损坯数据统计表
  4638. /// </summary>
  4639. /// <param name="accountCode"></param>
  4640. /// <param name="userCode"></param>
  4641. /// <param name="userPassword"></param>
  4642. /// <param name="sessionKey"></param>
  4643. /// <param name="se"></param>
  4644. /// <returns></returns>
  4645. public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4646. string workcode, string datebegin, string dateend)
  4647. {
  4648. ActionResult actionResult = new ActionResult();
  4649. try
  4650. {
  4651. // 验证请求头信息
  4652. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4653. // 验证失败
  4654. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4655. {
  4656. return actionResult;
  4657. }
  4658. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4659. DateTime datetimeend = Convert.ToDateTime(dateend);
  4660. datetimebegin = datetimebegin.Date;
  4661. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4662. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4663. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4664. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4665. {
  4666. actionResult.Status = (int)Constant.PDAResult.Fail;
  4667. actionResult.Message = Messages.MSG_CMN_I002;
  4668. }
  4669. else
  4670. {
  4671. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4672. actionResult.Status = (int)Constant.PDAResult.Success;
  4673. }
  4674. }
  4675. catch (Exception ex)
  4676. {
  4677. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4678. OutputLog.TraceLog(LogPriority.Error,
  4679. this.ToString(),
  4680. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4681. ex.ToString(),
  4682. LocalPath.LogExePath);
  4683. actionResult.Status = (int)Constant.PDAResult.Exception;
  4684. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4685. }
  4686. return actionResult;
  4687. }
  4688. #endregion
  4689. /// <summary>
  4690. /// 取得报表数据源数据
  4691. /// </summary>
  4692. /// <param name="accountCode"></param>
  4693. /// <param name="userCode"></param>
  4694. /// <param name="userPassword"></param>
  4695. /// <param name="sessionKey"></param>
  4696. /// <returns></returns>
  4697. public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
  4698. {
  4699. ActionResult actionResult = new ActionResult();
  4700. try
  4701. {
  4702. // 验证请求头信息
  4703. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4704. // 验证失败
  4705. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4706. {
  4707. return actionResult;
  4708. }
  4709. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4710. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4711. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4712. {
  4713. actionResult.Status = (int)Constant.PDAResult.Fail;
  4714. actionResult.Message = Messages.MSG_CMN_I002;
  4715. }
  4716. else
  4717. {
  4718. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4719. actionResult.Status = (int)Constant.PDAResult.Success;
  4720. }
  4721. }
  4722. catch (Exception ex)
  4723. {
  4724. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4725. OutputLog.TraceLog(LogPriority.Error,
  4726. this.ToString(),
  4727. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4728. ex.ToString(),
  4729. LocalPath.LogExePath);
  4730. actionResult.Status = (int)Constant.PDAResult.Exception;
  4731. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4732. }
  4733. return actionResult;
  4734. }
  4735. /// <summary>
  4736. /// 取得报表的查询数据源统计工序数据
  4737. /// </summary>
  4738. /// <param name="accountCode"></param>
  4739. /// <param name="userCode"></param>
  4740. /// <param name="userPassword"></param>
  4741. /// <param name="sessionKey"></param>
  4742. /// <param name="RptProcedureID"></param>
  4743. /// <returns></returns>
  4744. public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  4745. {
  4746. ActionResult actionResult = new ActionResult();
  4747. try
  4748. {
  4749. // 验证请求头信息
  4750. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4751. // 验证失败
  4752. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4753. {
  4754. return actionResult;
  4755. }
  4756. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4757. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  4758. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4759. {
  4760. actionResult.Status = (int)Constant.PDAResult.Fail;
  4761. actionResult.Message = Messages.MSG_CMN_I002;
  4762. }
  4763. else
  4764. {
  4765. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4766. actionResult.Status = (int)Constant.PDAResult.Success;
  4767. }
  4768. }
  4769. catch (Exception ex)
  4770. {
  4771. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4772. OutputLog.TraceLog(LogPriority.Error,
  4773. this.ToString(),
  4774. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4775. ex.ToString(),
  4776. LocalPath.LogExePath);
  4777. actionResult.Status = (int)Constant.PDAResult.Exception;
  4778. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4779. }
  4780. return actionResult;
  4781. }
  4782. /// <summary>
  4783. /// 获取用户是否有统计产成品权限
  4784. /// </summary>
  4785. /// <param name="accountCode"></param>
  4786. /// <param name="userCode"></param>
  4787. /// <param name="userPassword"></param>
  4788. /// <param name="sessionKey"></param>
  4789. /// <returns></returns>
  4790. public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4791. {
  4792. ActionResult actionResult = new ActionResult();
  4793. try
  4794. {
  4795. // 验证请求头信息
  4796. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4797. // 验证失败
  4798. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4799. {
  4800. return actionResult;
  4801. }
  4802. int returnValue = ServiceInvoker.Invoke<int>(this,
  4803. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  4804. actionResult.Result = JsonHelper.ToJson(returnValue);
  4805. actionResult.Status = (int)Constant.PDAResult.Success;
  4806. }
  4807. catch (Exception ex)
  4808. {
  4809. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4810. OutputLog.TraceLog(LogPriority.Error,
  4811. this.ToString(),
  4812. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4813. ex.ToString(),
  4814. LocalPath.LogExePath);
  4815. actionResult.Status = (int)Constant.PDAResult.Exception;
  4816. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4817. }
  4818. return actionResult;
  4819. }
  4820. /// <summary>
  4821. /// 获取用户是否有盘点权限
  4822. /// </summary>
  4823. /// <param name="accountCode"></param>
  4824. /// <param name="userCode"></param>
  4825. /// <param name="userPassword"></param>
  4826. /// <param name="sessionKey"></param>
  4827. /// <returns></returns>
  4828. public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4829. {
  4830. ActionResult actionResult = new ActionResult();
  4831. try
  4832. {
  4833. // 验证请求头信息
  4834. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4835. // 验证失败
  4836. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4837. {
  4838. return actionResult;
  4839. }
  4840. int returnValue = ServiceInvoker.Invoke<int>(this,
  4841. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  4842. actionResult.Result = JsonHelper.ToJson(returnValue);
  4843. actionResult.Status = (int)Constant.PDAResult.Success;
  4844. }
  4845. catch (Exception ex)
  4846. {
  4847. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4848. OutputLog.TraceLog(LogPriority.Error,
  4849. this.ToString(),
  4850. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4851. ex.ToString(),
  4852. LocalPath.LogExePath);
  4853. actionResult.Status = (int)Constant.PDAResult.Exception;
  4854. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4855. }
  4856. return actionResult;
  4857. }
  4858. /// <summary>
  4859. /// 根据条件查询是否存在班次配置
  4860. /// </summary>
  4861. /// <param name="accountCode"></param>
  4862. /// <param name="userCode"></param>
  4863. /// <param name="userPassword"></param>
  4864. /// <param name="sessionKey"></param>
  4865. /// <param name="userCode">工号编码</param>
  4866. /// <returns></returns>
  4867. public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  4868. {
  4869. ActionResult actionResult = new ActionResult();
  4870. try
  4871. {
  4872. // 验证请求头信息
  4873. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4874. // 验证失败
  4875. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4876. {
  4877. return actionResult;
  4878. }
  4879. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4880. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  4881. actionResult.Result = JsonHelper.ToJson(ds);
  4882. actionResult.Status = (int)Constant.PDAResult.Success;
  4883. }
  4884. catch (Exception ex)
  4885. {
  4886. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4887. OutputLog.TraceLog(LogPriority.Error,
  4888. this.ToString(),
  4889. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4890. ex.ToString(),
  4891. LocalPath.LogExePath);
  4892. actionResult.Status = (int)Constant.PDAResult.Exception;
  4893. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4894. }
  4895. return actionResult;
  4896. }
  4897. /// <summary>
  4898. /// 报损工序查出工号根据生产数据ID
  4899. /// </summary>
  4900. /// <param name="accountCode"></param>
  4901. /// <param name="userCode"></param>
  4902. /// <param name="userPassword"></param>
  4903. /// <param name="sessionKey"></param>
  4904. /// <param name="ProductionDataID">生产数据ID</param>
  4905. /// <returns></returns>
  4906. public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  4907. {
  4908. ActionResult actionResult = new ActionResult();
  4909. try
  4910. {
  4911. // 验证请求头信息
  4912. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4913. // 验证失败
  4914. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4915. {
  4916. return actionResult;
  4917. }
  4918. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  4919. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  4920. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  4921. {
  4922. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  4923. actionResult.Status = (int)Constant.PDAResult.Success;
  4924. }
  4925. else
  4926. {
  4927. actionResult.Status = (int)Constant.PDAResult.Fail;
  4928. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  4929. }
  4930. }
  4931. catch (Exception ex)
  4932. {
  4933. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4934. OutputLog.TraceLog(LogPriority.Error,
  4935. this.ToString(),
  4936. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4937. ex.ToString(),
  4938. LocalPath.LogExePath);
  4939. actionResult.Status = (int)Constant.PDAResult.Exception;
  4940. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4941. }
  4942. return actionResult;
  4943. }
  4944. /// <summary>
  4945. /// 在入窑工序检验窑车号是否存在
  4946. /// </summary>
  4947. /// <param name="accountCode"></param>
  4948. /// <param name="userCode"></param>
  4949. /// <param name="userPassword"></param>
  4950. /// <param name="sessionKey"></param>
  4951. /// <param name="kilncarcode">窑车编码</param>
  4952. /// <param name="procedureid">工序ID</param>
  4953. /// <returns></returns>
  4954. public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4955. {
  4956. ActionResult actionResult = new ActionResult();
  4957. try
  4958. {
  4959. // 验证请求头信息
  4960. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4961. // 验证失败
  4962. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4963. {
  4964. return actionResult;
  4965. }
  4966. int returnValue = ServiceInvoker.Invoke<int>(this,
  4967. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  4968. if (returnValue == 1)
  4969. {
  4970. actionResult.Result = JsonHelper.ToJson(returnValue);
  4971. actionResult.Status = (int)Constant.PDAResult.Success;
  4972. }
  4973. else
  4974. {
  4975. actionResult.Status = (int)Constant.PDAResult.Fail;
  4976. if (returnValue == -99)
  4977. actionResult.Message = "窑炉车号无效";
  4978. else if (returnValue == -98)
  4979. actionResult.Message = "窑车己无产品";
  4980. else if (returnValue == -97)
  4981. actionResult.Message = "窑车没有入窑,不可以撤销";
  4982. else if (returnValue == -1)
  4983. actionResult.Message = "保存失败";
  4984. }
  4985. }
  4986. catch (Exception ex)
  4987. {
  4988. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4989. OutputLog.TraceLog(LogPriority.Error,
  4990. this.ToString(),
  4991. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4992. ex.ToString(),
  4993. LocalPath.LogExePath);
  4994. actionResult.Status = (int)Constant.PDAResult.Exception;
  4995. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4996. }
  4997. return actionResult;
  4998. }
  4999. /// <summary>
  5000. /// 撤销包装
  5001. /// </summary>
  5002. /// <param name="accountCode"></param>
  5003. /// <param name="userCode"></param>
  5004. /// <param name="userPassword"></param>
  5005. /// <param name="sessionKey"></param>
  5006. /// <param name="barcode"></param>
  5007. /// <returns></returns>
  5008. public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5009. {
  5010. ActionResult actionResult = new ActionResult();
  5011. try
  5012. {
  5013. // 验证请求头信息
  5014. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5015. // 验证失败
  5016. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5017. {
  5018. return actionResult;
  5019. }
  5020. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5021. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  5022. if (Convert.ToInt32(returnValue.Result) > 0)
  5023. {
  5024. actionResult.Result = JsonHelper.ToJson(returnValue);
  5025. actionResult.Status = (int)Constant.PDAResult.Success;
  5026. }
  5027. else
  5028. {
  5029. actionResult.Status = (int)Constant.PDAResult.Fail;
  5030. if (Convert.ToInt32(returnValue.Result) == -1)
  5031. actionResult.Message = "产品条码不存在包装记录";
  5032. else if (Convert.ToInt32(returnValue.Result) == -200)
  5033. actionResult.Message = returnValue.Message;
  5034. else
  5035. actionResult.Message = "成品撤销失败";
  5036. }
  5037. }
  5038. catch (Exception ex)
  5039. {
  5040. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5041. OutputLog.TraceLog(LogPriority.Error,
  5042. this.ToString(),
  5043. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5044. ex.ToString(),
  5045. LocalPath.LogExePath);
  5046. actionResult.Status = (int)Constant.PDAResult.Exception;
  5047. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5048. }
  5049. return actionResult;
  5050. }
  5051. /*
  5052. /// <summary>
  5053. /// 获取用户是否有撤销包装权限
  5054. /// </summary>
  5055. /// <param name="accountCode"></param>
  5056. /// <param name="userCode"></param>
  5057. /// <param name="userPassword"></param>
  5058. /// <param name="sessionKey"></param>
  5059. /// <returns></returns>
  5060. public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5061. {
  5062. ActionResult actionResult = new ActionResult();
  5063. try
  5064. {
  5065. // 验证请求头信息
  5066. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5067. // 验证失败
  5068. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5069. {
  5070. return actionResult;
  5071. }
  5072. int returnValue = ServiceInvoker.Invoke<int>(this,
  5073. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5074. actionResult.Result = JsonHelper.ToJson(returnValue);
  5075. actionResult.Status = (int)Constant.PDAResult.Success;
  5076. }
  5077. catch (Exception ex)
  5078. {
  5079. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5080. OutputLog.TraceLog(LogPriority.Error,
  5081. this.ToString(),
  5082. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5083. ex.ToString(),
  5084. LocalPath.LogExePath);
  5085. actionResult.Status = (int)Constant.PDAResult.Exception;
  5086. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5087. }
  5088. return actionResult;
  5089. }
  5090. */
  5091. /// <summary>
  5092. /// 窑车状态明细表查询
  5093. /// </summary>
  5094. /// <param name="accountCode"></param>
  5095. /// <param name="userCode"></param>
  5096. /// <param name="userPassword"></param>
  5097. /// <param name="sessionKey"></param>
  5098. /// <param name="kilnCarCode"></param>
  5099. /// <returns></returns>
  5100. public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5101. {
  5102. ActionResult actionResult = new ActionResult();
  5103. try
  5104. {
  5105. // 验证请求头信息
  5106. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5107. // 验证失败
  5108. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5109. {
  5110. return actionResult;
  5111. }
  5112. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5113. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5114. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5115. {
  5116. actionResult.Status = (int)Constant.PDAResult.Fail;
  5117. actionResult.Message = Messages.MSG_CMN_I002;
  5118. }
  5119. else
  5120. {
  5121. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5122. actionResult.Status = (int)Constant.PDAResult.Success;
  5123. }
  5124. }
  5125. catch (Exception ex)
  5126. {
  5127. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5128. OutputLog.TraceLog(LogPriority.Error,
  5129. this.ToString(),
  5130. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5131. ex.ToString(),
  5132. LocalPath.LogExePath);
  5133. actionResult.Status = (int)Constant.PDAResult.Exception;
  5134. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5135. }
  5136. return actionResult;
  5137. }
  5138. /// <summary>
  5139. /// 损坯撤销
  5140. /// </summary>
  5141. /// <param name="accountCode"></param>
  5142. /// <param name="userCode"></param>
  5143. /// <param name="userPassword"></param>
  5144. /// <param name="sessionKey"></param>
  5145. /// <param name="barcode"></param>
  5146. /// <returns></returns>
  5147. public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5148. {
  5149. ActionResult actionResult = new ActionResult();
  5150. try
  5151. {
  5152. // 验证请求头信息
  5153. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5154. // 验证失败
  5155. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5156. {
  5157. return actionResult;
  5158. }
  5159. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5160. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5161. if (Convert.ToInt32(returnValue.Result) > 0)
  5162. {
  5163. actionResult.Result = JsonHelper.ToJson(returnValue);
  5164. actionResult.Status = (int)Constant.PDAResult.Success;
  5165. }
  5166. else
  5167. {
  5168. actionResult.Status = (int)Constant.PDAResult.Fail;
  5169. if (Convert.ToInt32(returnValue.Result) == -1)
  5170. actionResult.Message = "此产品没有损坯,不能撤销";
  5171. else if (Convert.ToInt32(returnValue.Result) == -200)
  5172. actionResult.Message = returnValue.Message;
  5173. else
  5174. actionResult.Message = "损坯撤销失败";
  5175. }
  5176. }
  5177. catch (Exception ex)
  5178. {
  5179. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5180. OutputLog.TraceLog(LogPriority.Error,
  5181. this.ToString(),
  5182. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5183. ex.ToString(),
  5184. LocalPath.LogExePath);
  5185. actionResult.Status = (int)Constant.PDAResult.Exception;
  5186. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5187. }
  5188. return actionResult;
  5189. }
  5190. /*
  5191. /// <summary>
  5192. /// 获取用户是否有损坯撤销权限
  5193. /// </summary>
  5194. /// <param name="accountCode"></param>
  5195. /// <param name="userCode"></param>
  5196. /// <param name="userPassword"></param>
  5197. /// <param name="sessionKey"></param>
  5198. /// <returns></returns>
  5199. public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5200. {
  5201. ActionResult actionResult = new ActionResult();
  5202. try
  5203. {
  5204. // 验证请求头信息
  5205. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5206. // 验证失败
  5207. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5208. {
  5209. return actionResult;
  5210. }
  5211. int returnValue = ServiceInvoker.Invoke<int>(this,
  5212. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5213. actionResult.Result = JsonHelper.ToJson(returnValue);
  5214. actionResult.Status = (int)Constant.PDAResult.Success;
  5215. }
  5216. catch (Exception ex)
  5217. {
  5218. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5219. OutputLog.TraceLog(LogPriority.Error,
  5220. this.ToString(),
  5221. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5222. ex.ToString(),
  5223. LocalPath.LogExePath);
  5224. actionResult.Status = (int)Constant.PDAResult.Exception;
  5225. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5226. }
  5227. return actionResult;
  5228. }
  5229. */
  5230. /// <summary>
  5231. /// 获取条码注浆信息
  5232. /// </summary>
  5233. /// <param name="accountCode"></param>
  5234. /// <param name="userCode"></param>
  5235. /// <param name="userPassword"></param>
  5236. /// <param name="sessionKey"></param>
  5237. /// <returns></returns>
  5238. public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5239. {
  5240. ActionResult actionResult = new ActionResult();
  5241. try
  5242. {
  5243. // 验证请求头信息
  5244. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5245. // 验证失败
  5246. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5247. {
  5248. return actionResult;
  5249. }
  5250. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5251. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5252. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5253. {
  5254. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5255. actionResult.Status = (int)Constant.PDAResult.Success;
  5256. }
  5257. else
  5258. {
  5259. actionResult.Status = (int)Constant.PDAResult.Fail;
  5260. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5261. }
  5262. }
  5263. catch (Exception ex)
  5264. {
  5265. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5266. OutputLog.TraceLog(LogPriority.Error,
  5267. this.ToString(),
  5268. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5269. ex.ToString(),
  5270. LocalPath.LogExePath);
  5271. actionResult.Status = (int)Constant.PDAResult.Exception;
  5272. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5273. }
  5274. return actionResult;
  5275. }
  5276. /// <summary>
  5277. /// 获取条码注浆信息
  5278. /// </summary>
  5279. /// <param name="accountCode"></param>
  5280. /// <param name="userCode"></param>
  5281. /// <param name="userPassword"></param>
  5282. /// <param name="sessionKey"></param>
  5283. /// <returns></returns>
  5284. public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5285. {
  5286. ActionResult actionResult = new ActionResult();
  5287. try
  5288. {
  5289. // 验证请求头信息
  5290. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5291. // 验证失败
  5292. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5293. {
  5294. return actionResult;
  5295. }
  5296. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5297. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5298. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5299. {
  5300. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5301. actionResult.Status = (int)Constant.PDAResult.Success;
  5302. }
  5303. else
  5304. {
  5305. actionResult.Status = (int)Constant.PDAResult.Fail;
  5306. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5307. }
  5308. }
  5309. catch (Exception ex)
  5310. {
  5311. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5312. OutputLog.TraceLog(LogPriority.Error,
  5313. this.ToString(),
  5314. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5315. ex.ToString(),
  5316. LocalPath.LogExePath);
  5317. actionResult.Status = (int)Constant.PDAResult.Exception;
  5318. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5319. }
  5320. return actionResult;
  5321. }
  5322. /// <summary>
  5323. /// 公坯设定
  5324. /// </summary>
  5325. /// <param name="accountCode"></param>
  5326. /// <param name="userCode"></param>
  5327. /// <param name="userPassword"></param>
  5328. /// <param name="sessionKey"></param>
  5329. /// <param name="barcode"></param>
  5330. /// <returns></returns>
  5331. public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5332. {
  5333. ActionResult actionResult = new ActionResult();
  5334. try
  5335. {
  5336. // 验证请求头信息
  5337. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5338. // 验证失败
  5339. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5340. {
  5341. return actionResult;
  5342. }
  5343. int returnValue = ServiceInvoker.Invoke<int>(this,
  5344. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5345. if (returnValue > 0)
  5346. {
  5347. actionResult.Result = JsonHelper.ToJson(returnValue);
  5348. actionResult.Status = (int)Constant.PDAResult.Success;
  5349. }
  5350. else
  5351. {
  5352. actionResult.Status = (int)Constant.PDAResult.Fail;
  5353. if (returnValue == -1)
  5354. actionResult.Message = "此产品不在生产线上";
  5355. else if (returnValue == -2)
  5356. actionResult.Message = "该产品已经标识为公坯";
  5357. else
  5358. actionResult.Message = "公坯设定失败";
  5359. }
  5360. }
  5361. catch (Exception ex)
  5362. {
  5363. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5364. OutputLog.TraceLog(LogPriority.Error,
  5365. this.ToString(),
  5366. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5367. ex.ToString(),
  5368. LocalPath.LogExePath);
  5369. actionResult.Status = (int)Constant.PDAResult.Exception;
  5370. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5371. }
  5372. return actionResult;
  5373. }
  5374. /*
  5375. /// <summary>
  5376. /// 获取用户是否有公坯设定
  5377. /// </summary>
  5378. /// <param name="accountCode"></param>
  5379. /// <param name="userCode"></param>
  5380. /// <param name="userPassword"></param>
  5381. /// <param name="sessionKey"></param>
  5382. /// <returns></returns>
  5383. public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5384. {
  5385. ActionResult actionResult = new ActionResult();
  5386. try
  5387. {
  5388. // 验证请求头信息
  5389. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5390. // 验证失败
  5391. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5392. {
  5393. return actionResult;
  5394. }
  5395. int returnValue = ServiceInvoker.Invoke<int>(this,
  5396. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5397. actionResult.Result = JsonHelper.ToJson(returnValue);
  5398. actionResult.Status = (int)Constant.PDAResult.Success;
  5399. }
  5400. catch (Exception ex)
  5401. {
  5402. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5403. OutputLog.TraceLog(LogPriority.Error,
  5404. this.ToString(),
  5405. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5406. ex.ToString(),
  5407. LocalPath.LogExePath);
  5408. actionResult.Status = (int)Constant.PDAResult.Exception;
  5409. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5410. }
  5411. return actionResult;
  5412. }
  5413. */
  5414. /// <summary>
  5415. /// 校验产品条码是否可以走到该工序
  5416. /// </summary>
  5417. /// <param name="accountCode">帐套code</param>
  5418. /// <param name="userCode">用户code</param>
  5419. /// <param name="userPassword">用户密码</param>
  5420. /// <param name="sessionKey">本次登陆密钥</param>
  5421. /// <param name="procedureID">工序ID</param>
  5422. /// <param name="barcode">条码</param>
  5423. /// <returns></returns>
  5424. /// <remarks>
  5425. /// 陈冰 2014.09.18 新建
  5426. /// </remarks>
  5427. public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5428. {
  5429. ActionResult actionResult = new ActionResult();
  5430. try
  5431. {
  5432. // 验证请求头信息
  5433. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5434. // 验证失败
  5435. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5436. {
  5437. return actionResult;
  5438. }
  5439. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5440. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5441. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5442. {
  5443. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5444. actionResult.Status = (int)Constant.PDAResult.Success;
  5445. }
  5446. else
  5447. {
  5448. actionResult.Status = (int)Constant.PDAResult.Fail;
  5449. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5450. }
  5451. }
  5452. catch (Exception ex)
  5453. {
  5454. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5455. OutputLog.TraceLog(LogPriority.Error,
  5456. this.ToString(),
  5457. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5458. ex.ToString(),
  5459. LocalPath.LogExePath);
  5460. actionResult.Status = (int)Constant.PDAResult.Exception;
  5461. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5462. }
  5463. return actionResult;
  5464. }
  5465. /// <summary>
  5466. /// 获取用户所有菜单权限
  5467. /// </summary>
  5468. /// <param name="accountCode"></param>
  5469. /// <param name="userCode"></param>
  5470. /// <param name="userPassword"></param>
  5471. /// <param name="sessionKey"></param>
  5472. /// <returns></returns>
  5473. public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
  5474. {
  5475. ActionResult actionResult = new ActionResult();
  5476. try
  5477. {
  5478. // 验证请求头信息
  5479. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5480. // 验证失败
  5481. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5482. {
  5483. return actionResult;
  5484. }
  5485. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5486. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5487. actionResult.Result = JsonHelper.ToJson(returnValue);
  5488. actionResult.Status = (int)Constant.PDAResult.Success;
  5489. }
  5490. catch (Exception ex)
  5491. {
  5492. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5493. OutputLog.TraceLog(LogPriority.Error,
  5494. this.ToString(),
  5495. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5496. ex.ToString(),
  5497. LocalPath.LogExePath);
  5498. actionResult.Status = (int)Constant.PDAResult.Exception;
  5499. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5500. }
  5501. return actionResult;
  5502. }
  5503. public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5504. {
  5505. ActionResult actionResult = new ActionResult();
  5506. try
  5507. {
  5508. // 验证请求头信息
  5509. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5510. // 验证失败
  5511. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5512. {
  5513. return actionResult;
  5514. }
  5515. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5516. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5517. if (Convert.ToInt32(returnValue.Result) > 0)
  5518. {
  5519. actionResult.Result = JsonHelper.ToJson(returnValue);
  5520. actionResult.Status = (int)Constant.PDAResult.Success;
  5521. }
  5522. else
  5523. {
  5524. actionResult.Status = (int)Constant.PDAResult.Fail;
  5525. if (Convert.ToInt32(returnValue.Result) == -1)
  5526. actionResult.Message = "无效条码";
  5527. else if (Convert.ToInt32(returnValue.Result) == -2)
  5528. actionResult.Message = "已经生产完成";
  5529. else if (Convert.ToInt32(returnValue.Result) == -3)
  5530. actionResult.Message = "条码已经申请报废";
  5531. else if (Convert.ToInt32(returnValue.Result) == -4)
  5532. actionResult.Message = "此条码当前工序不允许进行撤销";
  5533. else if (Convert.ToInt32(returnValue.Result) == -5)
  5534. actionResult.Message = "此条码没有生产数据";
  5535. else if (Convert.ToInt32(returnValue.Result) == -6)
  5536. actionResult.Message = "没有当前工序权限";
  5537. else if (Convert.ToInt32(returnValue.Result) == -7)
  5538. actionResult.Message = "条码不在生产线上";
  5539. else if (Convert.ToInt32(returnValue.Result) == -8)
  5540. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5541. else if (Convert.ToInt32(returnValue.Result) == -9)
  5542. actionResult.Message = "条码已经是返工状态";
  5543. else if (Convert.ToInt32(returnValue.Result) == -200)
  5544. actionResult.Message = returnValue.Message;
  5545. }
  5546. }
  5547. catch (Exception ex)
  5548. {
  5549. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5550. OutputLog.TraceLog(LogPriority.Error,
  5551. this.ToString(),
  5552. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5553. ex.ToString(),
  5554. LocalPath.LogExePath);
  5555. actionResult.Status = (int)Constant.PDAResult.Exception;
  5556. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5557. }
  5558. return actionResult;
  5559. }
  5560. public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5561. {
  5562. ActionResult actionResult = new ActionResult();
  5563. try
  5564. {
  5565. // 验证请求头信息
  5566. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5567. // 验证失败
  5568. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5569. {
  5570. return actionResult;
  5571. }
  5572. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5573. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5574. if (Convert.ToInt32(returnValue.Result) > 0)
  5575. {
  5576. actionResult.Result = JsonHelper.ToJson(returnValue);
  5577. actionResult.Status = (int)Constant.PDAResult.Success;
  5578. }
  5579. else
  5580. {
  5581. actionResult.Status = (int)Constant.PDAResult.Fail;
  5582. if (Convert.ToInt32(returnValue.Result) == -1)
  5583. actionResult.Message = "无效条码";
  5584. else if (Convert.ToInt32(returnValue.Result) == -2)
  5585. actionResult.Message = "已经生产完成";
  5586. else if (Convert.ToInt32(returnValue.Result) == -3)
  5587. actionResult.Message = "条码已经申请报废";
  5588. else if (Convert.ToInt32(returnValue.Result) == -4)
  5589. actionResult.Message = "此条码当前工序不允许进行撤销";
  5590. else if (Convert.ToInt32(returnValue.Result) == -5)
  5591. actionResult.Message = "此条码没有生产数据";
  5592. else if (Convert.ToInt32(returnValue.Result) == -55)
  5593. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5594. else if (Convert.ToInt32(returnValue.Result) == -6)
  5595. actionResult.Message = "没有任何影响行";
  5596. else if (Convert.ToInt32(returnValue.Result) == -7)
  5597. actionResult.Message = "条码不在生产线上";
  5598. else if (Convert.ToInt32(returnValue.Result) == -8)
  5599. actionResult.Message = "条码已经是返工状态";
  5600. else if (Convert.ToInt32(returnValue.Result) == -200)
  5601. actionResult.Message = returnValue.Message;
  5602. }
  5603. }
  5604. catch (Exception ex)
  5605. {
  5606. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5607. OutputLog.TraceLog(LogPriority.Error,
  5608. this.ToString(),
  5609. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5610. ex.ToString(),
  5611. LocalPath.LogExePath);
  5612. actionResult.Status = (int)Constant.PDAResult.Exception;
  5613. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5614. }
  5615. return actionResult;
  5616. }
  5617. public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  5618. {
  5619. ActionResult actionResult = new ActionResult();
  5620. try
  5621. {
  5622. // 验证请求头信息
  5623. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5624. // 验证失败
  5625. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5626. {
  5627. return actionResult;
  5628. }
  5629. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5630. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5631. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5632. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5633. {
  5634. //DataView dv = returnValue.Tables[0].DefaultView;
  5635. //dv.RowFilter = "ValueFlag=1";
  5636. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5637. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5638. actionResult.Status = (int)Constant.PDAResult.Success;
  5639. }
  5640. }
  5641. catch (Exception ex)
  5642. {
  5643. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5644. OutputLog.TraceLog(LogPriority.Error,
  5645. this.ToString(),
  5646. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5647. ex.ToString(),
  5648. LocalPath.LogExePath);
  5649. actionResult.Status = (int)Constant.PDAResult.Exception;
  5650. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5651. }
  5652. return actionResult;
  5653. }
  5654. public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5655. {
  5656. ActionResult actionResult = new ActionResult();
  5657. try
  5658. {
  5659. // 验证请求头信息
  5660. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5661. // 验证失败
  5662. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5663. {
  5664. return actionResult;
  5665. }
  5666. int returnValue = ServiceInvoker.Invoke<int>(this,
  5667. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5668. actionResult.Result = JsonHelper.ToJson(returnValue);
  5669. actionResult.Status = (int)Constant.PDAResult.Success;
  5670. }
  5671. catch (Exception ex)
  5672. {
  5673. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5674. OutputLog.TraceLog(LogPriority.Error,
  5675. this.ToString(),
  5676. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5677. ex.ToString(),
  5678. LocalPath.LogExePath);
  5679. actionResult.Status = (int)Constant.PDAResult.Exception;
  5680. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5681. }
  5682. return actionResult;
  5683. }
  5684. public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  5685. {
  5686. ActionResult actionResult = new ActionResult();
  5687. try
  5688. {
  5689. // 验证请求头信息
  5690. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5691. // 验证失败
  5692. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5693. {
  5694. return actionResult;
  5695. }
  5696. int returnValue = ServiceInvoker.Invoke<int>(this,
  5697. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo));
  5698. actionResult.Result = JsonHelper.ToJson(returnValue);
  5699. actionResult.Status = (int)Constant.PDAResult.Success;
  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. public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5715. {
  5716. ActionResult actionResult = new ActionResult();
  5717. try
  5718. {
  5719. // 验证请求头信息
  5720. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5721. // 验证失败
  5722. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5723. {
  5724. return actionResult;
  5725. }
  5726. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5727. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  5728. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5729. {
  5730. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5731. actionResult.Status = (int)Constant.PDAResult.Success;
  5732. }
  5733. }
  5734. catch (Exception ex)
  5735. {
  5736. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5737. OutputLog.TraceLog(LogPriority.Error,
  5738. this.ToString(),
  5739. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5740. ex.ToString(),
  5741. LocalPath.LogExePath);
  5742. actionResult.Status = (int)Constant.PDAResult.Exception;
  5743. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5744. }
  5745. return actionResult;
  5746. }
  5747. /// <summary>
  5748. /// 半检时,入窑前检验获取此条码是否报损为废品
  5749. /// </summary>
  5750. /// <param name="accountCode"></param>
  5751. /// <param name="userCode"></param>
  5752. /// <param name="userPassword"></param>
  5753. /// <param name="sessionKey"></param>
  5754. /// <param name="barcode">产品条码</param>
  5755. /// <returns></returns>
  5756. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5757. {
  5758. ActionResult actionResult = new ActionResult();
  5759. try
  5760. {
  5761. // 验证请求头信息
  5762. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5763. // 验证失败
  5764. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5765. {
  5766. return actionResult;
  5767. }
  5768. int returnValue = ServiceInvoker.Invoke<int>(this,
  5769. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  5770. if (returnValue != -100)
  5771. {
  5772. actionResult.Result = JsonHelper.ToJson(returnValue);
  5773. actionResult.Status = (int)Constant.PDAResult.Success;
  5774. }
  5775. else
  5776. {
  5777. actionResult.Status = (int)Constant.PDAResult.Fail;
  5778. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  5779. }
  5780. }
  5781. catch (Exception ex)
  5782. {
  5783. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5784. OutputLog.TraceLog(LogPriority.Error,
  5785. this.ToString(),
  5786. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5787. ex.ToString(),
  5788. LocalPath.LogExePath);
  5789. actionResult.Status = (int)Constant.PDAResult.Exception;
  5790. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5791. }
  5792. return actionResult;
  5793. }
  5794. /// <summary>
  5795. /// 获取登陆帐户有无入窑前检验数据编辑权限
  5796. /// </summary>
  5797. /// <param name="accountCode"></param>
  5798. /// <param name="userCode"></param>
  5799. /// <param name="userPassword"></param>
  5800. /// <param name="sessionKey"></param>
  5801. /// <param name="usercode">工号编码</param>
  5802. /// <returns></returns>
  5803. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5804. {
  5805. ActionResult actionResult = new ActionResult();
  5806. try
  5807. {
  5808. // 验证请求头信息
  5809. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5810. // 验证失败
  5811. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5812. {
  5813. return actionResult;
  5814. }
  5815. int returnValue = ServiceInvoker.Invoke<int>(this,
  5816. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  5817. actionResult.Result = JsonHelper.ToJson(returnValue);
  5818. actionResult.Status = (int)Constant.PDAResult.Success;
  5819. }
  5820. catch (Exception ex)
  5821. {
  5822. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5823. OutputLog.TraceLog(LogPriority.Error,
  5824. this.ToString(),
  5825. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5826. ex.ToString(),
  5827. LocalPath.LogExePath);
  5828. actionResult.Status = (int)Constant.PDAResult.Exception;
  5829. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5830. }
  5831. return actionResult;
  5832. }
  5833. /// <summary>
  5834. /// 获取登陆帐户有无半检验数据编辑权限
  5835. /// </summary>
  5836. /// <param name="accountCode"></param>
  5837. /// <param name="userCode"></param>
  5838. /// <param name="userPassword"></param>
  5839. /// <param name="sessionKey"></param>
  5840. /// <param name="usercode">工号编码</param>
  5841. /// <returns></returns>
  5842. public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5843. {
  5844. ActionResult actionResult = new ActionResult();
  5845. try
  5846. {
  5847. // 验证请求头信息
  5848. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5849. // 验证失败
  5850. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5851. {
  5852. return actionResult;
  5853. }
  5854. int returnValue = ServiceInvoker.Invoke<int>(this,
  5855. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  5856. actionResult.Result = JsonHelper.ToJson(returnValue);
  5857. actionResult.Status = (int)Constant.PDAResult.Success;
  5858. }
  5859. catch (Exception ex)
  5860. {
  5861. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5862. OutputLog.TraceLog(LogPriority.Error,
  5863. this.ToString(),
  5864. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5865. ex.ToString(),
  5866. LocalPath.LogExePath);
  5867. actionResult.Status = (int)Constant.PDAResult.Exception;
  5868. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5869. }
  5870. return actionResult;
  5871. }
  5872. /// <summary>
  5873. /// 获取缺陷扣罚管理的全部数据
  5874. /// </summary>
  5875. /// <param name="accountCode"></param>
  5876. /// <param name="userCode"></param>
  5877. /// <param name="userPassword"></param>
  5878. /// <param name="sessionKey"></param>
  5879. /// <returns></returns>
  5880. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  5881. {
  5882. ActionResult actionResult = new ActionResult();
  5883. try
  5884. {
  5885. // 验证请求头信息
  5886. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5887. // 验证失败
  5888. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5889. {
  5890. return actionResult;
  5891. }
  5892. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5893. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  5894. if (ds != null && ds.Tables[0].Rows.Count > 0)
  5895. {
  5896. DataView dv = ds.Tables[0].DefaultView;
  5897. dv.RowFilter = "valueflag=1";
  5898. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5899. actionResult.Status = (int)Constant.PDAResult.Success;
  5900. }
  5901. else
  5902. {
  5903. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  5904. actionResult.Status = (int)Constant.PDAResult.Success;
  5905. }
  5906. }
  5907. catch (Exception ex)
  5908. {
  5909. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5910. OutputLog.TraceLog(LogPriority.Error,
  5911. this.ToString(),
  5912. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5913. ex.ToString(),
  5914. LocalPath.LogExePath);
  5915. actionResult.Status = (int)Constant.PDAResult.Exception;
  5916. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5917. }
  5918. return actionResult;
  5919. }
  5920. /// <summary>
  5921. /// 获取缺陷扣除数管理的全部数据
  5922. /// </summary>
  5923. /// <param name="accountCode"></param>
  5924. /// <param name="userCode"></param>
  5925. /// <param name="userPassword"></param>
  5926. /// <param name="sessionKey"></param>
  5927. /// <returns></returns>
  5928. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  5929. {
  5930. ActionResult actionResult = new ActionResult();
  5931. try
  5932. {
  5933. // 验证请求头信息
  5934. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5935. // 验证失败
  5936. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5937. {
  5938. return actionResult;
  5939. }
  5940. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5941. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  5942. if (ds != null && ds.Tables[0].Rows.Count > 0)
  5943. {
  5944. DataView dv = ds.Tables[0].DefaultView;
  5945. dv.RowFilter = "valueflag=1";
  5946. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5947. actionResult.Status = (int)Constant.PDAResult.Success;
  5948. }
  5949. else
  5950. {
  5951. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  5952. actionResult.Status = (int)Constant.PDAResult.Success;
  5953. }
  5954. }
  5955. catch (Exception ex)
  5956. {
  5957. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5958. OutputLog.TraceLog(LogPriority.Error,
  5959. this.ToString(),
  5960. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5961. ex.ToString(),
  5962. LocalPath.LogExePath);
  5963. actionResult.Status = (int)Constant.PDAResult.Exception;
  5964. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5965. }
  5966. return actionResult;
  5967. }
  5968. /// <summary>
  5969. /// 获取缺陷扣罚关系管理的全部数据
  5970. /// </summary>
  5971. /// <param name="accountCode"></param>
  5972. /// <param name="userCode"></param>
  5973. /// <param name="userPassword"></param>
  5974. /// <param name="sessionKey"></param>
  5975. /// <returns></returns>
  5976. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  5977. {
  5978. ActionResult actionResult = new ActionResult();
  5979. try
  5980. {
  5981. // 验证请求头信息
  5982. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5983. // 验证失败
  5984. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5985. {
  5986. return actionResult;
  5987. }
  5988. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5989. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  5990. DataTable dt = new DataTable();
  5991. dt.Columns.Add("DefectID");
  5992. dt.Columns.Add("DefectFineID");
  5993. DataView dv = ds.Tables[0].DefaultView;
  5994. DataTable dtFor = dv.ToTable("defectid", true);
  5995. for (int i = 0; i < dtFor.Rows.Count; i++)
  5996. {
  5997. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  5998. string substring = "";
  5999. foreach (DataRow r1 in r)
  6000. {
  6001. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  6002. }
  6003. if (substring != "")
  6004. {
  6005. DataRow drnew = dt.NewRow();
  6006. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6007. drnew["DefectFineID"] = substring.TrimEnd(',');
  6008. dt.Rows.Add(drnew);
  6009. }
  6010. }
  6011. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6012. actionResult.Status = (int)Constant.PDAResult.Success;
  6013. }
  6014. catch (Exception ex)
  6015. {
  6016. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6017. OutputLog.TraceLog(LogPriority.Error,
  6018. this.ToString(),
  6019. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6020. ex.ToString(),
  6021. LocalPath.LogExePath);
  6022. actionResult.Status = (int)Constant.PDAResult.Exception;
  6023. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6024. }
  6025. return actionResult;
  6026. }
  6027. /// <summary>
  6028. /// 获取缺陷扣除数关系管理的全部数据
  6029. /// </summary>
  6030. /// <param name="accountCode"></param>
  6031. /// <param name="userCode"></param>
  6032. /// <param name="userPassword"></param>
  6033. /// <param name="sessionKey"></param>
  6034. /// <returns></returns>
  6035. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6036. {
  6037. ActionResult actionResult = new ActionResult();
  6038. try
  6039. {
  6040. // 验证请求头信息
  6041. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6042. // 验证失败
  6043. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6044. {
  6045. return actionResult;
  6046. }
  6047. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6048. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6049. DataTable dt = new DataTable();
  6050. dt.Columns.Add("DefectID");
  6051. dt.Columns.Add("DefectDeductionNum");
  6052. DataView dv = ds.Tables[0].DefaultView;
  6053. DataTable dtFor = dv.ToTable("defectid", true);
  6054. for (int i = 0; i < dtFor.Rows.Count; i++)
  6055. {
  6056. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6057. string substring = "";
  6058. foreach (DataRow r1 in r)
  6059. {
  6060. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6061. }
  6062. if (substring != "")
  6063. {
  6064. DataRow drnew = dt.NewRow();
  6065. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6066. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6067. dt.Rows.Add(drnew);
  6068. }
  6069. }
  6070. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6071. actionResult.Status = (int)Constant.PDAResult.Success;
  6072. }
  6073. catch (Exception ex)
  6074. {
  6075. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6076. OutputLog.TraceLog(LogPriority.Error,
  6077. this.ToString(),
  6078. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6079. ex.ToString(),
  6080. LocalPath.LogExePath);
  6081. actionResult.Status = (int)Constant.PDAResult.Exception;
  6082. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6083. }
  6084. return actionResult;
  6085. }
  6086. /// <summary>
  6087. /// 获取盘点单明细
  6088. /// </summary>
  6089. /// <param name="sUserInfo"></param>
  6090. /// <returns></returns>
  6091. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6092. {
  6093. ActionResult actionResult = new ActionResult();
  6094. try
  6095. {
  6096. // 验证请求头信息
  6097. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6098. // 验证失败
  6099. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6100. {
  6101. return actionResult;
  6102. }
  6103. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6104. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6105. actionResult.Result = JsonHelper.ToJson(ds);
  6106. actionResult.Status = (int)Constant.PDAResult.Success;
  6107. }
  6108. catch (Exception ex)
  6109. {
  6110. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6111. OutputLog.TraceLog(LogPriority.Error,
  6112. this.ToString(),
  6113. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6114. ex.ToString(),
  6115. LocalPath.LogExePath);
  6116. actionResult.Status = (int)Constant.PDAResult.Exception;
  6117. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6118. }
  6119. return actionResult;
  6120. }
  6121. /// <summary>
  6122. /// 半检检验条码
  6123. /// </summary>
  6124. /// <param name="sUserInfo"></param>
  6125. /// <returns></returns>
  6126. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6127. {
  6128. ActionResult actionResult = new ActionResult();
  6129. try
  6130. {
  6131. // 验证请求头信息
  6132. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6133. // 验证失败
  6134. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6135. {
  6136. return actionResult;
  6137. }
  6138. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6139. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6140. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6141. if (Convert.ToInt32(resultEntity.Result) < 0)
  6142. {
  6143. actionResult.Status = (int)Constant.PDAResult.Fail;
  6144. }
  6145. else
  6146. {
  6147. actionResult.Status = (int)Constant.PDAResult.Success;
  6148. }
  6149. actionResult.Message = resultEntity.Message;
  6150. }
  6151. catch (Exception ex)
  6152. {
  6153. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6154. OutputLog.TraceLog(LogPriority.Error,
  6155. this.ToString(),
  6156. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6157. ex.ToString(),
  6158. LocalPath.LogExePath);
  6159. actionResult.Status = (int)Constant.PDAResult.Exception;
  6160. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6161. }
  6162. return actionResult;
  6163. }
  6164. /// <summary>
  6165. /// 根据条码获取经过的工序,用于绑定返工工序
  6166. /// </summary>
  6167. /// <param name="sUserInfo"></param>
  6168. /// <returns></returns>
  6169. public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6170. {
  6171. ActionResult actionResult = new ActionResult();
  6172. try
  6173. {
  6174. // 验证请求头信息
  6175. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6176. // 验证失败
  6177. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6178. {
  6179. return actionResult;
  6180. }
  6181. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6182. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6183. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6184. actionResult.Status = (int)Constant.PDAResult.Success;
  6185. }
  6186. catch (Exception ex)
  6187. {
  6188. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6189. OutputLog.TraceLog(LogPriority.Error,
  6190. this.ToString(),
  6191. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6192. ex.ToString(),
  6193. LocalPath.LogExePath);
  6194. actionResult.Status = (int)Constant.PDAResult.Exception;
  6195. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6196. }
  6197. return actionResult;
  6198. }
  6199. /// <summary>
  6200. /// 获取登陆帐户有无半检状态权限
  6201. /// </summary>
  6202. /// <param name="sUserInfo"></param>
  6203. /// <returns></returns>
  6204. public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6205. {
  6206. ActionResult actionResult = new ActionResult();
  6207. try
  6208. {
  6209. // 验证请求头信息
  6210. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6211. // 验证失败
  6212. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6213. {
  6214. return actionResult;
  6215. }
  6216. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6217. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6218. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6219. actionResult.Status = (int)Constant.PDAResult.Success;
  6220. }
  6221. catch (Exception ex)
  6222. {
  6223. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6224. OutputLog.TraceLog(LogPriority.Error,
  6225. this.ToString(),
  6226. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6227. ex.ToString(),
  6228. LocalPath.LogExePath);
  6229. actionResult.Status = (int)Constant.PDAResult.Exception;
  6230. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6231. }
  6232. return actionResult;
  6233. }
  6234. /// <summary>
  6235. /// 复检状态数据源
  6236. /// </summary>
  6237. /// <param name="sUserInfo"></param>
  6238. /// <returns></returns>
  6239. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6240. {
  6241. ActionResult actionResult = new ActionResult();
  6242. try
  6243. {
  6244. // 验证请求头信息
  6245. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6246. // 验证失败
  6247. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6248. {
  6249. return actionResult;
  6250. }
  6251. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6252. () => SystemModuleLogic.GetSemiCheckType());
  6253. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6254. actionResult.Status = (int)Constant.PDAResult.Success;
  6255. }
  6256. catch (Exception ex)
  6257. {
  6258. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6259. OutputLog.TraceLog(LogPriority.Error,
  6260. this.ToString(),
  6261. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6262. ex.ToString(),
  6263. LocalPath.LogExePath);
  6264. actionResult.Status = (int)Constant.PDAResult.Exception;
  6265. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6266. }
  6267. return actionResult;
  6268. }
  6269. /// <summary>
  6270. /// 根据半成品检验数据ID,显示半成品数据信息
  6271. /// </summary>
  6272. /// <param name="sUserInfo"></param>
  6273. /// <returns></returns>
  6274. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6275. {
  6276. ActionResult actionResult = new ActionResult();
  6277. try
  6278. {
  6279. // 验证请求头信息
  6280. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6281. // 验证失败
  6282. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6283. {
  6284. return actionResult;
  6285. }
  6286. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6287. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6288. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6289. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6290. {
  6291. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6292. {
  6293. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6294. {
  6295. SemiCheckEntity productionData = new SemiCheckEntity();
  6296. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6297. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6298. {
  6299. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6300. }
  6301. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6302. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6303. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6304. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6305. productionData.ReFine = 0;
  6306. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6307. {
  6308. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6309. }
  6310. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6311. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6312. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6313. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6314. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6315. {
  6316. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6317. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6318. }
  6319. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6320. {
  6321. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6322. }
  6323. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6324. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6325. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6326. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6327. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6328. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6329. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6330. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6331. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6332. {
  6333. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6334. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6335. }
  6336. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6337. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6338. {
  6339. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6340. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6341. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6342. }
  6343. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6344. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6345. {
  6346. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6347. }
  6348. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6349. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6350. DataTable dtDefect = dvDefect.ToTable();
  6351. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6352. {
  6353. // 产品缺陷
  6354. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6355. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6356. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6357. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6358. //{
  6359. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6360. //}
  6361. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6362. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6363. {
  6364. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6365. }
  6366. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6367. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6368. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6369. {
  6370. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6371. }
  6372. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6373. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6374. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6375. {
  6376. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6377. }
  6378. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6379. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6380. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6381. {
  6382. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6383. }
  6384. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6385. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6386. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6387. //{
  6388. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6389. //}
  6390. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6391. //{
  6392. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6393. //}
  6394. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6395. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6396. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6397. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6398. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6399. {
  6400. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6401. }
  6402. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6403. {
  6404. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6405. }
  6406. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6407. //{
  6408. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6409. //}
  6410. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6411. //--------责任员工-------------------
  6412. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6413. if (drRow.Length > Constant.INT_IS_ZERO)
  6414. {
  6415. if (defect.DefectResponsibles == null)
  6416. {
  6417. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6418. }
  6419. foreach (DataRow r in drRow)
  6420. {
  6421. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6422. if (r["SemiCheckDefectID"].ToString() != "")
  6423. {
  6424. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6425. }
  6426. if (r["StaffID"].ToString() != "")
  6427. {
  6428. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6429. }
  6430. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6431. defectResponsible.StaffName = r["StaffName"].ToString();
  6432. if (r["StaffStatus"].ToString() != "")
  6433. {
  6434. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6435. }
  6436. if (r["UJobsID"].ToString() != "")
  6437. {
  6438. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6439. }
  6440. if (r["SJobsID"].ToString() != "")
  6441. {
  6442. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6443. }
  6444. defect.DefectResponsibles.Add(defectResponsible);
  6445. }
  6446. }
  6447. //------------------------------
  6448. if (productionData.SemiCheckDefects == null)
  6449. {
  6450. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6451. }
  6452. productionData.SemiCheckDefects.Add(defect);
  6453. }
  6454. //if (productionDatas.PDAProductionData == null)
  6455. //{
  6456. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6457. //}
  6458. productionDatas[0] = productionData;
  6459. //---------------------------------------------------------------------------------
  6460. }
  6461. }
  6462. }
  6463. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6464. actionResult.Status = (int)Constant.PDAResult.Success;
  6465. }
  6466. catch (Exception ex)
  6467. {
  6468. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6469. OutputLog.TraceLog(LogPriority.Error,
  6470. this.ToString(),
  6471. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6472. ex.ToString(),
  6473. LocalPath.LogExePath);
  6474. actionResult.Status = (int)Constant.PDAResult.Exception;
  6475. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6476. }
  6477. return actionResult;
  6478. }
  6479. /// <summary>
  6480. /// 保存半检登记
  6481. /// </summary>
  6482. /// <param name="accountCode">帐套code</param>
  6483. /// <param name="userCode">用户code</param>
  6484. /// <param name="userPassword">用户密码</param>
  6485. /// <param name="sessionKey">本次登陆密钥</param>
  6486. /// <param name="entity">半检实体类</param>
  6487. /// <param name="sUserInfo">用户基本信息</param>
  6488. /// <returns></returns>
  6489. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6490. {
  6491. ActionResult actionResult = new ActionResult();
  6492. try
  6493. {
  6494. // 验证请求头信息
  6495. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6496. // 验证失败
  6497. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6498. {
  6499. return actionResult;
  6500. }
  6501. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6502. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6503. string err = string.Empty;
  6504. err = resultEntity.Message;
  6505. if (err == null)
  6506. {
  6507. err = "";
  6508. }
  6509. SemiCheckEntity entity = entityobj[0];
  6510. if (entity.SemiCheckCategory == 1) // 半检登记
  6511. {
  6512. }
  6513. else if (entity.SemiCheckCategory == 2)// 复检登记
  6514. {
  6515. err = JsonHelper.ToJson(err);
  6516. }
  6517. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6518. {
  6519. err = JsonHelper.ToJson(err);
  6520. }
  6521. //actionResult.Result = JsonHelper.ToJson(err);
  6522. actionResult.Result = err;//JsonHelper.ToJson(err);
  6523. actionResult.Status = (int)Constant.PDAResult.Success;
  6524. }
  6525. catch (Exception ex)
  6526. {
  6527. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6528. OutputLog.TraceLog(LogPriority.Error,
  6529. this.ToString(),
  6530. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6531. ex.ToString(),
  6532. LocalPath.LogExePath);
  6533. actionResult.Status = (int)Constant.PDAResult.Exception;
  6534. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6535. }
  6536. return actionResult;
  6537. }
  6538. /// <summary>
  6539. /// 根据所选工号,查出缺陷责任员工
  6540. /// </summary>
  6541. /// <param name="sUserInfo"></param>
  6542. /// <returns></returns>
  6543. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6544. {
  6545. ActionResult actionResult = new ActionResult();
  6546. try
  6547. {
  6548. // 验证请求头信息
  6549. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6550. // 验证失败
  6551. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6552. {
  6553. return actionResult;
  6554. }
  6555. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6556. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  6557. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6558. actionResult.Status = (int)Constant.PDAResult.Success;
  6559. }
  6560. catch (Exception ex)
  6561. {
  6562. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6563. OutputLog.TraceLog(LogPriority.Error,
  6564. this.ToString(),
  6565. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6566. ex.ToString(),
  6567. LocalPath.LogExePath);
  6568. actionResult.Status = (int)Constant.PDAResult.Exception;
  6569. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6570. }
  6571. return actionResult;
  6572. }
  6573. /// <summary>
  6574. /// 获取半成品缺陷管理的全部数据
  6575. /// </summary>
  6576. /// <param name="sUserInfo"></param>
  6577. /// <returns></returns>
  6578. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  6579. {
  6580. ActionResult actionResult = new ActionResult();
  6581. try
  6582. {
  6583. // 验证请求头信息
  6584. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6585. // 验证失败
  6586. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6587. {
  6588. return actionResult;
  6589. }
  6590. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6591. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  6592. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6593. actionResult.Status = (int)Constant.PDAResult.Success;
  6594. }
  6595. catch (Exception ex)
  6596. {
  6597. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6598. OutputLog.TraceLog(LogPriority.Error,
  6599. this.ToString(),
  6600. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6601. ex.ToString(),
  6602. LocalPath.LogExePath);
  6603. actionResult.Status = (int)Constant.PDAResult.Exception;
  6604. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6605. }
  6606. return actionResult;
  6607. }
  6608. /// <summary>
  6609. /// 获取半成品缺陷位置管理的全部数据
  6610. /// </summary>
  6611. /// <param name="sUserInfo"></param>
  6612. /// <returns></returns>
  6613. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  6614. {
  6615. ActionResult actionResult = new ActionResult();
  6616. try
  6617. {
  6618. // 验证请求头信息
  6619. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6620. // 验证失败
  6621. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6622. {
  6623. return actionResult;
  6624. }
  6625. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6626. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  6627. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6628. actionResult.Status = (int)Constant.PDAResult.Success;
  6629. }
  6630. catch (Exception ex)
  6631. {
  6632. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6633. OutputLog.TraceLog(LogPriority.Error,
  6634. this.ToString(),
  6635. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6636. ex.ToString(),
  6637. LocalPath.LogExePath);
  6638. actionResult.Status = (int)Constant.PDAResult.Exception;
  6639. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6640. }
  6641. return actionResult;
  6642. }
  6643. /// <summary>
  6644. /// 复检验条码
  6645. /// </summary>
  6646. /// <param name="sUserInfo"></param>
  6647. /// <returns></returns>
  6648. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6649. {
  6650. ActionResult actionResult = new ActionResult();
  6651. try
  6652. {
  6653. // 验证请求头信息
  6654. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6655. // 验证失败
  6656. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6657. {
  6658. return actionResult;
  6659. }
  6660. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6661. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  6662. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6663. if (Convert.ToInt32(resultEntity.Result) < 0)
  6664. {
  6665. actionResult.Status = (int)Constant.PDAResult.Fail;
  6666. }
  6667. else
  6668. {
  6669. actionResult.Status = (int)Constant.PDAResult.Success;
  6670. }
  6671. actionResult.Message = resultEntity.Message;
  6672. }
  6673. catch (Exception ex)
  6674. {
  6675. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6676. OutputLog.TraceLog(LogPriority.Error,
  6677. this.ToString(),
  6678. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6679. ex.ToString(),
  6680. LocalPath.LogExePath);
  6681. actionResult.Status = (int)Constant.PDAResult.Exception;
  6682. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6683. }
  6684. return actionResult;
  6685. }
  6686. /// <summary>
  6687. /// 撤销复检验条码
  6688. /// </summary>
  6689. /// <param name="sUserInfo"></param>
  6690. /// <returns></returns>
  6691. public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6692. {
  6693. ActionResult actionResult = new ActionResult();
  6694. try
  6695. {
  6696. // 验证请求头信息
  6697. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6698. // 验证失败
  6699. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6700. {
  6701. return actionResult;
  6702. }
  6703. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6704. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  6705. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6706. if (Convert.ToInt32(resultEntity.Result) < 0)
  6707. {
  6708. actionResult.Status = (int)Constant.PDAResult.Fail;
  6709. }
  6710. else
  6711. {
  6712. actionResult.Status = (int)Constant.PDAResult.Success;
  6713. }
  6714. actionResult.Message = resultEntity.Message;
  6715. }
  6716. catch (Exception ex)
  6717. {
  6718. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6719. OutputLog.TraceLog(LogPriority.Error,
  6720. this.ToString(),
  6721. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6722. ex.ToString(),
  6723. LocalPath.LogExePath);
  6724. actionResult.Status = (int)Constant.PDAResult.Exception;
  6725. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6726. }
  6727. return actionResult;
  6728. }
  6729. /// <summary>
  6730. /// 恢复数据
  6731. /// </summary>
  6732. /// <param name="sUserInfo"></param>
  6733. /// <returns></returns>
  6734. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6735. {
  6736. ActionResult actionResult = new ActionResult();
  6737. try
  6738. {
  6739. // 验证请求头信息
  6740. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6741. // 验证失败
  6742. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6743. {
  6744. return actionResult;
  6745. }
  6746. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6747. () => PMModuleLogicDAL.ResetBarCode(barcode));
  6748. if (resultEntity > 0)
  6749. {
  6750. actionResult.Status = (int)Constant.PDAResult.Success;
  6751. actionResult.Message = "恢复数据成功";
  6752. }
  6753. else
  6754. {
  6755. actionResult.Status = (int)Constant.PDAResult.Fail;
  6756. if (resultEntity == -1)
  6757. {
  6758. actionResult.Message = "此条码没有清除,不能恢复";
  6759. }
  6760. else if (resultEntity == 0)
  6761. {
  6762. actionResult.Message = "没有可恢复的数据";
  6763. }
  6764. }
  6765. }
  6766. catch (Exception ex)
  6767. {
  6768. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6769. OutputLog.TraceLog(LogPriority.Error,
  6770. this.ToString(),
  6771. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6772. ex.ToString(),
  6773. LocalPath.LogExePath);
  6774. actionResult.Status = (int)Constant.PDAResult.Exception;
  6775. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6776. }
  6777. return actionResult;
  6778. }
  6779. /// <summary>
  6780. /// 通过SettingCode获取系统参数管理的数据
  6781. /// </summary>
  6782. /// <param name="accountCode"></param>
  6783. /// <param name="userCode"></param>
  6784. /// <param name="userPassword"></param>
  6785. /// <param name="sessionKey"></param>
  6786. /// <param name="settingcode">设置编码</param>
  6787. /// <returns></returns>
  6788. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  6789. {
  6790. ActionResult actionResult = new ActionResult();
  6791. try
  6792. {
  6793. // 验证请求头信息
  6794. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6795. // 验证失败
  6796. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6797. {
  6798. return actionResult;
  6799. }
  6800. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6801. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  6802. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6803. actionResult.Status = (int)Constant.PDAResult.Success;
  6804. }
  6805. catch (Exception ex)
  6806. {
  6807. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6808. OutputLog.TraceLog(LogPriority.Error,
  6809. this.ToString(),
  6810. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6811. ex.ToString(),
  6812. LocalPath.LogExePath);
  6813. actionResult.Status = (int)Constant.PDAResult.Exception;
  6814. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6815. }
  6816. return actionResult;
  6817. }
  6818. /// <summary>
  6819. /// 校验条码是否允许撤销,如果不允许提示错误消息
  6820. /// </summary>
  6821. /// <param name="accountCode"></param>
  6822. /// <param name="userCode"></param>
  6823. /// <param name="userPassword"></param>
  6824. /// <param name="sessionKey"></param>
  6825. /// <param name="orgTime">原时间</param>
  6826. /// <param name="days">允许撤销天数</param>
  6827. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  6828. /// <returns></returns>
  6829. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  6830. {
  6831. ActionResult actionResult = new ActionResult();
  6832. try
  6833. {
  6834. // 验证请求头信息
  6835. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6836. // 验证失败
  6837. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6838. {
  6839. return actionResult;
  6840. }
  6841. string[] subOrgTime = orgTime.Split('-');
  6842. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  6843. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6844. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  6845. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6846. if (Convert.ToInt32(resultEntity.Result) < 0)
  6847. {
  6848. actionResult.Status = (int)Constant.PDAResult.Fail;
  6849. }
  6850. else
  6851. {
  6852. actionResult.Status = (int)Constant.PDAResult.Success;
  6853. }
  6854. actionResult.Message = resultEntity.Message;
  6855. }
  6856. catch (Exception ex)
  6857. {
  6858. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6859. OutputLog.TraceLog(LogPriority.Error,
  6860. this.ToString(),
  6861. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6862. ex.ToString(),
  6863. LocalPath.LogExePath);
  6864. actionResult.Status = (int)Constant.PDAResult.Exception;
  6865. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6866. }
  6867. return actionResult;
  6868. }
  6869. /// <summary>
  6870. /// 获取生产订单管理的全部数据
  6871. /// </summary>
  6872. /// <param name="sUserInfo"></param>
  6873. /// <returns></returns>
  6874. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  6875. {
  6876. ActionResult actionResult = new ActionResult();
  6877. try
  6878. {
  6879. // 验证请求头信息
  6880. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6881. // 验证失败
  6882. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6883. {
  6884. return actionResult;
  6885. }
  6886. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6887. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  6888. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6889. actionResult.Status = (int)Constant.PDAResult.Success;
  6890. }
  6891. catch (Exception ex)
  6892. {
  6893. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6894. OutputLog.TraceLog(LogPriority.Error,
  6895. this.ToString(),
  6896. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6897. ex.ToString(),
  6898. LocalPath.LogExePath);
  6899. actionResult.Status = (int)Constant.PDAResult.Exception;
  6900. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6901. }
  6902. return actionResult;
  6903. }
  6904. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6905. {
  6906. ActionResult actionResult = new ActionResult();
  6907. try
  6908. {
  6909. // 验证请求头信息
  6910. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6911. // 验证失败
  6912. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6913. {
  6914. return actionResult;
  6915. }
  6916. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6917. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  6918. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6919. if (Convert.ToInt32(resultEntity.Result) < 0)
  6920. {
  6921. actionResult.Status = (int)Constant.PDAResult.Fail;
  6922. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  6923. }
  6924. else
  6925. {
  6926. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  6927. actionResult.Status = (int)Constant.PDAResult.Success;
  6928. }
  6929. actionResult.Message = resultEntity.Message;
  6930. }
  6931. catch (Exception ex)
  6932. {
  6933. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6934. OutputLog.TraceLog(LogPriority.Error,
  6935. this.ToString(),
  6936. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6937. ex.ToString(),
  6938. LocalPath.LogExePath);
  6939. actionResult.Status = (int)Constant.PDAResult.Exception;
  6940. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6941. }
  6942. return actionResult;
  6943. }
  6944. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  6945. {
  6946. ActionResult actionResult = new ActionResult();
  6947. try
  6948. {
  6949. // 验证请求头信息
  6950. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6951. // 验证失败
  6952. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6953. {
  6954. return actionResult;
  6955. }
  6956. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6957. () => SystemModuleLogic.GetSystemData(sUserInfo));
  6958. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6959. actionResult.Status = (int)Constant.PDAResult.Success;
  6960. }
  6961. catch (Exception ex)
  6962. {
  6963. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6964. OutputLog.TraceLog(LogPriority.Error,
  6965. this.ToString(),
  6966. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6967. ex.ToString(),
  6968. LocalPath.LogExePath);
  6969. actionResult.Status = (int)Constant.PDAResult.Exception;
  6970. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6971. }
  6972. return actionResult;
  6973. }
  6974. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  6975. {
  6976. ActionResult actionResult = new ActionResult();
  6977. try
  6978. {
  6979. // 验证请求头信息
  6980. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6981. // 验证失败
  6982. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6983. {
  6984. return actionResult;
  6985. }
  6986. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  6987. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6988. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  6989. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6990. if (Convert.ToInt32(resultEntity.Result) < 0)
  6991. {
  6992. actionResult.Status = (int)Constant.PDAResult.Fail;
  6993. }
  6994. else
  6995. {
  6996. actionResult.Status = (int)Constant.PDAResult.Success;
  6997. }
  6998. actionResult.Message = resultEntity.Message;
  6999. }
  7000. catch (Exception ex)
  7001. {
  7002. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7003. OutputLog.TraceLog(LogPriority.Error,
  7004. this.ToString(),
  7005. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7006. ex.ToString(),
  7007. LocalPath.LogExePath);
  7008. actionResult.Status = (int)Constant.PDAResult.Exception;
  7009. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7010. }
  7011. return actionResult;
  7012. }
  7013. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7014. {
  7015. ActionResult actionResult = new ActionResult();
  7016. try
  7017. {
  7018. // 验证请求头信息
  7019. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7020. // 验证失败
  7021. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7022. {
  7023. return actionResult;
  7024. }
  7025. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7026. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7027. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7028. if (Convert.ToInt32(resultEntity.Result) < 0)
  7029. {
  7030. actionResult.Status = (int)Constant.PDAResult.Fail;
  7031. }
  7032. else
  7033. {
  7034. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7035. actionResult.Status = (int)Constant.PDAResult.Success;
  7036. }
  7037. actionResult.Message = resultEntity.Message;
  7038. }
  7039. catch (Exception ex)
  7040. {
  7041. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7042. OutputLog.TraceLog(LogPriority.Error,
  7043. this.ToString(),
  7044. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7045. ex.ToString(),
  7046. LocalPath.LogExePath);
  7047. actionResult.Status = (int)Constant.PDAResult.Exception;
  7048. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7049. }
  7050. return actionResult;
  7051. }
  7052. public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7053. {
  7054. ActionResult actionResult = new ActionResult();
  7055. try
  7056. {
  7057. // 验证请求头信息
  7058. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7059. // 验证失败
  7060. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7061. {
  7062. return actionResult;
  7063. }
  7064. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7065. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7066. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7067. if (Convert.ToInt32(resultEntity.Result) < 0)
  7068. {
  7069. actionResult.Status = (int)Constant.PDAResult.Fail;
  7070. }
  7071. else
  7072. {
  7073. actionResult.Status = (int)Constant.PDAResult.Success;
  7074. }
  7075. actionResult.Message = resultEntity.Message;
  7076. }
  7077. catch (Exception ex)
  7078. {
  7079. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7080. OutputLog.TraceLog(LogPriority.Error,
  7081. this.ToString(),
  7082. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7083. ex.ToString(),
  7084. LocalPath.LogExePath);
  7085. actionResult.Status = (int)Constant.PDAResult.Exception;
  7086. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7087. }
  7088. return actionResult;
  7089. }
  7090. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7091. {
  7092. ActionResult actionResult = new ActionResult();
  7093. try
  7094. {
  7095. // 验证请求头信息
  7096. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7097. // 验证失败
  7098. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7099. {
  7100. return actionResult;
  7101. }
  7102. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7103. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7104. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7105. if (Convert.ToInt32(resultEntity.Result) < 0)
  7106. {
  7107. actionResult.Status = (int)Constant.PDAResult.Fail;
  7108. }
  7109. else
  7110. {
  7111. actionResult.Status = (int)Constant.PDAResult.Success;
  7112. }
  7113. actionResult.Message = resultEntity.Message;
  7114. }
  7115. catch (Exception ex)
  7116. {
  7117. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7118. OutputLog.TraceLog(LogPriority.Error,
  7119. this.ToString(),
  7120. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7121. ex.ToString(),
  7122. LocalPath.LogExePath);
  7123. actionResult.Status = (int)Constant.PDAResult.Exception;
  7124. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7125. }
  7126. return actionResult;
  7127. }
  7128. #region PDA条码打印
  7129. /// <summary>
  7130. /// 获取条码打印机
  7131. /// </summary>
  7132. /// <param name="accountCode"></param>
  7133. /// <param name="userCode"></param>
  7134. /// <param name="userPassword"></param>
  7135. /// <param name="sessionKey"></param>
  7136. /// <returns></returns>
  7137. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey)
  7138. {
  7139. ActionResult actionResult = new ActionResult();
  7140. try
  7141. {
  7142. // 验证请求头信息
  7143. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7144. // 验证失败
  7145. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7146. {
  7147. return actionResult;
  7148. }
  7149. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo);
  7150. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7151. actionResult.Status = (int)Constant.PDAResult.Success;
  7152. }
  7153. catch (Exception ex)
  7154. {
  7155. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7156. OutputLog.TraceLog(LogPriority.Error,
  7157. this.ToString(),
  7158. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7159. ex.ToString(),
  7160. LocalPath.LogExePath);
  7161. actionResult.Status = (int)Constant.PDAResult.Exception;
  7162. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7163. }
  7164. return actionResult;
  7165. }
  7166. /// <summary>
  7167. /// 打印条码样式
  7168. /// </summary>
  7169. /// <param name="accountCode"></param>
  7170. /// <param name="userCode"></param>
  7171. /// <param name="userPassword"></param>
  7172. /// <param name="sessionKey"></param>
  7173. /// <returns></returns>
  7174. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey
  7175. , string barcode, int copies, int printerID)
  7176. {
  7177. ActionResult actionResult = new ActionResult();
  7178. try
  7179. {
  7180. // 验证请求头信息
  7181. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7182. // 验证失败
  7183. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7184. {
  7185. return actionResult;
  7186. }
  7187. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7188. copies, printerID, sUserInfo);
  7189. if (sre.Status != Constant.ServiceResultStatus.Success)
  7190. {
  7191. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7192. actionResult.Message = sre.Message;
  7193. return actionResult;
  7194. }
  7195. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7196. actionResult.Status = (int)Constant.PDAResult.Success;
  7197. }
  7198. catch (Exception ex)
  7199. {
  7200. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7201. OutputLog.TraceLog(LogPriority.Error,
  7202. this.ToString(),
  7203. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7204. ex.ToString(),
  7205. LocalPath.LogExePath);
  7206. actionResult.Status = (int)Constant.PDAResult.Exception;
  7207. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7208. }
  7209. return actionResult;
  7210. }
  7211. #endregion PDA条码打印
  7212. #region 统计报表
  7213. /// <summary>
  7214. /// 成型结算报表
  7215. /// </summary>
  7216. /// <param name="accountCode"></param>
  7217. /// <param name="userCode"></param>
  7218. /// <param name="userPassword"></param>
  7219. /// <param name="sessionKey"></param>
  7220. /// <returns></returns>
  7221. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7222. int currentMonth)
  7223. {
  7224. ActionResult actionResult = new ActionResult();
  7225. try
  7226. {
  7227. // 验证请求头信息
  7228. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7229. // 验证失败
  7230. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7231. {
  7232. return actionResult;
  7233. }
  7234. DateTime date = DateTime.Now;
  7235. if (currentMonth != 1)
  7236. {
  7237. date = date.AddMonths(-1);
  7238. }
  7239. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7240. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7241. if (resultEntity == null || resultEntity.Data == null)
  7242. {
  7243. actionResult.Status = (int)Constant.PDAResult.Fail;
  7244. actionResult.Message = "查询失败";
  7245. return actionResult;
  7246. }
  7247. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7248. {
  7249. actionResult.Status = (int)Constant.PDAResult.Fail;
  7250. actionResult.Message = resultEntity.Message;
  7251. return actionResult;
  7252. }
  7253. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7254. actionResult.Status = (int)Constant.PDAResult.Success;
  7255. }
  7256. catch (Exception ex)
  7257. {
  7258. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7259. OutputLog.TraceLog(LogPriority.Error,
  7260. this.ToString(),
  7261. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7262. ex.ToString(),
  7263. LocalPath.LogExePath);
  7264. actionResult.Status = (int)Constant.PDAResult.Exception;
  7265. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7266. }
  7267. return actionResult;
  7268. }
  7269. #endregion
  7270. #region 设置当期用户默认打印机配置
  7271. /// <summary>
  7272. /// 设置当期用户默认打印机配置
  7273. /// </summary>
  7274. /// <param name="accountCode"></param>
  7275. /// <param name="userCode"></param>
  7276. /// <param name="userPassword"></param>
  7277. /// <param name="sessionKey"></param>
  7278. /// <param name="printerID"></param>
  7279. /// <returns></returns>
  7280. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7281. int printerID)
  7282. {
  7283. ActionResult actionResult = new ActionResult();
  7284. try
  7285. {
  7286. // 验证请求头信息
  7287. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7288. // 验证失败
  7289. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7290. {
  7291. return actionResult;
  7292. }
  7293. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7294. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7295. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7296. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7297. {
  7298. actionResult.Status = (int)Constant.PDAResult.Fail;
  7299. }
  7300. else
  7301. {
  7302. actionResult.Status = (int)Constant.PDAResult.Success;
  7303. }
  7304. actionResult.Message = resultEntity.Message;
  7305. }
  7306. catch (Exception ex)
  7307. {
  7308. OutputLog.TraceLog(LogPriority.Error,
  7309. this.ToString(),
  7310. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7311. ex.ToString(),
  7312. LocalPath.LogExePath);
  7313. actionResult.Status = (int)Constant.PDAResult.Exception;
  7314. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7315. }
  7316. return actionResult;
  7317. }
  7318. /// <summary>
  7319. /// 校验产品条码是否可以进行回收
  7320. /// </summary>
  7321. /// <param name="accountCode">帐套code</param>
  7322. /// <param name="userCode">用户code</param>
  7323. /// <param name="userPassword">用户密码</param>
  7324. /// <param name="sessionKey">本次登陆密钥</param>
  7325. /// <param name="procedureID">工序ID</param>
  7326. /// <param name="barcode">条码</param>
  7327. /// <returns></returns>
  7328. /// <remarks>
  7329. /// 王鑫 2017.7.21 新建
  7330. /// </remarks>
  7331. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7332. {
  7333. ActionResult actionResult = new ActionResult();
  7334. try
  7335. {
  7336. // 验证请求头信息
  7337. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7338. // 验证失败
  7339. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7340. {
  7341. return actionResult;
  7342. }
  7343. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7344. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7345. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7346. {
  7347. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7348. actionResult.Status = (int)Constant.PDAResult.Success;
  7349. }
  7350. else
  7351. {
  7352. actionResult.Status = (int)Constant.PDAResult.Fail;
  7353. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7354. }
  7355. }
  7356. catch (Exception ex)
  7357. {
  7358. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7359. OutputLog.TraceLog(LogPriority.Error,
  7360. this.ToString(),
  7361. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7362. ex.ToString(),
  7363. LocalPath.LogExePath);
  7364. actionResult.Status = (int)Constant.PDAResult.Exception;
  7365. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7366. }
  7367. return actionResult;
  7368. }
  7369. /// <summary>
  7370. /// 获取回收标识
  7371. /// </summary>
  7372. /// <param name="accountCode"></param>
  7373. /// <param name="userCode"></param>
  7374. /// <param name="userPassword"></param>
  7375. /// <param name="sessionKey"></param>
  7376. /// <param name="usercode">工号编码</param>
  7377. /// <returns></returns>
  7378. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7379. {
  7380. ActionResult actionResult = new ActionResult();
  7381. try
  7382. {
  7383. // 验证请求头信息
  7384. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7385. // 验证失败
  7386. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7387. {
  7388. return actionResult;
  7389. }
  7390. int returnValue = ServiceInvoker.Invoke<int>(this,
  7391. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7392. actionResult.Result = JsonHelper.ToJson(returnValue);
  7393. actionResult.Status = (int)Constant.PDAResult.Success;
  7394. }
  7395. catch (Exception ex)
  7396. {
  7397. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7398. OutputLog.TraceLog(LogPriority.Error,
  7399. this.ToString(),
  7400. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7401. ex.ToString(),
  7402. LocalPath.LogExePath);
  7403. actionResult.Status = (int)Constant.PDAResult.Exception;
  7404. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7405. }
  7406. return actionResult;
  7407. }
  7408. #endregion
  7409. #region 注浆盘点
  7410. /// <summary>
  7411. /// 获取注浆盘点单列表
  7412. /// </summary>
  7413. /// <param name="sUserInfo"></param>
  7414. /// <returns></returns>
  7415. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7416. {
  7417. ActionResult actionResult = new ActionResult();
  7418. try
  7419. {
  7420. // 验证请求头信息
  7421. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7422. // 验证失败
  7423. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7424. {
  7425. return actionResult;
  7426. }
  7427. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7428. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7429. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7430. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7431. actionResult.Result = JsonHelper.ToJson(ds);
  7432. actionResult.Status = (int)Constant.PDAResult.Success;
  7433. }
  7434. catch (Exception ex)
  7435. {
  7436. string json = JsonHelper.ToJson(entity);
  7437. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7438. OutputLog.TraceLog(LogPriority.Error,
  7439. this.ToString(),
  7440. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7441. ex.ToString(),
  7442. LocalPath.LogExePath);
  7443. actionResult.Status = (int)Constant.PDAResult.Exception;
  7444. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7445. }
  7446. return actionResult;
  7447. }
  7448. /// <summary>
  7449. /// 进行盘点操作
  7450. /// </summary>
  7451. /// <param name="accountCode"></param>
  7452. /// <param name="userCode"></param>
  7453. /// <param name="userPassword"></param>
  7454. /// <param name="sessionKey"></param>
  7455. /// <param name="InCheckedID">盘点单ID</param>
  7456. /// <param name="BarCode">产品条码</param>
  7457. /// <returns></returns>
  7458. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7459. {
  7460. ActionResult actionResult = new ActionResult();
  7461. try
  7462. {
  7463. // 验证请求头信息
  7464. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7465. // 验证失败
  7466. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7467. {
  7468. return actionResult;
  7469. }
  7470. ClientRequestEntity cre = new ClientRequestEntity();
  7471. cre.Properties["CheckedID"] = CheckedID;
  7472. cre.Properties["Barcode"] = BarCode;
  7473. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7474. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7475. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7476. {
  7477. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7478. actionResult.Status = (int)Constant.PDAResult.Success;
  7479. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7480. }
  7481. else
  7482. {
  7483. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7484. actionResult.Status = (int)Constant.PDAResult.Fail;
  7485. actionResult.Message = returnValue.Message;
  7486. }
  7487. }
  7488. catch (Exception ex)
  7489. {
  7490. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7491. OutputLog.TraceLog(LogPriority.Error,
  7492. this.ToString(),
  7493. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7494. ex.ToString(),
  7495. LocalPath.LogExePath);
  7496. actionResult.Status = (int)Constant.PDAResult.Exception;
  7497. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7498. }
  7499. return actionResult;
  7500. }
  7501. /// <summary>
  7502. /// 获取盘点单明细
  7503. /// </summary>
  7504. /// <param name="sUserInfo"></param>
  7505. /// <returns></returns>
  7506. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7507. {
  7508. ActionResult actionResult = new ActionResult();
  7509. try
  7510. {
  7511. // 验证请求头信息
  7512. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7513. // 验证失败
  7514. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7515. {
  7516. return actionResult;
  7517. }
  7518. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7519. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  7520. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  7521. actionResult.Result = JsonHelper.ToJson(ds);
  7522. actionResult.Status = (int)Constant.PDAResult.Success;
  7523. }
  7524. catch (Exception ex)
  7525. {
  7526. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7527. OutputLog.TraceLog(LogPriority.Error,
  7528. this.ToString(),
  7529. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7530. ex.ToString(),
  7531. LocalPath.LogExePath);
  7532. actionResult.Status = (int)Constant.PDAResult.Exception;
  7533. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7534. }
  7535. return actionResult;
  7536. }
  7537. #endregion
  7538. #region 模具盘点
  7539. /// <summary>
  7540. /// 获取模具盘点单列表
  7541. /// </summary>
  7542. /// <param name="sUserInfo"></param>
  7543. /// <returns></returns>
  7544. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7545. {
  7546. ActionResult actionResult = new ActionResult();
  7547. try
  7548. {
  7549. // 验证请求头信息
  7550. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7551. // 验证失败
  7552. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7553. {
  7554. return actionResult;
  7555. }
  7556. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7557. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7558. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7559. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  7560. actionResult.Result = JsonHelper.ToJson(ds);
  7561. actionResult.Status = (int)Constant.PDAResult.Success;
  7562. }
  7563. catch (Exception ex)
  7564. {
  7565. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7566. OutputLog.TraceLog(LogPriority.Error,
  7567. this.ToString(),
  7568. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7569. ex.ToString(),
  7570. LocalPath.LogExePath);
  7571. actionResult.Status = (int)Constant.PDAResult.Exception;
  7572. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7573. }
  7574. return actionResult;
  7575. }
  7576. /// <summary>
  7577. /// 进行盘点操作
  7578. /// </summary>
  7579. /// <param name="accountCode"></param>
  7580. /// <param name="userCode"></param>
  7581. /// <param name="userPassword"></param>
  7582. /// <param name="sessionKey"></param>
  7583. /// <param name="InCheckedID">盘点单ID</param>
  7584. /// <param name="BarCode">产品条码</param>
  7585. /// <returns></returns>
  7586. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7587. {
  7588. ActionResult actionResult = new ActionResult();
  7589. try
  7590. {
  7591. // 验证请求头信息
  7592. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7593. // 验证失败
  7594. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7595. {
  7596. return actionResult;
  7597. }
  7598. ClientRequestEntity cre = new ClientRequestEntity();
  7599. cre.Properties["CheckedID"] = CheckedID;
  7600. cre.Properties["Barcode"] = BarCode;
  7601. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7602. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  7603. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7604. {
  7605. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7606. actionResult.Status = (int)Constant.PDAResult.Success;
  7607. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7608. }
  7609. else
  7610. {
  7611. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7612. actionResult.Status = (int)Constant.PDAResult.Fail;
  7613. actionResult.Message = returnValue.Message;
  7614. }
  7615. }
  7616. catch (Exception ex)
  7617. {
  7618. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7619. OutputLog.TraceLog(LogPriority.Error,
  7620. this.ToString(),
  7621. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7622. ex.ToString(),
  7623. LocalPath.LogExePath);
  7624. actionResult.Status = (int)Constant.PDAResult.Exception;
  7625. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7626. }
  7627. return actionResult;
  7628. }
  7629. /// <summary>
  7630. /// 获取盘点单明细
  7631. /// </summary>
  7632. /// <param name="sUserInfo"></param>
  7633. /// <returns></returns>
  7634. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7635. {
  7636. ActionResult actionResult = new ActionResult();
  7637. try
  7638. {
  7639. // 验证请求头信息
  7640. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7641. // 验证失败
  7642. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7643. {
  7644. return actionResult;
  7645. }
  7646. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7647. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  7648. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  7649. actionResult.Result = JsonHelper.ToJson(ds);
  7650. actionResult.Status = (int)Constant.PDAResult.Success;
  7651. }
  7652. catch (Exception ex)
  7653. {
  7654. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7655. OutputLog.TraceLog(LogPriority.Error,
  7656. this.ToString(),
  7657. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7658. ex.ToString(),
  7659. LocalPath.LogExePath);
  7660. actionResult.Status = (int)Constant.PDAResult.Exception;
  7661. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7662. }
  7663. return actionResult;
  7664. }
  7665. #endregion
  7666. #region 通用接口
  7667. /// <summary>
  7668. /// PDA调用通用接口
  7669. /// </summary>
  7670. /// <param name="accountCode"></param>
  7671. /// <param name="userCode"></param>
  7672. /// <param name="userPassword"></param>
  7673. /// <param name="sessionKey"></param>
  7674. /// <param name="module"></param>
  7675. /// <param name="action"></param>
  7676. /// <param name="data"></param>
  7677. /// <returns></returns>
  7678. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  7679. string module, string action, string jsonData)
  7680. {
  7681. ActionResult actionResult = null;
  7682. try
  7683. {
  7684. // 验证请求头信息
  7685. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7686. // 验证失败
  7687. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7688. {
  7689. return actionResult;
  7690. }
  7691. actionResult.Status = (int)Constant.PDAResult.Fail;
  7692. Dictionary<string, object> data = null;
  7693. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  7694. {
  7695. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  7696. }
  7697. #region PDA报表
  7698. if (module == "Report")
  7699. {
  7700. // 成型月度结算
  7701. if (action == "GetGroutingSettlementInfo")
  7702. {
  7703. DateTime month = DateTime.Now;
  7704. month = new DateTime(month.Year, month.Month, 1);
  7705. //month = new DateTime(2017, 6, 1);
  7706. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7707. if (currentMonth != 1)
  7708. {
  7709. month = month.AddMonths(-1);
  7710. }
  7711. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  7712. if (sre.Status == Constant.ServiceResultStatus.Success)
  7713. {
  7714. actionResult.Status = (int)Constant.PDAResult.Success;
  7715. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7716. }
  7717. else
  7718. {
  7719. actionResult.Status = (int)Constant.PDAResult.Fail;
  7720. actionResult.Message = sre.Message;
  7721. }
  7722. return actionResult;
  7723. }
  7724. // 成型月度结算-明细
  7725. if (action == "GetGroutingSettlementDetail")
  7726. {
  7727. DateTime month = DateTime.Now;
  7728. month = new DateTime(month.Year, month.Month, 1);
  7729. //month = new DateTime(2017, 6, 1);
  7730. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7731. if (currentMonth != 1)
  7732. {
  7733. month = month.AddMonths(-1);
  7734. }
  7735. string goodsCode = data["GoodsCode"].ToString();
  7736. string detailDate = data["DetailDate"].ToString();
  7737. DateTime? date = null;
  7738. if (detailDate != "合计")
  7739. {
  7740. date = DateTime.Parse(detailDate);
  7741. }
  7742. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  7743. if (sre.Status == Constant.ServiceResultStatus.Success)
  7744. {
  7745. actionResult.Status = (int)Constant.PDAResult.Success;
  7746. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7747. }
  7748. else
  7749. {
  7750. actionResult.Status = (int)Constant.PDAResult.Fail;
  7751. actionResult.Message = sre.Message;
  7752. }
  7753. return actionResult;
  7754. }
  7755. // 产成品交接汇总
  7756. if (action == "GetFinishedProductHandoverSum")
  7757. {
  7758. DateTime date = DateTime.Parse(data["date"].ToString());
  7759. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  7760. data["goodscode"] as string, sUserInfo);
  7761. if (sre.Status == Constant.ServiceResultStatus.Success)
  7762. {
  7763. actionResult.Status = (int)Constant.PDAResult.Success;
  7764. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7765. }
  7766. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  7767. {
  7768. actionResult.Status = (int)Constant.PDAResult.Success;
  7769. }
  7770. else
  7771. {
  7772. actionResult.Status = (int)Constant.PDAResult.Fail;
  7773. actionResult.Message = sre.Message;
  7774. }
  7775. return actionResult;
  7776. }
  7777. //xuwei add 2019-10-21
  7778. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  7779. if (action == "GetSemiReworkDayCount")
  7780. {
  7781. //不指定参数查询当天
  7782. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  7783. //dateStr = "2019-10-17";
  7784. //指定参数查询特定日期
  7785. if(data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  7786. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  7787. if (sre.Status == Constant.ServiceResultStatus.Success)
  7788. {
  7789. actionResult.Status = (int)Constant.PDAResult.Success;
  7790. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7791. }
  7792. else
  7793. {
  7794. actionResult.Status = (int)Constant.PDAResult.Fail;
  7795. actionResult.Message = sre.Message;
  7796. }
  7797. return actionResult;
  7798. }
  7799. //xuwe end
  7800. return actionResult;
  7801. }
  7802. #endregion
  7803. #region 模具管理
  7804. if (module == "PC_Mould")
  7805. {
  7806. #region 模具新建画面数据初始化
  7807. if (action == "GetMouldAddInit")
  7808. {
  7809. ClientRequestEntity cre = new ClientRequestEntity();
  7810. cre.Properties["MouldID"] = 0;
  7811. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  7812. if (sre.Status == Constant.ServiceResultStatus.Success)
  7813. {
  7814. actionResult.Status = (int)Constant.PDAResult.Success;
  7815. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7816. }
  7817. else
  7818. {
  7819. actionResult.Status = (int)Constant.PDAResult.Fail;
  7820. actionResult.Message = sre.Message;
  7821. }
  7822. return actionResult;
  7823. }
  7824. #endregion
  7825. #region 验证模具产品型号
  7826. if (action == "CheckGoodsCodeOnMould")
  7827. {
  7828. ClientRequestEntity cre = new ClientRequestEntity();
  7829. cre.Properties["GoodsCode"] = data["GoodsCode"];
  7830. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  7831. if (sre.Status == Constant.ServiceResultStatus.Success &&
  7832. sre.Data.Tables[0].Rows.Count > 0)
  7833. {
  7834. actionResult.Status = (int)Constant.PDAResult.Success;
  7835. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7836. }
  7837. else
  7838. {
  7839. actionResult.Status = (int)Constant.PDAResult.Fail;
  7840. actionResult.Message = "无效产品型号";
  7841. }
  7842. return actionResult;
  7843. }
  7844. #endregion
  7845. #region 验证模具生产工号
  7846. if (action == "CheckUserCodeOnMould")
  7847. {
  7848. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  7849. if (sre != null && sre.Rows.Count > 0)
  7850. {
  7851. actionResult.Status = (int)Constant.PDAResult.Success;
  7852. actionResult.Result = JsonHelper.ToJson(sre);
  7853. }
  7854. else
  7855. {
  7856. actionResult.Status = (int)Constant.PDAResult.Fail;
  7857. actionResult.Message = "无效生产工号";
  7858. }
  7859. return actionResult;
  7860. }
  7861. #endregion
  7862. #region 新建保存
  7863. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  7864. {
  7865. ClientRequestEntity cre = new ClientRequestEntity();
  7866. foreach (string item in data.Keys)
  7867. {
  7868. if (item == "ProductionDate")
  7869. {
  7870. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  7871. }
  7872. else
  7873. {
  7874. cre.Properties.Add(item, data[item]);
  7875. }
  7876. }
  7877. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  7878. if (sre.Status == Constant.ServiceResultStatus.Success)
  7879. {
  7880. actionResult.Status = (int)Constant.PDAResult.Success;
  7881. }
  7882. else
  7883. {
  7884. actionResult.Status = (int)Constant.PDAResult.Fail;
  7885. actionResult.Result = sre.OtherStatus;
  7886. actionResult.Message = sre.Message;
  7887. }
  7888. return actionResult;
  7889. }
  7890. #endregion
  7891. #region 模具编辑画面数据初始化
  7892. if (action == "GetMouldEditInfo")
  7893. {
  7894. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  7895. if (sre != null && sre.Rows.Count > 0)
  7896. {
  7897. actionResult.Status = (int)Constant.PDAResult.Success;
  7898. actionResult.Result = JsonHelper.ToJson(sre);
  7899. }
  7900. else
  7901. {
  7902. actionResult.Status = (int)Constant.PDAResult.Fail;
  7903. actionResult.Message = "无效模具条码";
  7904. }
  7905. return actionResult;
  7906. }
  7907. #endregion
  7908. #region 模具操作-画面初始化
  7909. if (action == "GetMouldOperationInit")
  7910. {
  7911. ClientRequestEntity cre = new ClientRequestEntity();
  7912. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  7913. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  7914. if (sre.Status == Constant.ServiceResultStatus.Success)
  7915. {
  7916. actionResult.Status = (int)Constant.PDAResult.Success;
  7917. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7918. }
  7919. else
  7920. {
  7921. actionResult.Status = (int)Constant.PDAResult.Fail;
  7922. actionResult.Result = sre.OtherStatus;
  7923. actionResult.Message = sre.Message;
  7924. }
  7925. return actionResult;
  7926. }
  7927. #endregion
  7928. #region 模具操作-验证模具条码
  7929. if (action == "CheckMouldBarcode")
  7930. {
  7931. ClientRequestEntity cre = new ClientRequestEntity();
  7932. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  7933. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  7934. if (sre.Status == Constant.ServiceResultStatus.Success)
  7935. {
  7936. if (sre.Data.Tables[0].Rows.Count == 0)
  7937. {
  7938. actionResult.Status = (int)Constant.PDAResult.Fail;
  7939. actionResult.Result = -1;
  7940. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  7941. return actionResult;
  7942. }
  7943. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  7944. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  7945. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  7946. #region 报损
  7947. if (mouldOperationType == 2)
  7948. {
  7949. if (mouldStatusID == 1 || mouldStatusID == 3)
  7950. {
  7951. actionResult.Status = (int)Constant.PDAResult.Success;
  7952. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7953. }
  7954. else
  7955. {
  7956. actionResult.Status = (int)Constant.PDAResult.Fail;
  7957. actionResult.Result = -2;
  7958. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  7959. }
  7960. return actionResult;
  7961. }
  7962. #endregion
  7963. #region 撤销
  7964. if (mouldOperationType == 3)
  7965. {
  7966. if (mouldStatusID == 4)
  7967. {
  7968. actionResult.Status = (int)Constant.PDAResult.Success;
  7969. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7970. }
  7971. else
  7972. {
  7973. actionResult.Status = (int)Constant.PDAResult.Fail;
  7974. actionResult.Result = -2;
  7975. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  7976. }
  7977. return actionResult;
  7978. }
  7979. #endregion
  7980. #region 领用
  7981. if (mouldOperationType == 4)
  7982. {
  7983. if (mouldStatusID == 1)
  7984. {
  7985. actionResult.Status = (int)Constant.PDAResult.Success;
  7986. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7987. }
  7988. else
  7989. {
  7990. actionResult.Status = (int)Constant.PDAResult.Fail;
  7991. actionResult.Result = -2;
  7992. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  7993. }
  7994. return actionResult;
  7995. }
  7996. #endregion
  7997. #region 回收
  7998. if (mouldOperationType == 5)
  7999. {
  8000. if (mouldStatusID == 3)
  8001. {
  8002. actionResult.Status = (int)Constant.PDAResult.Success;
  8003. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8004. }
  8005. else
  8006. {
  8007. actionResult.Status = (int)Constant.PDAResult.Fail;
  8008. actionResult.Result = -2;
  8009. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  8010. }
  8011. return actionResult;
  8012. }
  8013. #endregion
  8014. #region 变更型号
  8015. if (mouldOperationType == -1)
  8016. {
  8017. if (mouldStatusID != 4)
  8018. {
  8019. actionResult.Status = (int)Constant.PDAResult.Success;
  8020. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8021. }
  8022. else
  8023. {
  8024. actionResult.Status = (int)Constant.PDAResult.Fail;
  8025. actionResult.Result = -2;
  8026. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  8027. }
  8028. return actionResult;
  8029. }
  8030. #endregion
  8031. #region 替换条码
  8032. if (mouldOperationType == -2)
  8033. {
  8034. actionResult.Status = (int)Constant.PDAResult.Success;
  8035. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8036. return actionResult;
  8037. }
  8038. #endregion
  8039. return actionResult;
  8040. }
  8041. }
  8042. #endregion
  8043. #region 模具操作-保存
  8044. if (action == "SetMouldOperation")
  8045. {
  8046. ClientRequestEntity cre = new ClientRequestEntity();
  8047. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8048. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8049. cre.Properties["Remarks"] = data["Remarks"];
  8050. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8051. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8052. {
  8053. cre.Properties["GoodsID"] = data["GoodsID"];
  8054. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8055. }
  8056. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8057. {
  8058. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8059. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8060. }
  8061. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8062. if (sre.Status == Constant.ServiceResultStatus.Success)
  8063. {
  8064. actionResult.Status = (int)Constant.PDAResult.Success;
  8065. }
  8066. else
  8067. {
  8068. actionResult.Status = (int)Constant.PDAResult.Fail;
  8069. }
  8070. return actionResult;
  8071. }
  8072. #endregion
  8073. #region 模具操作-替换条码
  8074. if (action == "ChangedMouldBarcode")
  8075. {
  8076. ClientRequestEntity cre = new ClientRequestEntity();
  8077. cre.Properties["MouldID"] = data["MouldID"];
  8078. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8079. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8080. cre.Properties["Remarks"] = data["Remarks"];
  8081. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8082. if (sre.Status == Constant.ServiceResultStatus.Success)
  8083. {
  8084. actionResult.Status = (int)Constant.PDAResult.Success;
  8085. }
  8086. else
  8087. {
  8088. actionResult.Status = (int)Constant.PDAResult.Fail;
  8089. actionResult.Result = sre.OtherStatus;
  8090. actionResult.Message = sre.Message;
  8091. }
  8092. return actionResult;
  8093. }
  8094. #endregion
  8095. #region 模具跟踪表
  8096. if (action == "GetMoldTracking")
  8097. {
  8098. ClientRequestEntity cre = new ClientRequestEntity();
  8099. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8100. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8101. if (sre.Status == Constant.ServiceResultStatus.Success)
  8102. {
  8103. actionResult.Status = (int)Constant.PDAResult.Success;
  8104. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8105. }
  8106. else
  8107. {
  8108. actionResult.Status = (int)Constant.PDAResult.Fail;
  8109. actionResult.Message = "此模具条码不存在";
  8110. }
  8111. return actionResult;
  8112. }
  8113. #endregion
  8114. return actionResult;
  8115. }
  8116. #endregion
  8117. #region 成型线模具管理
  8118. if (module == "PC_GroutingLineMould")
  8119. {
  8120. #region 获取当前用户成型线模具管理权限
  8121. if (action == "GetGMouldStatusRight")
  8122. {
  8123. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8124. actionResult.Status = (int)Constant.PDAResult.Success;
  8125. if (right != null && right.Rows.Count > 0)
  8126. {
  8127. actionResult.Result = JsonHelper.ToJson(right);
  8128. }
  8129. return actionResult;
  8130. }
  8131. #endregion
  8132. #region 获取成型线状态等信息,和成型模具信息
  8133. if (action == "GetGroutingLineMould")
  8134. {
  8135. int? groutingLineID = null;
  8136. string groutingLineCode = null;
  8137. if (data.ContainsKey("GroutingLineID"))
  8138. {
  8139. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8140. }
  8141. else
  8142. {
  8143. groutingLineCode = data["GroutingLineCode"] + "";
  8144. }
  8145. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8146. if (lineInfo == null)
  8147. {
  8148. actionResult.Status = (int)Constant.PDAResult.Fail;
  8149. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8150. }
  8151. else
  8152. {
  8153. actionResult.Status = (int)Constant.PDAResult.Success;
  8154. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8155. }
  8156. return actionResult;
  8157. }
  8158. #endregion
  8159. #region 模具操作-画面初始化
  8160. if (action == "GetMouldOperationInit")
  8161. {
  8162. ClientRequestEntity cre = new ClientRequestEntity();
  8163. cre.Properties["MouldOperationType"] = 2;
  8164. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8165. if (sre.Status == Constant.ServiceResultStatus.Success)
  8166. {
  8167. actionResult.Status = (int)Constant.PDAResult.Success;
  8168. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8169. }
  8170. else
  8171. {
  8172. actionResult.Status = (int)Constant.PDAResult.Fail;
  8173. actionResult.Result = sre.OtherStatus;
  8174. actionResult.Message = sre.Message;
  8175. }
  8176. return actionResult;
  8177. }
  8178. #endregion
  8179. #region 成型模具操作-画面初始化
  8180. if (action == "GetGroutingMouldOperationInit")
  8181. {
  8182. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8183. if (initData != null && initData.Rows.Count > 0)
  8184. {
  8185. actionResult.Status = (int)Constant.PDAResult.Success;
  8186. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8187. foreach (DataRow item in initData.Rows)
  8188. {
  8189. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8190. }
  8191. actionResult.Result = JsonHelper.ToJson(syssetting);
  8192. }
  8193. else
  8194. {
  8195. actionResult.Status = (int)Constant.PDAResult.Fail;
  8196. }
  8197. return actionResult;
  8198. }
  8199. #endregion
  8200. #region 模具操作-验证模具条码
  8201. if (action == "CheckMouldBarcode")
  8202. {
  8203. ClientRequestEntity cre = new ClientRequestEntity();
  8204. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8205. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8206. if (sre.Status == Constant.ServiceResultStatus.Success)
  8207. {
  8208. if (sre.Data.Tables[0].Rows.Count == 0)
  8209. {
  8210. actionResult.Status = (int)Constant.PDAResult.Fail;
  8211. actionResult.Result = -1;
  8212. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8213. return actionResult;
  8214. }
  8215. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8216. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8217. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8218. #region 上线
  8219. if (mouldOperationType == 6)
  8220. {
  8221. if (mouldStatusID == 1 || mouldStatusID == 3)
  8222. {
  8223. if (data.ContainsKey("GoodsID"))
  8224. {
  8225. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8226. {
  8227. actionResult.Status = (int)Constant.PDAResult.Fail;
  8228. actionResult.Result = -3;
  8229. actionResult.Message =
  8230. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8231. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8232. "】与当前不一致";
  8233. return actionResult;
  8234. }
  8235. }
  8236. actionResult.Status = (int)Constant.PDAResult.Success;
  8237. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8238. }
  8239. else
  8240. {
  8241. actionResult.Status = (int)Constant.PDAResult.Fail;
  8242. actionResult.Result = -2;
  8243. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8244. }
  8245. return actionResult;
  8246. }
  8247. #endregion
  8248. return actionResult;
  8249. }
  8250. }
  8251. #endregion
  8252. #region 停用
  8253. if (action == "StopGroutingLineDetail")
  8254. {
  8255. if (data == null || !data.ContainsKey("Details"))
  8256. {
  8257. actionResult.Status = (int)Constant.PDAResult.Fail;
  8258. actionResult.Message = "参数错误";
  8259. return actionResult;
  8260. }
  8261. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8262. DataTable gTable = new DataTable();
  8263. gTable.Columns.Add("GroutingLineID", typeof(int));
  8264. gTable.Columns.Add("GroutingLineCode");
  8265. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8266. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8267. gTable.Columns.Add("GroutingMouldCode");
  8268. gTable.Columns.Add("RecordRemarks");
  8269. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8270. gTable.Columns.Add("MouldID", typeof(int));
  8271. gTable.Columns.Add("MouldCode");
  8272. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8273. string groutingLineCode = data["GroutingLineCode"] + "";
  8274. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8275. foreach (Dictionary<string, object> item in details)
  8276. {
  8277. int? mouldID = null;
  8278. if (item.ContainsKey("MouldID"))
  8279. {
  8280. mouldID = Convert.ToInt32(item["MouldID"]);
  8281. if (mouldID == 0)
  8282. {
  8283. mouldID = null;
  8284. }
  8285. }
  8286. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8287. item["GLineDetailID"], item["GLineDetailCode"],
  8288. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8289. mouldID, item["MouldCode"]);
  8290. }
  8291. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8292. if (result > 0)
  8293. {
  8294. actionResult.Status = (int)Constant.PDAResult.Success;
  8295. }
  8296. else
  8297. {
  8298. actionResult.Status = (int)Constant.PDAResult.Fail;
  8299. actionResult.Result = result;
  8300. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8301. return actionResult;
  8302. }
  8303. return actionResult;
  8304. }
  8305. #endregion
  8306. #region 启用
  8307. if (action == "StartGroutingLineDetail")
  8308. {
  8309. if (data == null || !data.ContainsKey("Details"))
  8310. {
  8311. actionResult.Status = (int)Constant.PDAResult.Fail;
  8312. actionResult.Message = "参数错误";
  8313. return actionResult;
  8314. }
  8315. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8316. DataTable gTable = new DataTable();
  8317. gTable.Columns.Add("GroutingLineID", typeof(int));
  8318. gTable.Columns.Add("GroutingLineCode");
  8319. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8320. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8321. gTable.Columns.Add("GroutingMouldCode");
  8322. gTable.Columns.Add("RecordRemarks");
  8323. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8324. gTable.Columns.Add("MouldID", typeof(int));
  8325. gTable.Columns.Add("MouldCode");
  8326. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8327. string groutingLineCode = data["GroutingLineCode"] + "";
  8328. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8329. foreach (Dictionary<string, object> item in details)
  8330. {
  8331. int? mouldID = null;
  8332. if (item.ContainsKey("MouldID"))
  8333. {
  8334. mouldID = Convert.ToInt32(item["MouldID"]);
  8335. if (mouldID == 0)
  8336. {
  8337. mouldID = null;
  8338. }
  8339. }
  8340. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8341. item["GLineDetailID"], item["GLineDetailCode"],
  8342. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8343. mouldID, item["MouldCode"]);
  8344. }
  8345. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8346. if (result > 0)
  8347. {
  8348. actionResult.Status = (int)Constant.PDAResult.Success;
  8349. }
  8350. else
  8351. {
  8352. actionResult.Status = (int)Constant.PDAResult.Fail;
  8353. actionResult.Result = result;
  8354. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8355. return actionResult;
  8356. }
  8357. return actionResult;
  8358. }
  8359. #endregion
  8360. #region 维修
  8361. if (action == "RepairStartGroutingLineDetail")
  8362. {
  8363. if (data == null || !data.ContainsKey("Details"))
  8364. {
  8365. actionResult.Status = (int)Constant.PDAResult.Fail;
  8366. actionResult.Message = "参数错误";
  8367. return actionResult;
  8368. }
  8369. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8370. DataTable gTable = new DataTable();
  8371. gTable.Columns.Add("GroutingLineID", typeof(int));
  8372. gTable.Columns.Add("GroutingLineCode");
  8373. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8374. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8375. gTable.Columns.Add("GroutingMouldCode");
  8376. gTable.Columns.Add("RecordRemarks");
  8377. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8378. gTable.Columns.Add("MouldID", typeof(int));
  8379. gTable.Columns.Add("MouldCode");
  8380. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8381. string groutingLineCode = data["GroutingLineCode"] + "";
  8382. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8383. foreach (Dictionary<string, object> item in details)
  8384. {
  8385. int? mouldID = null;
  8386. if (item.ContainsKey("MouldID"))
  8387. {
  8388. mouldID = Convert.ToInt32(item["MouldID"]);
  8389. if (mouldID == 0)
  8390. {
  8391. mouldID = null;
  8392. }
  8393. }
  8394. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8395. item["GLineDetailID"], item["GLineDetailCode"],
  8396. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8397. mouldID, item["MouldCode"]);
  8398. }
  8399. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8400. if (result > 0)
  8401. {
  8402. actionResult.Status = (int)Constant.PDAResult.Success;
  8403. }
  8404. else
  8405. {
  8406. actionResult.Status = (int)Constant.PDAResult.Fail;
  8407. actionResult.Result = result;
  8408. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8409. return actionResult;
  8410. }
  8411. return actionResult;
  8412. }
  8413. #endregion
  8414. #region 结束维修
  8415. if (action == "RepairEndGroutingLineDetail")
  8416. {
  8417. if (data == null || !data.ContainsKey("Details"))
  8418. {
  8419. actionResult.Status = (int)Constant.PDAResult.Fail;
  8420. actionResult.Message = "参数错误";
  8421. return actionResult;
  8422. }
  8423. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8424. DataTable gTable = new DataTable();
  8425. gTable.Columns.Add("GroutingLineID", typeof(int));
  8426. gTable.Columns.Add("GroutingLineCode");
  8427. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8428. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8429. gTable.Columns.Add("GroutingMouldCode");
  8430. gTable.Columns.Add("RecordRemarks");
  8431. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8432. gTable.Columns.Add("MouldID", typeof(int));
  8433. gTable.Columns.Add("MouldCode");
  8434. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8435. string groutingLineCode = data["GroutingLineCode"] + "";
  8436. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8437. foreach (Dictionary<string, object> item in details)
  8438. {
  8439. int? mouldID = null;
  8440. if (item.ContainsKey("MouldID"))
  8441. {
  8442. mouldID = Convert.ToInt32(item["MouldID"]);
  8443. if (mouldID == 0)
  8444. {
  8445. mouldID = null;
  8446. }
  8447. }
  8448. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8449. item["GLineDetailID"], item["GLineDetailCode"],
  8450. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8451. mouldID, item["MouldCode"]);
  8452. }
  8453. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8454. if (result > 0)
  8455. {
  8456. actionResult.Status = (int)Constant.PDAResult.Success;
  8457. }
  8458. else
  8459. {
  8460. actionResult.Status = (int)Constant.PDAResult.Fail;
  8461. actionResult.Result = result;
  8462. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8463. return actionResult;
  8464. }
  8465. return actionResult;
  8466. }
  8467. #endregion
  8468. #region 换模
  8469. if (action == "ChangeGMouldStartGroutingLineDetail")
  8470. {
  8471. if (data == null || !data.ContainsKey("Details"))
  8472. {
  8473. actionResult.Status = (int)Constant.PDAResult.Fail;
  8474. actionResult.Message = "参数错误";
  8475. return actionResult;
  8476. }
  8477. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8478. DataTable gTable = new DataTable();
  8479. gTable.Columns.Add("GroutingLineID", typeof(int));
  8480. gTable.Columns.Add("GroutingLineCode");
  8481. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8482. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8483. gTable.Columns.Add("GroutingMouldCode");
  8484. gTable.Columns.Add("RecordRemarks");
  8485. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8486. gTable.Columns.Add("MouldID", typeof(int));
  8487. gTable.Columns.Add("MouldCode");
  8488. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8489. gTable.Columns.Add("MouldStatus", typeof(int));
  8490. gTable.Columns.Add("ScrapReason", typeof(int));
  8491. gTable.Columns.Add("ScrapResponsibility");
  8492. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8493. string groutingLineCode = data["GroutingLineCode"] + "";
  8494. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8495. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8496. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8497. string scrapResponsibility = data["ScrapRemarks"] + "";
  8498. foreach (Dictionary<string, object> item in details)
  8499. {
  8500. int? mouldID = null;
  8501. if (item.ContainsKey("MouldID"))
  8502. {
  8503. mouldID = Convert.ToInt32(item["MouldID"]);
  8504. if (mouldID == 0)
  8505. {
  8506. mouldID = null;
  8507. }
  8508. }
  8509. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8510. item["GLineDetailID"], item["GLineDetailCode"],
  8511. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8512. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8513. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8514. }
  8515. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  8516. if (result > 0)
  8517. {
  8518. actionResult.Status = (int)Constant.PDAResult.Success;
  8519. }
  8520. else
  8521. {
  8522. actionResult.Status = (int)Constant.PDAResult.Fail;
  8523. actionResult.Result = result;
  8524. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8525. return actionResult;
  8526. }
  8527. return actionResult;
  8528. }
  8529. #endregion
  8530. #region 变产
  8531. if (action == "UpdateLineStartGroutingLineDetail")
  8532. {
  8533. if (data == null || !data.ContainsKey("Details"))
  8534. {
  8535. actionResult.Status = (int)Constant.PDAResult.Fail;
  8536. actionResult.Message = "参数错误";
  8537. return actionResult;
  8538. }
  8539. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8540. DataTable gTable = new DataTable();
  8541. gTable.Columns.Add("GroutingLineID", typeof(int));
  8542. gTable.Columns.Add("GroutingLineCode");
  8543. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8544. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8545. gTable.Columns.Add("GroutingMouldCode");
  8546. gTable.Columns.Add("RecordRemarks");
  8547. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8548. gTable.Columns.Add("MouldID", typeof(int));
  8549. gTable.Columns.Add("MouldCode");
  8550. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8551. gTable.Columns.Add("MouldStatus", typeof(int));
  8552. gTable.Columns.Add("ScrapReason", typeof(int));
  8553. gTable.Columns.Add("ScrapResponsibility");
  8554. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8555. string groutingLineCode = data["GroutingLineCode"] + "";
  8556. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8557. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8558. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8559. string scrapResponsibility = data["ScrapRemarks"] + "";
  8560. foreach (Dictionary<string, object> item in details)
  8561. {
  8562. int? mouldID = null;
  8563. if (item.ContainsKey("MouldID"))
  8564. {
  8565. mouldID = Convert.ToInt32(item["MouldID"]);
  8566. if (mouldID == 0)
  8567. {
  8568. mouldID = null;
  8569. }
  8570. }
  8571. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8572. item["GLineDetailID"], item["GLineDetailCode"],
  8573. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8574. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8575. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8576. }
  8577. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  8578. if (result > 0)
  8579. {
  8580. actionResult.Status = (int)Constant.PDAResult.Success;
  8581. }
  8582. else
  8583. {
  8584. actionResult.Status = (int)Constant.PDAResult.Fail;
  8585. actionResult.Result = result;
  8586. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8587. return actionResult;
  8588. }
  8589. return actionResult;
  8590. }
  8591. #endregion
  8592. #region 整线变产
  8593. if (action == "UpdateAllLineStartGroutingLineDetail")
  8594. {
  8595. if (data == null || !data.ContainsKey("Details"))
  8596. {
  8597. actionResult.Status = (int)Constant.PDAResult.Fail;
  8598. actionResult.Message = "参数错误";
  8599. return actionResult;
  8600. }
  8601. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8602. DataTable gTable = new DataTable();
  8603. gTable.Columns.Add("GroutingLineID", typeof(int));
  8604. gTable.Columns.Add("GroutingLineCode");
  8605. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8606. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8607. gTable.Columns.Add("GroutingMouldCode");
  8608. gTable.Columns.Add("RecordRemarks");
  8609. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8610. gTable.Columns.Add("MouldID", typeof(int));
  8611. gTable.Columns.Add("MouldCode");
  8612. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8613. gTable.Columns.Add("MouldStatus", typeof(int));
  8614. gTable.Columns.Add("ScrapReason", typeof(int));
  8615. gTable.Columns.Add("ScrapResponsibility");
  8616. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8617. string groutingLineCode = data["GroutingLineCode"] + "";
  8618. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8619. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8620. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8621. string scrapResponsibility = data["ScrapRemarks"] + "";
  8622. foreach (Dictionary<string, object> item in details)
  8623. {
  8624. int? mouldID = null;
  8625. if (item.ContainsKey("MouldID"))
  8626. {
  8627. mouldID = Convert.ToInt32(item["MouldID"]);
  8628. if (mouldID == 0)
  8629. {
  8630. mouldID = null;
  8631. }
  8632. }
  8633. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8634. item["GLineDetailID"], item["GLineDetailCode"],
  8635. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8636. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8637. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8638. }
  8639. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  8640. if (result > 0)
  8641. {
  8642. actionResult.Status = (int)Constant.PDAResult.Success;
  8643. }
  8644. else
  8645. {
  8646. actionResult.Status = (int)Constant.PDAResult.Fail;
  8647. actionResult.Result = result;
  8648. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8649. return actionResult;
  8650. }
  8651. return actionResult;
  8652. }
  8653. #endregion
  8654. #region 卸模
  8655. if (action == "UnloadGroutingLineDetail")
  8656. {
  8657. if (data == null || !data.ContainsKey("Details"))
  8658. {
  8659. actionResult.Status = (int)Constant.PDAResult.Fail;
  8660. actionResult.Message = "参数错误";
  8661. return actionResult;
  8662. }
  8663. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8664. DataTable gTable = new DataTable();
  8665. gTable.Columns.Add("GroutingLineID", typeof(int));
  8666. gTable.Columns.Add("GroutingLineCode");
  8667. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8668. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8669. gTable.Columns.Add("GroutingMouldCode");
  8670. gTable.Columns.Add("RecordRemarks");
  8671. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8672. gTable.Columns.Add("MouldID", typeof(int));
  8673. gTable.Columns.Add("MouldCode");
  8674. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8675. gTable.Columns.Add("MouldStatus", typeof(int));
  8676. gTable.Columns.Add("ScrapReason", typeof(int));
  8677. gTable.Columns.Add("ScrapResponsibility");
  8678. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8679. string groutingLineCode = data["GroutingLineCode"] + "";
  8680. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8681. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8682. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8683. string scrapResponsibility = data["ScrapRemarks"] + "";
  8684. foreach (Dictionary<string, object> item in details)
  8685. {
  8686. int? mouldID = null;
  8687. if (item.ContainsKey("MouldID"))
  8688. {
  8689. mouldID = Convert.ToInt32(item["MouldID"]);
  8690. if (mouldID == 0)
  8691. {
  8692. mouldID = null;
  8693. }
  8694. }
  8695. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8696. item["GLineDetailID"], item["GLineDetailCode"],
  8697. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8698. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8699. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8700. }
  8701. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  8702. if (result > 0)
  8703. {
  8704. actionResult.Status = (int)Constant.PDAResult.Success;
  8705. }
  8706. else
  8707. {
  8708. actionResult.Status = (int)Constant.PDAResult.Fail;
  8709. actionResult.Result = result;
  8710. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8711. return actionResult;
  8712. }
  8713. return actionResult;
  8714. }
  8715. #endregion
  8716. #region 结束换模
  8717. if (action == "ChangeGMouldEndGroutingLineDetail")
  8718. {
  8719. if (data == null || !data.ContainsKey("Details"))
  8720. {
  8721. actionResult.Status = (int)Constant.PDAResult.Fail;
  8722. actionResult.Message = "参数错误";
  8723. return actionResult;
  8724. }
  8725. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8726. DataTable gTable = new DataTable();
  8727. gTable.Columns.Add("GroutingLineID", typeof(int));
  8728. gTable.Columns.Add("GroutingLineCode");
  8729. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8730. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8731. gTable.Columns.Add("GroutingMouldCode");
  8732. gTable.Columns.Add("RreasonRemarks");
  8733. gTable.Columns.Add("RecordRemarks");
  8734. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8735. gTable.Columns.Add("MouldID", typeof(int));
  8736. gTable.Columns.Add("MouldCode");
  8737. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8738. gTable.Columns.Add("GoodsID", typeof(int));
  8739. gTable.Columns.Add("GoodsCode");
  8740. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8741. gTable.Columns.Add("GroutingCount", typeof(int));
  8742. gTable.Columns.Add("MouldSource");
  8743. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8744. string groutingLineCode = data["GroutingLineCode"] + "";
  8745. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8746. foreach (Dictionary<string, object> item in details)
  8747. {
  8748. int? mouldID = null;
  8749. if (item.ContainsKey("MouldID"))
  8750. {
  8751. mouldID = Convert.ToInt32(item["MouldID"]);
  8752. if (mouldID == 0)
  8753. {
  8754. mouldID = null;
  8755. }
  8756. }
  8757. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8758. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8759. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8760. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8761. item["GoodsID"], item["GoodsCode"],
  8762. item["StandardGroutingCount"], item["GroutingCount"],
  8763. (mouldID == null ? "0" : "1"));
  8764. }
  8765. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  8766. if (result.Status == Constant.ServiceResultStatus.Success)
  8767. {
  8768. actionResult.Status = (int)Constant.PDAResult.Success;
  8769. }
  8770. else if (result.OtherStatus == -100)
  8771. {
  8772. actionResult.Status = (int)Constant.PDAResult.Fail;
  8773. actionResult.Result = -100;
  8774. actionResult.Message = result.Message;
  8775. return actionResult;
  8776. }
  8777. else
  8778. {
  8779. actionResult.Status = (int)Constant.PDAResult.Fail;
  8780. actionResult.Result = -500;
  8781. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8782. return actionResult;
  8783. }
  8784. return actionResult;
  8785. }
  8786. #endregion
  8787. #region 结束变产
  8788. if (action == "UpdateLineEndGroutingLineDetail")
  8789. {
  8790. if (data == null || !data.ContainsKey("Details"))
  8791. {
  8792. actionResult.Status = (int)Constant.PDAResult.Fail;
  8793. actionResult.Message = "参数错误";
  8794. return actionResult;
  8795. }
  8796. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8797. DataTable gTable = new DataTable();
  8798. gTable.Columns.Add("GroutingLineID", typeof(int));
  8799. gTable.Columns.Add("GroutingLineCode");
  8800. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8801. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8802. gTable.Columns.Add("GroutingMouldCode");
  8803. gTable.Columns.Add("RreasonRemarks");
  8804. gTable.Columns.Add("RecordRemarks");
  8805. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8806. gTable.Columns.Add("MouldID", typeof(int));
  8807. gTable.Columns.Add("MouldCode");
  8808. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8809. gTable.Columns.Add("GoodsID", typeof(int));
  8810. gTable.Columns.Add("GoodsCode");
  8811. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8812. gTable.Columns.Add("GroutingCount", typeof(int));
  8813. gTable.Columns.Add("MouldSource");
  8814. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8815. string groutingLineCode = data["GroutingLineCode"] + "";
  8816. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8817. foreach (Dictionary<string, object> item in details)
  8818. {
  8819. int? mouldID = null;
  8820. if (item.ContainsKey("MouldID"))
  8821. {
  8822. mouldID = Convert.ToInt32(item["MouldID"]);
  8823. if (mouldID == 0)
  8824. {
  8825. mouldID = null;
  8826. }
  8827. }
  8828. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8829. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8830. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8831. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8832. item["GoodsID"], item["GoodsCode"],
  8833. item["StandardGroutingCount"], item["GroutingCount"],
  8834. (mouldID == null ? "0" : "1"));
  8835. }
  8836. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  8837. if (result.Status == Constant.ServiceResultStatus.Success)
  8838. {
  8839. actionResult.Status = (int)Constant.PDAResult.Success;
  8840. }
  8841. else if (result.OtherStatus == -100)
  8842. {
  8843. actionResult.Status = (int)Constant.PDAResult.Fail;
  8844. actionResult.Result = -100;
  8845. actionResult.Message = result.Message;
  8846. return actionResult;
  8847. }
  8848. else
  8849. {
  8850. actionResult.Status = (int)Constant.PDAResult.Fail;
  8851. actionResult.Result = -500;
  8852. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8853. return actionResult;
  8854. }
  8855. return actionResult;
  8856. }
  8857. #endregion
  8858. #region 结束整线变产
  8859. if (action == "UpdateAllLineEndGroutingLineDetail")
  8860. {
  8861. if (data == null || !data.ContainsKey("Details"))
  8862. {
  8863. actionResult.Status = (int)Constant.PDAResult.Fail;
  8864. actionResult.Message = "参数错误";
  8865. return actionResult;
  8866. }
  8867. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8868. DataTable gTable = new DataTable();
  8869. gTable.Columns.Add("GroutingLineID", typeof(int));
  8870. gTable.Columns.Add("GroutingLineCode");
  8871. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8872. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8873. gTable.Columns.Add("GroutingMouldCode");
  8874. gTable.Columns.Add("Remarks");
  8875. gTable.Columns.Add("RecordRemarks");
  8876. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8877. gTable.Columns.Add("MouldID", typeof(int));
  8878. gTable.Columns.Add("MouldCode");
  8879. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8880. gTable.Columns.Add("GoodsID", typeof(int));
  8881. gTable.Columns.Add("GoodsCode");
  8882. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8883. gTable.Columns.Add("GroutingCount", typeof(int));
  8884. gTable.Columns.Add("MouldSource");
  8885. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8886. string groutingLineCode = data["GroutingLineCode"] + "";
  8887. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8888. foreach (Dictionary<string, object> item in details)
  8889. {
  8890. int? mouldID = null;
  8891. if (item.ContainsKey("MouldID"))
  8892. {
  8893. mouldID = Convert.ToInt32(item["MouldID"]);
  8894. if (mouldID == 0)
  8895. {
  8896. mouldID = null;
  8897. }
  8898. }
  8899. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8900. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8901. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  8902. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8903. item["GoodsID"], item["GoodsCode"],
  8904. item["StandardGroutingCount"], item["GroutingCount"],
  8905. (mouldID == null ? "0" : "1"));
  8906. }
  8907. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  8908. if (result.Status == Constant.ServiceResultStatus.Success)
  8909. {
  8910. actionResult.Status = (int)Constant.PDAResult.Success;
  8911. }
  8912. else if (result.OtherStatus == -100)
  8913. {
  8914. actionResult.Status = (int)Constant.PDAResult.Fail;
  8915. actionResult.Result = -100;
  8916. actionResult.Message = result.Message;
  8917. return actionResult;
  8918. }
  8919. else
  8920. {
  8921. actionResult.Status = (int)Constant.PDAResult.Fail;
  8922. actionResult.Result = -500;
  8923. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8924. return actionResult;
  8925. }
  8926. return actionResult;
  8927. }
  8928. #endregion
  8929. #region 上模
  8930. if (action == "UpdateGroutingLine_AddMould")
  8931. {
  8932. if (data == null || !data.ContainsKey("Details"))
  8933. {
  8934. actionResult.Status = (int)Constant.PDAResult.Fail;
  8935. actionResult.Message = "参数错误";
  8936. return actionResult;
  8937. }
  8938. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8939. DataTable gTable = new DataTable();
  8940. gTable.Columns.Add("GroutingLineID", typeof(int));
  8941. gTable.Columns.Add("GroutingLineCode");
  8942. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8943. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8944. gTable.Columns.Add("GroutingMouldCode");
  8945. gTable.Columns.Add("Remarks");
  8946. gTable.Columns.Add("RecordRemarks");
  8947. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8948. gTable.Columns.Add("MouldID", typeof(int));
  8949. gTable.Columns.Add("MouldCode");
  8950. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8951. gTable.Columns.Add("GoodsID", typeof(int));
  8952. gTable.Columns.Add("GoodsCode");
  8953. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8954. gTable.Columns.Add("GroutingCount", typeof(int));
  8955. gTable.Columns.Add("MouldSource");
  8956. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8957. string groutingLineCode = data["GroutingLineCode"] + "";
  8958. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8959. foreach (Dictionary<string, object> item in details)
  8960. {
  8961. int? mouldID = null;
  8962. if (item.ContainsKey("MouldID"))
  8963. {
  8964. mouldID = Convert.ToInt32(item["MouldID"]);
  8965. if (mouldID == 0)
  8966. {
  8967. mouldID = null;
  8968. }
  8969. }
  8970. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  8971. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8972. gldID, item["GLineDetailCode"],
  8973. item["DetailRemarks"], item["RecordRemarks"],
  8974. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  8975. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8976. item["GoodsID"], item["GoodsCode"],
  8977. item["StandardGroutingCount"], item["GroutingCount"],
  8978. (mouldID == null ? "0" : "1"));
  8979. }
  8980. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  8981. if (result.Status == Constant.ServiceResultStatus.Success)
  8982. {
  8983. actionResult.Status = (int)Constant.PDAResult.Success;
  8984. }
  8985. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  8986. {
  8987. actionResult.Status = (int)Constant.PDAResult.Fail;
  8988. actionResult.Result = result.OtherStatus;
  8989. actionResult.Message = result.Message;
  8990. return actionResult;
  8991. }
  8992. else
  8993. {
  8994. actionResult.Status = (int)Constant.PDAResult.Fail;
  8995. actionResult.Result = -500;
  8996. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8997. return actionResult;
  8998. }
  8999. return actionResult;
  9000. }
  9001. #endregion
  9002. return actionResult;
  9003. }
  9004. #endregion
  9005. #region 包装装板限制
  9006. if (module == "FinishedLoadingCar")
  9007. {
  9008. if (action == "GetSetting")
  9009. {
  9010. ClientRequestEntity cre = new ClientRequestEntity();
  9011. cre.Properties["GoodsID"] = data["GoodsID"];
  9012. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9013. if (sre.Status == Constant.ServiceResultStatus.Success)
  9014. {
  9015. actionResult.Status = (int)Constant.PDAResult.Success;
  9016. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9017. {
  9018. if (item["settingcode"].ToString() == "S_PM_011")
  9019. {
  9020. cre.Properties["S_PM_011"] = item["settingvalue"];
  9021. }
  9022. else if (item["settingcode"].ToString() == "S_PM_012")
  9023. {
  9024. cre.Properties["S_PM_012"] = item["settingvalue"];
  9025. }
  9026. else if (item["settingcode"].ToString() == "S_PM_013")
  9027. {
  9028. cre.Properties["S_PM_013"] = item["settingvalue"];
  9029. }
  9030. }
  9031. cre.Properties["PlatelitNum"] = sre.Result;
  9032. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9033. }
  9034. else
  9035. {
  9036. actionResult.Status = (int)Constant.PDAResult.Fail;
  9037. actionResult.Message = "";
  9038. }
  9039. return actionResult;
  9040. }
  9041. }
  9042. #endregion
  9043. #region 成型报损
  9044. if (module == "GroutingScrapProduct")
  9045. {
  9046. // 查询注浆日报明细表
  9047. if ("GetGroutingDailyDetail" == action)
  9048. {
  9049. ClientRequestEntity cre = new ClientRequestEntity();
  9050. cre.NameSpace = module;
  9051. cre.Name = action;
  9052. if (!string.IsNullOrEmpty(jsonData))
  9053. {
  9054. cre.Properties["BarCode"] = data["BarCode"];
  9055. }
  9056. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9057. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9058. actionResult.Status = (int)Constant.PDAResult.Success;
  9059. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9060. || sre.Data.Tables[0].Rows.Count == 0)
  9061. {
  9062. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9063. actionResult.Status = (int)Constant.PDAResult.Fail;
  9064. }
  9065. else
  9066. {
  9067. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9068. // 判断是否进行了注浆
  9069. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9070. {
  9071. actionResult.Message = "该产品还未进行注浆!";
  9072. actionResult.Status = (int)Constant.PDAResult.Fail;
  9073. }
  9074. // 判断是否进行了交坯
  9075. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9076. {
  9077. actionResult.Message = "该产品已经交坯!";
  9078. actionResult.Status = (int)Constant.PDAResult.Fail;
  9079. }
  9080. // 判断是否已经报损
  9081. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9082. {
  9083. actionResult.Message = "该产品已经报损!";
  9084. actionResult.Status = (int)Constant.PDAResult.Fail;
  9085. }
  9086. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9087. }
  9088. }
  9089. // 获取成型报损原因
  9090. else if ("GetScrapReasonData" == action)
  9091. {
  9092. ClientRequestEntity cre = new ClientRequestEntity();
  9093. cre.NameSpace = module;
  9094. cre.Name = action;
  9095. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo);
  9096. actionResult.Status = (int)Constant.PDAResult.Success;
  9097. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9098. }
  9099. // 保存成型报损
  9100. else if ("SaveGroutingScrapProduct" == action)
  9101. {
  9102. ClientRequestEntity cre = new ClientRequestEntity();
  9103. cre.NameSpace = module;
  9104. cre.Name = action;
  9105. if (!string.IsNullOrEmpty(jsonData))
  9106. {
  9107. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9108. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9109. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9110. if (dt != null && dt.Rows.Count > 0)
  9111. {
  9112. // 总单信息
  9113. DataRow properties = dt.Rows[0];
  9114. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9115. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9116. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9117. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9118. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9119. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9120. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9121. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9122. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9123. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9124. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9125. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9126. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9127. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9128. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9129. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9130. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9131. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9132. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9133. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9134. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9135. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9136. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9137. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9138. // 责任员工
  9139. cre.Data = new DataSet();
  9140. //DataTable returnTable = returnData.Tables[1].Copy();
  9141. cre.Data.Tables.Add(dtResponsible);
  9142. }
  9143. }
  9144. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9145. if (sre.Status == Constant.ServiceResultStatus.Success)
  9146. {
  9147. actionResult.Status = (int)Constant.PDAResult.Success;
  9148. actionResult.Result = sre.Result;
  9149. }
  9150. else
  9151. {
  9152. actionResult.Status = (int)Constant.PDAResult.Fail;
  9153. actionResult.Result = sre.OtherStatus;
  9154. actionResult.Message = sre.Message;
  9155. }
  9156. }
  9157. // 获取成型报损信息 用于撤销使用
  9158. else if ("GetGroutingScrapProduct" == action)
  9159. {
  9160. ClientRequestEntity cre = new ClientRequestEntity();
  9161. cre.NameSpace = module;
  9162. cre.Name = action;
  9163. if (!string.IsNullOrEmpty(jsonData))
  9164. {
  9165. cre.Properties["BarCode"] = data["BarCode"];
  9166. }
  9167. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9168. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9169. actionResult.Status = (int)Constant.PDAResult.Success;
  9170. }
  9171. // 撤销成型报损
  9172. else if ("ReverseGroutingScrapProduct" == action)
  9173. {
  9174. ClientRequestEntity cre = new ClientRequestEntity();
  9175. cre.NameSpace = module;
  9176. cre.Name = action;
  9177. if (!string.IsNullOrEmpty(jsonData))
  9178. {
  9179. cre.Properties["BarCode"] = data["BarCode"];
  9180. }
  9181. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9182. if (sre.Status == Constant.ServiceResultStatus.Success)
  9183. {
  9184. actionResult.Status = (int)Constant.PDAResult.Success;
  9185. actionResult.Result = sre.Result;
  9186. }
  9187. else
  9188. {
  9189. actionResult.Status = (int)Constant.PDAResult.Fail;
  9190. actionResult.Result = sre.OtherStatus;
  9191. actionResult.Message = sre.Message;
  9192. }
  9193. }
  9194. }
  9195. #endregion
  9196. #region 产品挂起
  9197. if (module == "ProductSuspend")
  9198. {
  9199. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9200. if (action == "GetSuspendProcedure")
  9201. {
  9202. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9203. if (sre.Status == Constant.ServiceResultStatus.Success)
  9204. {
  9205. actionResult.Status = (int)Constant.PDAResult.Success;
  9206. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9207. }
  9208. else
  9209. {
  9210. actionResult.Status = (int)Constant.PDAResult.Fail;
  9211. actionResult.Message = sre.Message;
  9212. }
  9213. return actionResult;
  9214. }
  9215. // 验证挂起条码
  9216. if (action == "CheckSuspendBarcode")
  9217. {
  9218. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9219. if (sre.Status == Constant.ServiceResultStatus.Success)
  9220. {
  9221. actionResult.Status = (int)Constant.PDAResult.Success;
  9222. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9223. }
  9224. else
  9225. {
  9226. actionResult.Status = (int)Constant.PDAResult.Fail;
  9227. actionResult.Message = sre.Message;
  9228. }
  9229. return actionResult;
  9230. }
  9231. // 挂起条码
  9232. if (action == "SaveSuspendProduct")
  9233. {
  9234. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9235. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9236. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9237. if (sre.Status == Constant.ServiceResultStatus.Success)
  9238. {
  9239. actionResult.Status = (int)Constant.PDAResult.Success;
  9240. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9241. }
  9242. else
  9243. {
  9244. actionResult.Status = (int)Constant.PDAResult.Fail;
  9245. actionResult.Message = sre.Message;
  9246. }
  9247. return actionResult;
  9248. }
  9249. // 撤销挂起条码
  9250. if (action == "DeleteSuspendProduct")
  9251. {
  9252. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9253. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9254. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9255. if (sre.Status == Constant.ServiceResultStatus.Success)
  9256. {
  9257. actionResult.Status = (int)Constant.PDAResult.Success;
  9258. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9259. }
  9260. else
  9261. {
  9262. actionResult.Status = (int)Constant.PDAResult.Fail;
  9263. actionResult.Message = sre.Message;
  9264. }
  9265. return actionResult;
  9266. }
  9267. // 查询挂起条码
  9268. if (action == "GetSuspendProduct")
  9269. {
  9270. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9271. if (sre.Status == Constant.ServiceResultStatus.Success)
  9272. {
  9273. if (sre.Data.Tables[0].Rows.Count == 0)
  9274. {
  9275. actionResult.Status = (int)Constant.PDAResult.Fail;
  9276. actionResult.Message = "此条码没有可撤销的挂起信息";
  9277. }
  9278. else
  9279. {
  9280. actionResult.Status = (int)Constant.PDAResult.Success;
  9281. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9282. }
  9283. }
  9284. else
  9285. {
  9286. actionResult.Status = (int)Constant.PDAResult.Fail;
  9287. actionResult.Message = sre.Message;
  9288. }
  9289. return actionResult;
  9290. }
  9291. }
  9292. #endregion
  9293. #region 品保抽查
  9294. if (module == "QASpotCheck")
  9295. {
  9296. if (action == "GetAllQASpotCheck")
  9297. {
  9298. ClientRequestEntity cre = new ClientRequestEntity();
  9299. cre.NameSpace = module;
  9300. cre.Name = action;
  9301. if (data != null && data.Count > 0)
  9302. {
  9303. foreach (string item in data.Keys)
  9304. {
  9305. if (item.StartsWith("checktime"))
  9306. {
  9307. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9308. }
  9309. else
  9310. {
  9311. cre.Properties.Add(item, data[item]);
  9312. }
  9313. }
  9314. }
  9315. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9316. if (sre.Status == Constant.ServiceResultStatus.Success)
  9317. {
  9318. actionResult.Status = (int)Constant.PDAResult.Success;
  9319. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9320. }
  9321. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9322. {
  9323. actionResult.Status = (int)Constant.PDAResult.Success;
  9324. }
  9325. else
  9326. {
  9327. actionResult.Status = (int)Constant.PDAResult.Fail;
  9328. actionResult.Message = sre.Message;
  9329. }
  9330. return actionResult;
  9331. }
  9332. if (action == "AutoSaveQASpotCheck")
  9333. {
  9334. string barcode = data["barcode"] + "";
  9335. string remarks = data["remarks"] + "";
  9336. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9337. if (sre.Status == Constant.ServiceResultStatus.Success)
  9338. {
  9339. actionResult.Status = (int)Constant.PDAResult.Success;
  9340. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9341. }
  9342. else
  9343. {
  9344. actionResult.Status = (int)Constant.PDAResult.Fail;
  9345. actionResult.Message = sre.Message;
  9346. }
  9347. return actionResult;
  9348. }
  9349. if (action == "CheckQASpotCheck")
  9350. {
  9351. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9352. if (sre.Status == Constant.ServiceResultStatus.Success)
  9353. {
  9354. actionResult.Status = (int)Constant.PDAResult.Success;
  9355. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9356. }
  9357. else
  9358. {
  9359. actionResult.Status = (int)Constant.PDAResult.Fail;
  9360. actionResult.Message = sre.Message;
  9361. }
  9362. return actionResult;
  9363. }
  9364. if (action == "SaveQASpotCheck")
  9365. {
  9366. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9367. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9368. if (sre.Status == Constant.ServiceResultStatus.Success)
  9369. {
  9370. actionResult.Status = (int)Constant.PDAResult.Success;
  9371. }
  9372. else
  9373. {
  9374. actionResult.Status = (int)Constant.PDAResult.Fail;
  9375. actionResult.Message = sre.Message;
  9376. }
  9377. return actionResult;
  9378. }
  9379. return null;
  9380. }
  9381. #endregion
  9382. #region 产成品交接
  9383. if (module == "FinishedProduct")
  9384. {
  9385. // 设定商标
  9386. if (action == "GetFinishedBarcode")
  9387. {
  9388. string barcode = data["barcode"].ToString();
  9389. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  9390. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9391. if (Convert.ToInt32(resultEntity.Result) < 0)
  9392. {
  9393. actionResult.Status = (int)Constant.PDAResult.Fail;
  9394. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9395. actionResult.Message = resultEntity.Message;
  9396. }
  9397. else
  9398. {
  9399. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9400. actionResult.Status = (int)Constant.PDAResult.Success;
  9401. actionResult.Message = resultEntity.Message;
  9402. }
  9403. return actionResult;
  9404. }
  9405. if (action == "GetHandoveredBarcode")
  9406. {
  9407. string barcode = data["barcode"].ToString();
  9408. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  9409. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9410. if (Convert.ToInt32(resultEntity.Result) < 0)
  9411. {
  9412. actionResult.Status = (int)Constant.PDAResult.Fail;
  9413. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9414. actionResult.Message = resultEntity.Message;
  9415. }
  9416. else
  9417. {
  9418. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9419. actionResult.Status = (int)Constant.PDAResult.Success;
  9420. actionResult.Message = resultEntity.Message;
  9421. }
  9422. return actionResult;
  9423. }
  9424. if (action == "SetFinishedLogo")
  9425. {
  9426. int logoid = Convert.ToInt32(data["logoid"]);
  9427. string[] barcodes = data["barcodes"].ToString().Split(',');
  9428. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo);
  9429. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9430. if (result < 0)
  9431. {
  9432. actionResult.Status = (int)Constant.PDAResult.Fail;
  9433. }
  9434. else
  9435. {
  9436. actionResult.Status = (int)Constant.PDAResult.Success;
  9437. }
  9438. return actionResult;
  9439. }
  9440. if (action == "SetHandoveredOrder")
  9441. {
  9442. int orderID = Convert.ToInt32(data["orderID"]);
  9443. string[] barcodes = data["barcodes"].ToString().Split(',');
  9444. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  9445. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9446. if (result < 0)
  9447. {
  9448. actionResult.Status = (int)Constant.PDAResult.Fail;
  9449. }
  9450. else
  9451. {
  9452. actionResult.Status = (int)Constant.PDAResult.Success;
  9453. }
  9454. return actionResult;
  9455. }
  9456. }
  9457. #endregion
  9458. #region 产成品装车
  9459. /*
  9460. if (module == "FinishedLoading")
  9461. {
  9462. // 设定商标
  9463. if (action == "GetMaxLoadingNo")
  9464. {
  9465. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  9466. actionResult.Status = (int)Constant.PDAResult.Success;
  9467. actionResult.Result = no;
  9468. return actionResult;
  9469. }
  9470. if (action == "CheckFinishedLaodingBarcode")
  9471. {
  9472. string barcode = data["barcode"].ToString();
  9473. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  9474. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  9475. {
  9476. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9477. actionResult.Status = (int)Constant.PDAResult.Success;
  9478. actionResult.Message = resultEntity.Message;
  9479. }
  9480. else
  9481. {
  9482. actionResult.Status = (int)Constant.PDAResult.Fail;
  9483. actionResult.Result = resultEntity.OtherStatus;
  9484. actionResult.Message = resultEntity.Message;
  9485. }
  9486. return actionResult;
  9487. }
  9488. if (action == "SaveFinishedLoading")
  9489. {
  9490. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  9491. string carLicense = data["carLicense"] + "";
  9492. int palletNum = Convert.ToInt32(data["palletNum"]);
  9493. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  9494. string remarks = data["remarks"] + "";
  9495. Dictionary<string, object>[] details =
  9496. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  9497. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  9498. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  9499. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  9500. if (result.Status == Constant.ServiceResultStatus.Success)
  9501. {
  9502. actionResult.Status = (int)Constant.PDAResult.Success;
  9503. actionResult.Message = result.Message;
  9504. }
  9505. else
  9506. {
  9507. actionResult.Status = (int)Constant.PDAResult.Fail;
  9508. actionResult.Result = result.OtherStatus;
  9509. actionResult.Message = result.Message;
  9510. }
  9511. return actionResult;
  9512. }
  9513. }
  9514. */
  9515. #endregion
  9516. #region 产成品质量改判
  9517. if (module == "FinishedProductTamper")
  9518. {
  9519. // 获取产成品信息及缺陷数据
  9520. if (action == "GetDefectData")
  9521. {
  9522. string barcode = data["barcode"].ToString();
  9523. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  9524. if (sre.Status == Constant.ServiceResultStatus.Success)
  9525. {
  9526. actionResult.Status = (int)Constant.PDAResult.Success;
  9527. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9528. actionResult.Message = sre.Message;
  9529. }
  9530. else
  9531. {
  9532. actionResult.Status = (int)Constant.PDAResult.Fail;
  9533. actionResult.Result = sre.OtherStatus;
  9534. actionResult.Message = sre.Message;
  9535. }
  9536. return actionResult;
  9537. }
  9538. // 获取产成品信息及缺陷数据
  9539. if (action == "SaveDefectData")
  9540. {
  9541. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  9542. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  9543. if (sre.Status == Constant.ServiceResultStatus.Success)
  9544. {
  9545. actionResult.Status = (int)Constant.PDAResult.Success;
  9546. actionResult.Message = sre.Message;
  9547. }
  9548. else
  9549. {
  9550. actionResult.Status = (int)Constant.PDAResult.Fail;
  9551. actionResult.Message = sre.Message;
  9552. }
  9553. return actionResult;
  9554. }
  9555. // 通过条码查出责任工序(成品改判用)
  9556. if (action == "GetDutyProcedureByBarCodeForTamper")
  9557. {
  9558. string barcode = data["barcode"] + "";
  9559. int defectid = int.Parse(data["defectid"] + "");
  9560. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  9561. if (sre.Status == Constant.ServiceResultStatus.Success)
  9562. {
  9563. actionResult.Status = (int)Constant.PDAResult.Success;
  9564. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9565. actionResult.Message = sre.Message;
  9566. }
  9567. else
  9568. {
  9569. actionResult.Status = (int)Constant.PDAResult.Fail;
  9570. actionResult.Result = sre.OtherStatus;
  9571. actionResult.Message = sre.Message;
  9572. }
  9573. return actionResult;
  9574. }
  9575. }
  9576. #endregion
  9577. #region PDA独立功能
  9578. #region 水效标识
  9579. if (module == "WaterEffect")
  9580. {
  9581. // 获取产成品信息及水效标识
  9582. if (action == "GetGoodsByBarCode")
  9583. {
  9584. string barcode = data["barcode"].ToString();
  9585. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  9586. if (sre.Status == Constant.ServiceResultStatus.Success)
  9587. {
  9588. actionResult.Status = (int)Constant.PDAResult.Success;
  9589. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9590. actionResult.Message = sre.Message;
  9591. }
  9592. else
  9593. {
  9594. actionResult.Status = (int)Constant.PDAResult.Fail;
  9595. actionResult.Result = sre.OtherStatus;
  9596. actionResult.Message = sre.Message;
  9597. }
  9598. return actionResult;
  9599. }
  9600. }
  9601. #endregion
  9602. #region 盖板型号
  9603. if (module == "SeatCoverType")
  9604. {
  9605. // 获取产成品信息及水效标识
  9606. if (action == "SendGoodsCodeToPLC")
  9607. {
  9608. string barcode = data["barcode"].ToString();
  9609. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  9610. if (sre == 0)
  9611. {
  9612. actionResult.Status = (int)Constant.PDAResult.Success;
  9613. }
  9614. else
  9615. {
  9616. actionResult.Status = (int)Constant.PDAResult.Fail;
  9617. actionResult.Result = sre;
  9618. switch (sre)
  9619. {
  9620. case 1:
  9621. case 2:
  9622. actionResult.Message = "无效条码";
  9623. break;
  9624. case 3:
  9625. actionResult.Message = "此产品型号没有设置盖板标识码";
  9626. break;
  9627. case 4:
  9628. actionResult.Message = "当前用户没有设置PLC参数";
  9629. break;
  9630. case 5:
  9631. actionResult.Message = "PLC参数设置不全";
  9632. break;
  9633. default:
  9634. actionResult.Message = "PLC通信异常";
  9635. break;
  9636. }
  9637. }
  9638. return actionResult;
  9639. }
  9640. }
  9641. #endregion
  9642. #region PDA PLC 相关功能
  9643. if (module == "PDA_FUN_PLC")
  9644. {
  9645. // PDA扫码发送到PLCServer
  9646. if (action == "SendBarcodeToPLCServer")
  9647. {
  9648. string barcode = data["barcode"].ToString();
  9649. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  9650. if (sre == 0)
  9651. {
  9652. actionResult.Status = (int)Constant.PDAResult.Success;
  9653. }
  9654. else
  9655. {
  9656. actionResult.Status = (int)Constant.PDAResult.Fail;
  9657. actionResult.Result = sre;
  9658. switch (sre)
  9659. {
  9660. case 1:
  9661. case 2:
  9662. actionResult.Message = "无效条码";
  9663. break;
  9664. case 3:
  9665. actionResult.Message = "PLC通信异常";
  9666. break;
  9667. case 4:
  9668. actionResult.Message = "当前用户没有设置PLC参数";
  9669. break;
  9670. case 5:
  9671. actionResult.Message = "PLC参数设置不全";
  9672. break;
  9673. default:
  9674. actionResult.Message = "PLC通信异常";
  9675. break;
  9676. }
  9677. }
  9678. return actionResult;
  9679. }
  9680. }
  9681. #endregion
  9682. #endregion
  9683. #region 半检返修
  9684. if (module == "SemiRework")
  9685. {
  9686. // 验证半检返修条码
  9687. if (action == "CheckSemiReworkBarcode")
  9688. {
  9689. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9690. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  9691. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9692. if (Convert.ToInt32(resultEntity.Result) < 0)
  9693. {
  9694. actionResult.Status = (int)Constant.PDAResult.Fail;
  9695. }
  9696. else
  9697. {
  9698. actionResult.Status = (int)Constant.PDAResult.Success;
  9699. }
  9700. actionResult.Message = resultEntity.Message;
  9701. return actionResult;
  9702. }
  9703. // 可以返修的工序
  9704. if (action == "GetSemiReworkProcedure")
  9705. {
  9706. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9707. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  9708. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9709. actionResult.Status = (int)Constant.PDAResult.Success;
  9710. return actionResult;
  9711. }
  9712. // 根据条码获取经过的工序,用于责任工序
  9713. if (action == "GetSemiReworkPassProcedure")
  9714. {
  9715. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9716. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  9717. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9718. actionResult.Status = (int)Constant.PDAResult.Success;
  9719. return actionResult;
  9720. }
  9721. // 根据所选生产工序(生产数据ID)查询责任员工
  9722. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  9723. {
  9724. int productionDataID = Convert.ToInt32(jsonData);
  9725. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9726. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  9727. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9728. actionResult.Status = (int)Constant.PDAResult.Success;
  9729. return actionResult;
  9730. }
  9731. // 根据所选工号,查出缺陷责任员工
  9732. if (action == "GetSemiReworkDefectStaffByUserID")
  9733. {
  9734. int userID = Convert.ToInt32(jsonData);
  9735. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9736. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  9737. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9738. actionResult.Status = (int)Constant.PDAResult.Success;
  9739. return actionResult;
  9740. }
  9741. // 新建半检返修
  9742. if (action == "AddSemiRework")
  9743. {
  9744. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"]+"");
  9745. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9746. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  9747. actionResult.Result = resultEntity.Result;
  9748. actionResult.Message = resultEntity.Message;
  9749. if (Convert.ToInt32(resultEntity.Result) > 0)
  9750. {
  9751. actionResult.Status = (int)Constant.PDAResult.Success;
  9752. }
  9753. else
  9754. {
  9755. actionResult.Status = (int)Constant.PDAResult.Fail;
  9756. }
  9757. return actionResult;
  9758. }
  9759. // 编辑半检返修
  9760. if (action == "EditSemiRework")
  9761. {
  9762. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9763. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9764. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  9765. actionResult.Result = resultEntity.Result;
  9766. actionResult.Message = resultEntity.Message;
  9767. if (Convert.ToInt32(resultEntity.Result) > 0)
  9768. {
  9769. actionResult.Status = (int)Constant.PDAResult.Success;
  9770. }
  9771. else
  9772. {
  9773. actionResult.Status = (int)Constant.PDAResult.Fail;
  9774. }
  9775. return actionResult;
  9776. }
  9777. // 撤销半检返修
  9778. if (action == "CancelSemiRework")
  9779. {
  9780. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9781. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9782. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  9783. actionResult.Result = resultEntity.Result;
  9784. actionResult.Message = resultEntity.Message;
  9785. if (Convert.ToInt32(resultEntity.Result) > 0)
  9786. {
  9787. actionResult.Status = (int)Constant.PDAResult.Success;
  9788. }
  9789. else
  9790. {
  9791. actionResult.Status = (int)Constant.PDAResult.Fail;
  9792. }
  9793. return actionResult;
  9794. }
  9795. // 获取半检返修数据(PDA编辑用)
  9796. if (action == "GetSemiReworkByID")
  9797. {
  9798. int id = Convert.ToInt32(jsonData);
  9799. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9800. PMModuleLogic.GetSemiReworkByID(id,sUserInfo.UserCode);
  9801. DataTable data1 = resultEntity.Data.Tables[0];
  9802. DataTable data2 = resultEntity.Data.Tables[1];
  9803. DataTable data3 = resultEntity.Data.Tables[2];
  9804. if (data1.Rows.Count == 0)
  9805. {
  9806. actionResult.Status = (int)Constant.PDAResult.Fail;
  9807. actionResult.Message = "半检返修信息不存在";
  9808. return actionResult;
  9809. }
  9810. SemiReworkEntity srEntity = new SemiReworkEntity();
  9811. srEntity.SemiReworkID = id;
  9812. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  9813. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  9814. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  9815. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  9816. foreach (DataRow row2 in data2.Rows)
  9817. {
  9818. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  9819. srEntity.SemiReworkDefects.Add(defectEntity);
  9820. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  9821. defectEntity.SemiReworkID = id;
  9822. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  9823. defectEntity.DefectCode = row2["DefectCode"] + "";
  9824. defectEntity.DefectName = row2["DefectName"] + "";
  9825. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  9826. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  9827. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  9828. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  9829. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  9830. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  9831. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  9832. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  9833. defectEntity.Remarks = row2["Remarks"] + "";
  9834. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  9835. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  9836. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  9837. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  9838. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  9839. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  9840. if (row3s.Length == 0)
  9841. {
  9842. continue;
  9843. }
  9844. foreach (DataRow row3 in row3s)
  9845. {
  9846. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  9847. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  9848. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  9849. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  9850. semiReworkRPS.StaffName = row3["StaffName"] + "";
  9851. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  9852. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  9853. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  9854. semiReworkRPS.UserCode = row3["UserCode"] + "";
  9855. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  9856. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  9857. }
  9858. }
  9859. //xuwei note 总单用于显示,信息较全
  9860. actionResult.Message = JsonHelper.ToJson(data1);
  9861. //xuwei note 总单信息不全,但有明细,用于回传保存
  9862. actionResult.Result = JsonHelper.ToJson(srEntity);
  9863. actionResult.Status = (int)Constant.PDAResult.Success;
  9864. }
  9865. }
  9866. #endregion
  9867. return actionResult;
  9868. }
  9869. catch (Exception ex)
  9870. {
  9871. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  9872. OutputLog.TraceLog(LogPriority.Error,
  9873. this.ToString(),
  9874. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  9875. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  9876. " module:" + module + " action:" + action + " json:" + jsonData,
  9877. ex.ToString(),
  9878. LocalPath.LogExePath);
  9879. actionResult.Status = (int)Constant.PDAResult.Exception;
  9880. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  9881. }
  9882. return actionResult;
  9883. }
  9884. #endregion
  9885. }
  9886. }