PDAModuleService.cs 382 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:PDAModuleService.cs
  5. * 2.功能描述:PDA模块WCF服务
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 陈晓野 2014/09/16 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.IO;
  14. using System.ServiceModel;
  15. using System.ServiceModel.Activation;
  16. using Curtain.Log;
  17. using Dongke.IBOSS.PRD.Basics.BaseResources;
  18. using Dongke.IBOSS.PRD.Basics.Library;
  19. using Dongke.IBOSS.PRD.Service.BarcodePrintService;
  20. using Dongke.IBOSS.PRD.Service.CommonModuleLogic;
  21. using Dongke.IBOSS.PRD.Service.DataModels;
  22. using Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic;
  23. using Dongke.IBOSS.PRD.Service.PCModuleLogic;
  24. using Dongke.IBOSS.PRD.Service.PDAModuleLogic;
  25. using Dongke.IBOSS.PRD.Service.PMModuleLogic;
  26. using Dongke.IBOSS.PRD.Service.PublicModuleService;
  27. using Dongke.IBOSS.PRD.Service.ReportModuleLogic;
  28. using Dongke.IBOSS.PRD.Service.SmartDeviceService;
  29. using Dongke.IBOSS.PRD.Service.SystemModuleLogic;
  30. using Dongke.IBOSS.PRD.WCF.Contracts;
  31. using Dongke.IBOSS.PRD.WCF.DataModels;
  32. using Dongke.IBOSS.PRD.WCF.DataModels.ConfigModule;
  33. using Dongke.IBOSS.PRD.WCF.DataModels.HRModule;
  34. using Dongke.IBOSS.PRD.WCF.DataModels.PCModule;
  35. using Dongke.IBOSS.PRD.WCF.DataModels.PMModule;
  36. namespace Dongke.IBOSS.PRD.WCF.Services
  37. {
  38. // 服务实现类,继承服务声明接口
  39. // 该标签声明该服务可以在ASP.NET下运行
  40. [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
  41. [ServiceBehavior(ConfigurationName = "PDAModuleService",
  42. InstanceContextMode = InstanceContextMode.PerCall,
  43. ConcurrencyMode = ConcurrencyMode.Multiple,
  44. UseSynchronizationContext = false)]
  45. public partial class PDAModuleService : IPDAModule
  46. {
  47. #region 属性
  48. /// <summary>
  49. /// 用户登陆的信息
  50. /// </summary>
  51. SUserInfo sUserInfo
  52. {
  53. get;
  54. set;
  55. }
  56. #endregion
  57. #region 构造函数
  58. /// <summary>
  59. /// 构造函数
  60. /// </summary>
  61. public PDAModuleService()
  62. : base()
  63. {
  64. }
  65. #endregion
  66. #region 验证
  67. /// <summary>
  68. /// 验证访问头
  69. /// </summary>
  70. /// <param name="accountCode">帐套编码</param>
  71. /// <param name="userCode">用户编码</param>
  72. /// <param name="userPassword">用户密码</param>
  73. /// <param name="sessionKey">访问密钥</param>
  74. /// <returns></returns>
  75. private ActionResult DoPDACheck(string accountCode, string userCode, string userPassword, string sessionKey)
  76. {
  77. try
  78. {
  79. ActionResult actionResult = new ActionResult();
  80. LoginRequestEntity requestEntity = new LoginRequestEntity();
  81. requestEntity.AccountCode = accountCode;
  82. requestEntity.UserCode = userCode;
  83. requestEntity.Password = userPassword;
  84. requestEntity.SessionKey = sessionKey;
  85. SUserInfo userInfo = null;
  86. string loginStatus = DKIBOSSPRDLogic.AuthenticateRepeatLogin(requestEntity, out userInfo);
  87. // 用户登录信息错误
  88. if (Constant.INT_IS_ONE.ToString().Equals(loginStatus))
  89. {
  90. actionResult.Status = (int)Constant.PDAResult.LoginInfoError;
  91. actionResult.Message = Constant.PDA_RESULT_LOGININFOERROR;
  92. }
  93. // 用户在其它终端登陆
  94. else if (Constant.INT_IS_TWO.ToString().Equals(loginStatus))
  95. {
  96. actionResult.Status = (int)Constant.PDAResult.RepeatLogin;
  97. actionResult.Message = Constant.PDA_RESULT_REPEATLOGIN;
  98. }
  99. // Lic错误
  100. else if ("3".Equals(loginStatus))
  101. {
  102. actionResult.Status = (int)Constant.PDAResult.LicInfoError;
  103. actionResult.Message = "授权信息错误,请联系管理员。";
  104. }
  105. else
  106. {
  107. actionResult.Status = (int)Constant.PDAResult.Success;
  108. }
  109. sUserInfo = userInfo;
  110. return actionResult;
  111. }
  112. catch (Exception ex)
  113. {
  114. throw ex;
  115. }
  116. }
  117. #endregion
  118. #region WCF服务
  119. /// <summary>
  120. /// 测试PDA连接WCF服务
  121. /// </summary>
  122. /// <param name="value">测试文本</param>
  123. /// <returns>返回文本</returns>
  124. public string TestConnectionEx(string value)
  125. {
  126. return "连接成功!" + value;
  127. }
  128. public string TestConnection()
  129. {
  130. return "连接成功!";
  131. }
  132. #endregion
  133. #region 系统登录
  134. /// <summary>
  135. /// 系统登录
  136. /// </summary>
  137. /// <param name="accountCode"></param>
  138. /// <param name="userCode"></param>
  139. /// <param name="userPassword"></param>
  140. /// <param name="macAddress"></param>
  141. /// <param name="ipAddress"></param>
  142. /// <param name="phoneCode"></param>
  143. /// <param name="phoneType"></param>
  144. /// <param name="appVersion"></param>
  145. /// <param name="systemType"></param>
  146. /// <param name="systemVersion"></param>
  147. /// <returns></returns>
  148. public PDALoginResult DoPDALogin(string accountCode, string userCode, string userPassword,
  149. string macAddress, string ipAddress, string phoneCode, string phoneType,
  150. string appVersion, string systemType, string systemVersion)
  151. {
  152. try
  153. {
  154. LoginRequestEntity requestEntity = new LoginRequestEntity();
  155. requestEntity.AccountCode = accountCode;
  156. requestEntity.UserCode = userCode;
  157. requestEntity.Password = userPassword;
  158. requestEntity.ComputerName = phoneCode;
  159. requestEntity.IPAddress = ipAddress;
  160. requestEntity.MACAddress = macAddress;
  161. PDALoginResult result = ServiceInvoker.Invoke<PDALoginResult>(this,
  162. () => PDAModuleLogic.DoPDALogin(requestEntity));
  163. return result;
  164. }
  165. catch (Exception ex)
  166. {
  167. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  168. OutputLog.TraceLog(LogPriority.Error,
  169. this.ToString(),
  170. System.Reflection.MethodBase.GetCurrentMethod().Name,
  171. ex.ToString(),
  172. LocalPath.LogExePath);
  173. PDALoginResult result = new PDALoginResult();
  174. result.Status = (int)Constant.PDAResult.Exception;
  175. result.Message = Constant.PDA_RESULT_EXCEPTION;
  176. return result;
  177. }
  178. }
  179. /// <summary>
  180. /// 退出
  181. /// </summary>
  182. /// <param name="accountCode">帐套code</param>
  183. /// <param name="userCode">用户code</param>
  184. /// <param name="userPassword">用户密码</param>
  185. /// <param name="sessionKey">本次登陆密钥</param>
  186. /// <returns></returns>
  187. public ActionResult DoPDAOut(string accountCode, string userCode, string userPassword, string sessionKey)
  188. {
  189. ActionResult actionResult = new ActionResult();
  190. try
  191. {
  192. // 验证请求头信息
  193. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  194. // 验证失败
  195. if (actionResult.Status != (int)Constant.PDAResult.Success)
  196. {
  197. return actionResult;
  198. }
  199. bool result = DKIBOSSPRDLogic.Logout(sUserInfo.UserID, "3", sUserInfo);
  200. actionResult.Result = JsonHelper.ToJson(result);
  201. actionResult.Status = (int)Constant.PDAResult.Success;
  202. }
  203. catch (Exception ex)
  204. {
  205. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  206. OutputLog.TraceLog(LogPriority.Error,
  207. this.ToString(),
  208. System.Reflection.MethodBase.GetCurrentMethod().Name,
  209. ex.ToString(),
  210. LocalPath.LogExePath);
  211. actionResult.Status = (int)Constant.PDAResult.Exception;
  212. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  213. }
  214. return actionResult;
  215. }
  216. /// <summary>
  217. /// 修改密码
  218. /// </summary>
  219. /// <param name="accountCode"></param>
  220. /// <param name="userCode"></param>
  221. /// <param name="userPassword"></param>
  222. /// <param name="sessionKey"></param>
  223. /// <returns></returns>
  224. public ActionResult ChangeUserPassword(string accountCode, string userCode, string userPassword, string sessionKey,
  225. string newPassWord)
  226. {
  227. ActionResult actionResult = new ActionResult();
  228. try
  229. {
  230. // 验证请求头信息
  231. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  232. // 验证失败
  233. if (actionResult.Status != (int)Constant.PDAResult.Success)
  234. {
  235. return actionResult;
  236. }
  237. string result = ServiceInvoker.Invoke<string>(this,
  238. () => SystemModuleDAL.SaveUserPassWord(newPassWord, userCode, null, sUserInfo));
  239. actionResult.Status = (int)Constant.PDAResult.Success;
  240. }
  241. catch (Exception ex)
  242. {
  243. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  244. OutputLog.TraceLog(LogPriority.Error,
  245. this.ToString(),
  246. System.Reflection.MethodBase.GetCurrentMethod().Name,
  247. ex.ToString(),
  248. LocalPath.LogExePath);
  249. actionResult.Status = (int)Constant.PDAResult.Exception;
  250. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  251. }
  252. return actionResult;
  253. }
  254. #endregion
  255. #region 取得展示数据
  256. /// <summary>
  257. /// 获得生产线菜单
  258. /// </summary>
  259. /// <param name="accountCode">帐套code</param>
  260. /// <param name="userCode">用户code</param>
  261. /// <param name="userPassword">用户密码</param>
  262. /// <param name="sessionKey">本次登陆密钥</param>
  263. /// <returns></returns>
  264. /// <remarks>
  265. /// 陈冰 2014.09.18 新建
  266. /// </remarks>
  267. public ActionResult GetProductionLineMenu(string accountCode, string userCode, string userPassword, string sessionKey)
  268. {
  269. ActionResult actionResult = new ActionResult();
  270. try
  271. {
  272. // 验证请求头信息
  273. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  274. // 验证失败
  275. if (actionResult.Status != (int)Constant.PDAResult.Success)
  276. {
  277. return actionResult;
  278. }
  279. // 查询菜单
  280. DataTable dtPLM = ServiceInvoker.Invoke<DataTable>(this,
  281. () => PDAModuleLogic.GetProductionLineMenu(sUserInfo));
  282. PDAFunctionResult pdaFunction = new PDAFunctionResult();
  283. pdaFunction.MenuCode = "Root";
  284. DataRow[] navigationRows = dtPLM.Select("LEN(MenuCode) = " + Constant.INT_IS_TWO.ToString(), "MenuCode ASC"); // 编号2为一级菜单
  285. foreach (DataRow newRow in navigationRows)
  286. {
  287. #region 插入子节点数据
  288. int? intProcedureID = null;
  289. int? intModelType = null;
  290. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  291. {
  292. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  293. }
  294. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  295. {
  296. intModelType = Convert.ToInt32(newRow["ModelType"]);
  297. }
  298. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  299. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  300. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  301. pdaFunctionChild.ProcedureID = intProcedureID;
  302. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  303. pdaFunctionChild.ModelType = intModelType;
  304. pdaFunction.PDAFunctions.Add(pdaFunctionChild);
  305. #endregion
  306. InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild);
  307. }
  308. //actionResult.Result = JsonHelper.ToJson(dtPLM);
  309. actionResult.Result = JsonHelper.ToJson(pdaFunction);
  310. actionResult.Status = (int)Constant.PDAResult.Success;
  311. }
  312. catch (Exception ex)
  313. {
  314. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  315. OutputLog.TraceLog(LogPriority.Error,
  316. this.ToString(),
  317. System.Reflection.MethodBase.GetCurrentMethod().Name,
  318. ex.ToString(),
  319. LocalPath.LogExePath);
  320. actionResult.Status = (int)Constant.PDAResult.Exception;
  321. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  322. }
  323. return actionResult;
  324. }
  325. /// <summary>
  326. /// 初始化树形控件
  327. /// </summary>
  328. /// <param name="treeTable">菜单数据表</param>
  329. /// <param name="rows">待处理的菜单集合</param>
  330. /// <param name="node">当前树节点</param>
  331. private void InitTreeView(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions)
  332. {
  333. string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = "
  334. + (pFuncCode.Length + Constant.INT_IS_TWO);
  335. DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC");
  336. //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC");
  337. foreach (DataRow newRow in subRows)
  338. {
  339. #region 插入子节点数据
  340. int? intProcedureID = null;
  341. int? intModelType = null;
  342. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  343. {
  344. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  345. }
  346. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  347. {
  348. intModelType = Convert.ToInt32(newRow["ModelType"]);
  349. }
  350. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  351. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  352. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  353. pdaFunctionChild.ProcedureID = intProcedureID;
  354. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  355. pdaFunctionChild.ModelType = intModelType;
  356. pFunctions.PDAFunctions.Add(pdaFunctionChild);
  357. #endregion
  358. // 递归方法
  359. InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild);
  360. }
  361. }
  362. #endregion
  363. #region 获得工序信息
  364. /// <summary>
  365. /// 获得工序信息
  366. /// </summary>
  367. /// <param name="accountCode">帐套code</param>
  368. /// <param name="userCode">用户code</param>
  369. /// <param name="userPassword">用户密码</param>
  370. /// <param name="sessionKey">本次登陆密钥</param>
  371. /// <param name="procedureID">工序ID</param>
  372. /// <returns></returns>
  373. /// <remarks>
  374. /// 陈冰 2014.09.18 新建
  375. /// </remarks>
  376. public ActionResult GetProcedureByID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  377. {
  378. ActionResult actionResult = new ActionResult();
  379. try
  380. {
  381. // 验证请求头信息
  382. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  383. // 验证失败
  384. if (actionResult.Status != (int)Constant.PDAResult.Success)
  385. {
  386. return actionResult;
  387. }
  388. ProcedureEntity procedureEntity = ServiceInvoker.Invoke<ProcedureEntity>(this,
  389. () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo));
  390. actionResult.Result = JsonHelper.ToJson(procedureEntity);
  391. actionResult.Status = (int)Constant.PDAResult.Success;
  392. }
  393. catch (Exception ex)
  394. {
  395. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  396. OutputLog.TraceLog(LogPriority.Error,
  397. this.ToString(),
  398. System.Reflection.MethodBase.GetCurrentMethod().Name,
  399. ex.ToString(),
  400. LocalPath.LogExePath);
  401. actionResult.Status = (int)Constant.PDAResult.Exception;
  402. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  403. }
  404. return actionResult;
  405. }
  406. #endregion
  407. #region 校验
  408. /// <summary>
  409. /// 校验产品条码是否可以走到该工序
  410. /// </summary>
  411. /// <param name="accountCode">帐套code</param>
  412. /// <param name="userCode">用户code</param>
  413. /// <param name="userPassword">用户密码</param>
  414. /// <param name="sessionKey">本次登陆密钥</param>
  415. /// <param name="procedureID">工序ID</param>
  416. /// <param name="barcode">条码</param>
  417. /// <returns></returns>
  418. /// <remarks>
  419. /// 陈冰 2014.09.18 新建
  420. /// </remarks>
  421. public ActionResult CheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  422. {
  423. ActionResult actionResult = new ActionResult();
  424. try
  425. {
  426. // 验证请求头信息
  427. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  428. // 验证失败
  429. if (actionResult.Status != (int)Constant.PDAResult.Success)
  430. {
  431. return actionResult;
  432. }
  433. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  434. () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo));
  435. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  436. {
  437. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  438. actionResult.Status = (int)Constant.PDAResult.Success;
  439. }
  440. else
  441. {
  442. actionResult.Status = (int)Constant.PDAResult.Fail;
  443. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  444. }
  445. }
  446. catch (Exception ex)
  447. {
  448. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  449. OutputLog.TraceLog(LogPriority.Error,
  450. this.ToString(),
  451. System.Reflection.MethodBase.GetCurrentMethod().Name,
  452. ex.ToString(),
  453. LocalPath.LogExePath);
  454. actionResult.Status = (int)Constant.PDAResult.Exception;
  455. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  456. }
  457. return actionResult;
  458. }
  459. /// <summary>
  460. /// 校验产品条码是否可以进行干补
  461. /// </summary>
  462. /// <param name="accountCode">帐套code</param>
  463. /// <param name="userCode">用户code</param>
  464. /// <param name="userPassword">用户密码</param>
  465. /// <param name="sessionKey">本次登陆密钥</param>
  466. /// <param name="procedureID">工序ID</param>
  467. /// <param name="barcode">条码</param>
  468. /// <returns></returns>
  469. /// <remarks>
  470. /// 袁新成 2015.4.1 新建
  471. /// </remarks>
  472. public ActionResult CheckDryRepairBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  473. {
  474. ActionResult actionResult = new ActionResult();
  475. try
  476. {
  477. // 验证请求头信息
  478. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  479. // 验证失败
  480. if (actionResult.Status != (int)Constant.PDAResult.Success)
  481. {
  482. return actionResult;
  483. }
  484. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  485. () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
  486. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  487. {
  488. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  489. actionResult.Status = (int)Constant.PDAResult.Success;
  490. }
  491. else
  492. {
  493. actionResult.Status = (int)Constant.PDAResult.Fail;
  494. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  495. }
  496. }
  497. catch (Exception ex)
  498. {
  499. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  500. OutputLog.TraceLog(LogPriority.Error,
  501. this.ToString(),
  502. System.Reflection.MethodBase.GetCurrentMethod().Name,
  503. ex.ToString(),
  504. LocalPath.LogExePath);
  505. actionResult.Status = (int)Constant.PDAResult.Exception;
  506. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  507. }
  508. return actionResult;
  509. }
  510. /// <summary>
  511. /// 检验生产工号
  512. /// </summary>
  513. /// <param name="accountCode">帐套code</param>
  514. /// <param name="userCode">用户code</param>
  515. /// <param name="userPassword">用户密码</param>
  516. /// <param name="sessionKey">本次登陆密钥</param>
  517. /// <param name="procedureID">工序ID</param>
  518. /// <param name="procedureUserCode">生产工号</param>
  519. /// <remarks>
  520. /// 陈冰 2014.09.18 新建
  521. /// </remarks>
  522. public ActionResult CheckProcedureUser(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
  523. {
  524. ActionResult actionResult = new ActionResult();
  525. try
  526. {
  527. // 验证请求头信息
  528. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  529. // 验证失败
  530. if (actionResult.Status != (int)Constant.PDAResult.Success)
  531. {
  532. return actionResult;
  533. }
  534. CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
  535. () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
  536. actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
  537. actionResult.Status = (int)Constant.PDAResult.Success;
  538. }
  539. catch (Exception ex)
  540. {
  541. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  542. OutputLog.TraceLog(LogPriority.Error,
  543. this.ToString(),
  544. System.Reflection.MethodBase.GetCurrentMethod().Name,
  545. ex.ToString(),
  546. LocalPath.LogExePath);
  547. actionResult.Status = (int)Constant.PDAResult.Exception;
  548. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  549. }
  550. return actionResult;
  551. }
  552. /// <summary>
  553. /// 校验窑车是否可装车并返回窑车信息
  554. /// </summary>
  555. /// <param name="accountCode">帐套code</param>
  556. /// <param name="userCode">用户code</param>
  557. /// <param name="userPassword">用户密码</param>
  558. /// <param name="sessionKey">本次登陆密钥</param>
  559. /// <param name="kilnCarCode">窑车号</param>
  560. /// <param name="modelType">工序类别</param>
  561. /// <returns></returns>
  562. /// <remarks>
  563. /// 陈冰 2014.10.04 新建
  564. /// </remarks>
  565. public ActionResult CheckKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
  566. {
  567. ActionResult actionResult = new ActionResult();
  568. try
  569. {
  570. // 验证请求头信息
  571. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  572. // 验证失败
  573. if (actionResult.Status != (int)Constant.PDAResult.Success)
  574. {
  575. return actionResult;
  576. }
  577. CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
  578. () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
  579. actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
  580. actionResult.Status = (int)Constant.PDAResult.Success;
  581. }
  582. catch (Exception ex)
  583. {
  584. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  585. OutputLog.TraceLog(LogPriority.Error,
  586. this.ToString(),
  587. System.Reflection.MethodBase.GetCurrentMethod().Name,
  588. ex.ToString(),
  589. LocalPath.LogExePath);
  590. actionResult.Status = (int)Constant.PDAResult.Exception;
  591. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  592. }
  593. return actionResult;
  594. }
  595. #endregion
  596. #region 保存条码信息
  597. /// <summary>
  598. /// 保存条码信息
  599. /// </summary>
  600. /// <param name="accountCode">帐套code</param>
  601. /// <param name="userCode">用户code</param>
  602. /// <param name="userPassword">用户密码</param>
  603. /// <param name="sessionKey">本次登陆密钥</param>
  604. /// <param name="procedureID">工序ID</param>
  605. /// <param name="productionDataEntitys">条码信息</param>
  606. public ActionResult AddWorkPiece(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  607. {
  608. ActionResult actionResult = new ActionResult();
  609. try
  610. {
  611. // 验证请求头信息
  612. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  613. // 验证失败
  614. if (actionResult.Status != (int)Constant.PDAResult.Success)
  615. {
  616. return actionResult;
  617. }
  618. DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
  619. if (!dtProductionData.Columns.Contains("IsPDA"))
  620. {
  621. dtProductionData.Columns.Add("IsPDA");
  622. }
  623. ProcedureEntity procedureInfo = null;
  624. DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
  625. () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
  626. actionResult.Result = JsonHelper.ToJson(resultDT);
  627. actionResult.Status = (int)Constant.PDAResult.Success;
  628. if (resultDT != null)
  629. {
  630. DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
  631. if (drs != null && drs.Length > 0)
  632. {
  633. return actionResult;
  634. }
  635. }
  636. #region PDA条码打印
  637. if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
  638. procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
  639. {
  640. try
  641. {
  642. if (procedureInfo.CollectType == 1)
  643. {
  644. //foreach (DataRow item in dtProductionData.Rows)
  645. //{
  646. // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
  647. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  648. // if (sre.Status != Constant.ServiceResultStatus.Success)
  649. // {
  650. // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  651. // actionResult.Message = sre.Message;
  652. // return actionResult;
  653. // }
  654. //}
  655. }
  656. else
  657. {
  658. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
  659. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  660. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(dtProductionData.Rows[0]["barcode"].ToString(),
  661. procedureInfo.BarCodePrintCopies, null, sUserInfo, 0);
  662. if (sre.Status != Constant.ServiceResultStatus.Success)
  663. {
  664. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  665. actionResult.Message = sre.Message;
  666. return actionResult;
  667. }
  668. }
  669. }
  670. catch (Exception ex)
  671. {
  672. OutputLog.TraceLog(LogPriority.Error,
  673. this.ToString(),
  674. System.Reflection.MethodBase.GetCurrentMethod().Name,
  675. ex.ToString(),
  676. LocalPath.LogExePath);
  677. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  678. actionResult.Message = "条码打印异常";
  679. return actionResult;
  680. }
  681. }
  682. #endregion PDA条码打印
  683. }
  684. catch (Exception ex)
  685. {
  686. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  687. OutputLog.TraceLog(LogPriority.Error,
  688. this.ToString(),
  689. System.Reflection.MethodBase.GetCurrentMethod().Name,
  690. ex.ToString(),
  691. LocalPath.LogExePath);
  692. try
  693. {
  694. string ss = JsonHelper.ToJson(productionDataEntitys);
  695. OutputLog.TraceLog(LogPriority.Error,
  696. this.ToString(),
  697. System.Reflection.MethodBase.GetCurrentMethod().Name,
  698. $" userCode:{userCode} procedureID:{procedureID} " + ss,
  699. LocalPath.LogExePath);
  700. }
  701. catch
  702. {
  703. }
  704. actionResult.Status = (int)Constant.PDAResult.Exception;
  705. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  706. }
  707. return actionResult;
  708. }
  709. #endregion
  710. #region 获得系统/基数数据
  711. /// <summary>
  712. /// 获得数据字典
  713. /// </summary>
  714. /// <param name="accountCode">帐套code</param>
  715. /// <param name="userCode">用户code</param>
  716. /// <param name="userPassword">用户密码</param>
  717. /// <param name="sessionKey">本次登陆密钥</param>
  718. /// <param name="dicType">字典类型</param>
  719. /// <returns></returns>
  720. public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  721. {
  722. ActionResult actionResult = new ActionResult();
  723. try
  724. {
  725. // 验证请求头信息
  726. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  727. // 验证失败
  728. if (actionResult.Status != (int)Constant.PDAResult.Success)
  729. {
  730. return actionResult;
  731. }
  732. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  733. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  734. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  735. actionResult.Status = (int)Constant.PDAResult.Success;
  736. }
  737. catch (Exception ex)
  738. {
  739. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  740. OutputLog.TraceLog(LogPriority.Error,
  741. this.ToString(),
  742. System.Reflection.MethodBase.GetCurrentMethod().Name,
  743. ex.ToString(),
  744. LocalPath.LogExePath);
  745. actionResult.Status = (int)Constant.PDAResult.Exception;
  746. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  747. }
  748. return actionResult;
  749. }
  750. #endregion
  751. #region 检验工序接口
  752. /// <summary>
  753. /// 获得检验标识
  754. /// </summary>
  755. /// <param name="accountCode">帐套code</param>
  756. /// <param name="userCode">用户code</param>
  757. /// <param name="userPassword">用户密码</param>
  758. /// <param name="sessionKey">本次登陆密钥</param>
  759. /// <returns></returns>
  760. /// <remarks>
  761. /// 陈冰 2014.10.04 新建
  762. /// </remarks>
  763. public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey)
  764. {
  765. ActionResult actionResult = new ActionResult();
  766. try
  767. {
  768. // 验证请求头信息
  769. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  770. // 验证失败
  771. if (actionResult.Status != (int)Constant.PDAResult.Success)
  772. {
  773. return actionResult;
  774. }
  775. #region 构造缺陷标识的数据源
  776. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  777. #endregion
  778. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  779. actionResult.Status = (int)Constant.PDAResult.Success;
  780. }
  781. catch (Exception ex)
  782. {
  783. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  784. OutputLog.TraceLog(LogPriority.Error,
  785. this.ToString(),
  786. System.Reflection.MethodBase.GetCurrentMethod().Name,
  787. ex.ToString(),
  788. LocalPath.LogExePath);
  789. actionResult.Status = (int)Constant.PDAResult.Exception;
  790. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  791. }
  792. return actionResult;
  793. }
  794. /// <summary>
  795. /// 由条码和当前检验工序获取返工工序
  796. /// </summary>
  797. /// <param name="accountCode">帐套code</param>
  798. /// <param name="userCode">用户code</param>
  799. /// <param name="userPassword">用户密码</param>
  800. /// <param name="sessionKey">本次登陆密钥</param>
  801. /// <param name="procedureID">当前检验工序ID</param>
  802. /// <param name="barcode">条码</param>
  803. /// <returns></returns>
  804. /// <remarks>
  805. /// 陈冰 2014.10.04 新建
  806. /// </remarks>
  807. public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  808. {
  809. ActionResult actionResult = new ActionResult();
  810. try
  811. {
  812. // 验证请求头信息
  813. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  814. // 验证失败
  815. if (actionResult.Status != (int)Constant.PDAResult.Success)
  816. {
  817. return actionResult;
  818. }
  819. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  820. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  821. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  822. {
  823. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  824. actionResult.Status = (int)Constant.PDAResult.Success;
  825. }
  826. else
  827. {
  828. actionResult.Status = (int)Constant.PDAResult.Fail;
  829. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  830. }
  831. }
  832. catch (Exception ex)
  833. {
  834. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  835. OutputLog.TraceLog(LogPriority.Error,
  836. this.ToString(),
  837. System.Reflection.MethodBase.GetCurrentMethod().Name,
  838. ex.ToString(),
  839. LocalPath.LogExePath);
  840. actionResult.Status = (int)Constant.PDAResult.Exception;
  841. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  842. }
  843. return actionResult;
  844. }
  845. /// <summary>
  846. /// 由当前检验工序获取缺陷列表
  847. /// </summary>
  848. /// <param name="accountCode">帐套code</param>
  849. /// <param name="userCode">用户code</param>
  850. /// <param name="userPassword">用户密码</param>
  851. /// <param name="sessionKey">本次登陆密钥</param>
  852. /// <param name="procedureID">当前检验工序ID</param>
  853. /// <param name="defectCode">缺陷编码</param>
  854. /// <returns></returns>
  855. /// <remarks>
  856. /// 陈冰 2014.10.04 新建
  857. /// </remarks>
  858. public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  859. {
  860. ActionResult actionResult = new ActionResult();
  861. try
  862. {
  863. // 验证请求头信息
  864. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  865. // 验证失败
  866. if (actionResult.Status != (int)Constant.PDAResult.Success)
  867. {
  868. return actionResult;
  869. }
  870. object defectDs = ServiceInvoker.Invoke<object>(this,
  871. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  872. if (defectDs != null)
  873. {
  874. actionResult.Result = JsonHelper.ToJson(defectDs);
  875. actionResult.Status = (int)Constant.PDAResult.Success;
  876. }
  877. else
  878. {
  879. actionResult.Status = (int)Constant.PDAResult.Fail;
  880. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  881. }
  882. }
  883. catch (Exception ex)
  884. {
  885. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  886. OutputLog.TraceLog(LogPriority.Error,
  887. this.ToString(),
  888. System.Reflection.MethodBase.GetCurrentMethod().Name,
  889. ex.ToString(),
  890. LocalPath.LogExePath);
  891. actionResult.Status = (int)Constant.PDAResult.Exception;
  892. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  893. }
  894. return actionResult;
  895. }
  896. /// <summary>
  897. /// 根据产品ID查出缺陷位置
  898. /// </summary>
  899. /// <param name="accountCode">帐套code</param>
  900. /// <param name="userCode">用户code</param>
  901. /// <param name="userPassword">用户密码</param>
  902. /// <param name="sessionKey">本次登陆密钥</param>
  903. /// <param name="goodsID">产品ID</param>
  904. /// <param name="positionCode">位置编码</param>
  905. /// <returns></returns>
  906. /// <remarks>
  907. /// 陈冰 2014.10.04 新建
  908. /// </remarks>
  909. public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  910. {
  911. ActionResult actionResult = new ActionResult();
  912. try
  913. {
  914. // 验证请求头信息
  915. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  916. // 验证失败
  917. if (actionResult.Status != (int)Constant.PDAResult.Success)
  918. {
  919. return actionResult;
  920. }
  921. // 缺陷位置已经不用在关联产品
  922. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  923. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  924. if (defectDs != null)
  925. {
  926. actionResult.Result = JsonHelper.ToJson(defectDs);
  927. actionResult.Status = (int)Constant.PDAResult.Success;
  928. }
  929. else
  930. {
  931. actionResult.Status = (int)Constant.PDAResult.Fail;
  932. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  933. }
  934. }
  935. catch (Exception ex)
  936. {
  937. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  938. OutputLog.TraceLog(LogPriority.Error,
  939. this.ToString(),
  940. System.Reflection.MethodBase.GetCurrentMethod().Name,
  941. ex.ToString(),
  942. LocalPath.LogExePath);
  943. actionResult.Status = (int)Constant.PDAResult.Exception;
  944. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  945. }
  946. return actionResult;
  947. }
  948. /// <summary>
  949. /// 通过条码和缺陷查出责任工序
  950. /// </summary>
  951. /// <param name="accountCode">帐套code</param>
  952. /// <param name="userCode">用户code</param>
  953. /// <param name="userPassword">用户密码</param>
  954. /// <param name="sessionKey">本次登陆密钥</param>
  955. /// <param name="barcode">条码</param>
  956. /// <param name="defectid">缺陷ID</param>
  957. /// <returns></returns>
  958. /// <remarks>
  959. /// 陈冰 2014.10.04 新建
  960. /// </remarks>
  961. public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  962. {
  963. ActionResult actionResult = new ActionResult();
  964. try
  965. {
  966. // 验证请求头信息
  967. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  968. // 验证失败
  969. if (actionResult.Status != (int)Constant.PDAResult.Success)
  970. {
  971. return actionResult;
  972. }
  973. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  974. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  975. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  976. {
  977. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  978. actionResult.Status = (int)Constant.PDAResult.Success;
  979. }
  980. else
  981. {
  982. actionResult.Status = (int)Constant.PDAResult.Fail;
  983. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  984. }
  985. }
  986. catch (Exception ex)
  987. {
  988. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  989. OutputLog.TraceLog(LogPriority.Error,
  990. this.ToString(),
  991. System.Reflection.MethodBase.GetCurrentMethod().Name,
  992. ex.ToString(),
  993. LocalPath.LogExePath);
  994. actionResult.Status = (int)Constant.PDAResult.Exception;
  995. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  996. }
  997. return actionResult;
  998. }
  999. /// <summary>
  1000. /// 通过条码与工序查出责任工号(己废)
  1001. /// </summary>
  1002. /// <param name="accountCode">帐套code</param>
  1003. /// <param name="userCode">用户code</param>
  1004. /// <param name="userPassword">用户密码</param>
  1005. /// <param name="sessionKey">本次登陆密钥</param>
  1006. /// <param name="barcode">条码</param>
  1007. /// <param name="dutyProcedureID">责任工序</param>
  1008. /// <returns></returns>
  1009. /// <remarks>
  1010. /// 陈冰 2014.10.04 新建
  1011. /// </remarks>
  1012. public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  1013. {
  1014. ActionResult actionResult = new ActionResult();
  1015. try
  1016. {
  1017. // 验证请求头信息
  1018. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1019. // 验证失败
  1020. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1021. {
  1022. return actionResult;
  1023. }
  1024. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1025. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  1026. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1027. {
  1028. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1029. actionResult.Status = (int)Constant.PDAResult.Success;
  1030. }
  1031. else
  1032. {
  1033. actionResult.Status = (int)Constant.PDAResult.Fail;
  1034. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1035. }
  1036. }
  1037. catch (Exception ex)
  1038. {
  1039. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1040. OutputLog.TraceLog(LogPriority.Error,
  1041. this.ToString(),
  1042. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1043. ex.ToString(),
  1044. LocalPath.LogExePath);
  1045. actionResult.Status = (int)Constant.PDAResult.Exception;
  1046. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1047. }
  1048. return actionResult;
  1049. }
  1050. /// <summary>
  1051. /// 通过条码与工序查出责任工号
  1052. /// </summary>
  1053. /// <param name="accountCode"></param>
  1054. /// <param name="userCode"></param>
  1055. /// <param name="userPassword"></param>
  1056. /// <param name="sessionKey"></param>
  1057. /// <param name="ProductionDataID">生产数据ID</param>
  1058. /// <returns></returns>
  1059. public ActionResult GetDutyProcedureCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1060. {
  1061. ActionResult actionResult = new ActionResult();
  1062. try
  1063. {
  1064. // 验证请求头信息
  1065. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1066. // 验证失败
  1067. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1068. {
  1069. return actionResult;
  1070. }
  1071. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1072. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1073. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1074. {
  1075. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1076. actionResult.Status = (int)Constant.PDAResult.Success;
  1077. }
  1078. else
  1079. {
  1080. actionResult.Status = (int)Constant.PDAResult.Fail;
  1081. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1082. }
  1083. }
  1084. catch (Exception ex)
  1085. {
  1086. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1087. OutputLog.TraceLog(LogPriority.Error,
  1088. this.ToString(),
  1089. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1090. ex.ToString(),
  1091. LocalPath.LogExePath);
  1092. actionResult.Status = (int)Constant.PDAResult.Exception;
  1093. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1094. }
  1095. return actionResult;
  1096. }
  1097. /// <summary>
  1098. /// 通过生产数据与工号ID查询工种
  1099. /// </summary>
  1100. /// <param name="accountCode">帐套code</param>
  1101. /// <param name="userCode">用户code</param>
  1102. /// <param name="userPassword">用户密码</param>
  1103. /// <param name="sessionKey">本次登陆密钥</param>
  1104. /// <param name="productionDataID">生产数据ID</param>
  1105. /// <param name="userID">工号ID</param>
  1106. /// <returns></returns>
  1107. /// <remarks>
  1108. /// 陈冰 2014.10.08 新建
  1109. /// </remarks>
  1110. public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey,
  1111. //int productionDataID, int userID)
  1112. int classesSettingID, int defectid, int procedureID)
  1113. {
  1114. ActionResult actionResult = new ActionResult();
  1115. try
  1116. {
  1117. // 验证请求头信息
  1118. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1119. // 验证失败
  1120. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1121. {
  1122. return actionResult;
  1123. }
  1124. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1125. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1126. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  1127. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1128. {
  1129. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1130. actionResult.Status = (int)Constant.PDAResult.Success;
  1131. }
  1132. else
  1133. {
  1134. actionResult.Status = (int)Constant.PDAResult.Fail;
  1135. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1136. }
  1137. }
  1138. catch (Exception ex)
  1139. {
  1140. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1141. OutputLog.TraceLog(LogPriority.Error,
  1142. this.ToString(),
  1143. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1144. ex.ToString(),
  1145. LocalPath.LogExePath);
  1146. actionResult.Status = (int)Constant.PDAResult.Exception;
  1147. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1148. }
  1149. return actionResult;
  1150. }
  1151. /// <summary>
  1152. /// 根据生产数据ID,用户ID及工种选出责任员工
  1153. /// </summary>
  1154. /// <param name="accountCode">帐套code</param>
  1155. /// <param name="userCode">用户code</param>
  1156. /// <param name="userPassword">用户密码</param>
  1157. /// <param name="sessionKey">本次登陆密钥</param>
  1158. /// <param name="productionDataID">生产数据ID</param>
  1159. /// <param name="userID">工号ID</param>
  1160. /// <param name="jobsID">工种ID</param>
  1161. /// <returns></returns>
  1162. /// <remarks>
  1163. /// 陈冰 2014.10.08 新建
  1164. /// </remarks>
  1165. public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey,
  1166. //int productionDataID, int userID, int jobsID)
  1167. int classesSettingID, int jobsID)
  1168. {
  1169. ActionResult actionResult = new ActionResult();
  1170. try
  1171. {
  1172. // 验证请求头信息
  1173. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1174. // 验证失败
  1175. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1176. {
  1177. return actionResult;
  1178. }
  1179. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1180. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1181. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1182. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1183. {
  1184. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1185. actionResult.Status = (int)Constant.PDAResult.Success;
  1186. }
  1187. else
  1188. {
  1189. actionResult.Status = (int)Constant.PDAResult.Fail;
  1190. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1191. }
  1192. }
  1193. catch (Exception ex)
  1194. {
  1195. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1196. OutputLog.TraceLog(LogPriority.Error,
  1197. this.ToString(),
  1198. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1199. ex.ToString(),
  1200. LocalPath.LogExePath);
  1201. actionResult.Status = (int)Constant.PDAResult.Exception;
  1202. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1203. }
  1204. return actionResult;
  1205. }
  1206. /// <summary>
  1207. /// 获得产品分级
  1208. /// </summary>
  1209. /// <param name="accountCode">帐套code</param>
  1210. /// <param name="userCode">用户code</param>
  1211. /// <param name="userPassword">用户密码</param>
  1212. /// <param name="sessionKey">本次登陆密钥</param>
  1213. /// <returns></returns>
  1214. /// <remarks>
  1215. /// 陈冰 2014.10.08 新建
  1216. /// </remarks>
  1217. public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey)
  1218. {
  1219. ActionResult actionResult = new ActionResult();
  1220. try
  1221. {
  1222. // 验证请求头信息
  1223. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1224. // 验证失败
  1225. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1226. {
  1227. return actionResult;
  1228. }
  1229. #region 构造产品分级的数据源
  1230. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1231. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2, sUserInfo);
  1232. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1233. {
  1234. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1235. actionResult.Status = (int)Constant.PDAResult.Success;
  1236. }
  1237. else
  1238. {
  1239. actionResult.Status = (int)Constant.PDAResult.Fail;
  1240. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1241. }
  1242. #endregion
  1243. }
  1244. catch (Exception ex)
  1245. {
  1246. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1247. OutputLog.TraceLog(LogPriority.Error,
  1248. this.ToString(),
  1249. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1250. ex.ToString(),
  1251. LocalPath.LogExePath);
  1252. OutputLog.TraceLog(LogPriority.Error,
  1253. this.ToString(),
  1254. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1255. ex.ToString(),
  1256. LocalPath.LogExePath);
  1257. actionResult.Status = (int)Constant.PDAResult.Exception;
  1258. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1259. }
  1260. return actionResult;
  1261. }
  1262. #endregion
  1263. #region 保存检验条码
  1264. /// <summary>
  1265. /// 保存检验条码
  1266. /// </summary>
  1267. /// <param name="accountCode">帐套code</param>
  1268. /// <param name="userCode">用户code</param>
  1269. /// <param name="userPassword">用户密码</param>
  1270. /// <param name="sessionKey">本次登陆密钥</param>
  1271. /// <param name="procedureID">工序ID</param>
  1272. /// <param name="productionDataEntitys">条码信息</param>
  1273. /// <returns></returns>
  1274. public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1275. {
  1276. ActionResult actionResult = new ActionResult();
  1277. try
  1278. {
  1279. // 验证请求头信息
  1280. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1281. // 验证失败
  1282. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1283. {
  1284. return actionResult;
  1285. }
  1286. //if(productionDataEntitys.Length>0)
  1287. //{
  1288. // if(productionDataEntitys[0].ProductionDataID>0)
  1289. // {
  1290. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1291. // }
  1292. //}
  1293. string err = ServiceInvoker.Invoke<string>(this,
  1294. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1295. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1296. if (err == null)
  1297. {
  1298. err = "";
  1299. }
  1300. //actionResult.Result = JsonHelper.ToJson(err);
  1301. actionResult.Result = err;// JsonHelper.ToJson(err);
  1302. actionResult.Status = (int)Constant.PDAResult.Success;
  1303. }
  1304. catch (Exception ex)
  1305. {
  1306. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1307. OutputLog.TraceLog(LogPriority.Error,
  1308. this.ToString(),
  1309. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1310. ex.ToString(),
  1311. LocalPath.LogExePath);
  1312. actionResult.Status = (int)Constant.PDAResult.Exception;
  1313. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1314. }
  1315. return actionResult;
  1316. }
  1317. #endregion
  1318. #region 文件上传下载
  1319. /// <summary>
  1320. /// 软件更新
  1321. /// </summary>
  1322. /// <param name="accountCode">帐套code</param>
  1323. /// <param name="userCode">用户code</param>
  1324. /// <param name="userPassword">用户密码</param>
  1325. /// <param name="sessionKey">本次登陆密钥</param>
  1326. /// <returns></returns>
  1327. public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey)
  1328. {
  1329. try
  1330. {
  1331. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1332. }
  1333. catch (Exception ex)
  1334. {
  1335. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1336. OutputLog.TraceLog(LogPriority.Error,
  1337. this.ToString(),
  1338. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1339. ex.ToString(),
  1340. LocalPath.LogExePath);
  1341. return null;
  1342. }
  1343. }
  1344. /// <summary>
  1345. /// 上传临时文件
  1346. /// </summary>
  1347. /// <param name="imgStream"></param>
  1348. /// <returns></returns>
  1349. public ActionResult SaveImg(Stream mageStream)
  1350. {
  1351. ActionResult actionResult = new ActionResult();
  1352. try
  1353. {
  1354. string err = PDAModuleLogic.SaveImg(mageStream);
  1355. if (err == null)
  1356. {
  1357. err = "";
  1358. }
  1359. actionResult.Result = err;
  1360. actionResult.Status = (int)Constant.PDAResult.Success;
  1361. }
  1362. catch (Exception ex)
  1363. {
  1364. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1365. OutputLog.TraceLog(LogPriority.Error,
  1366. this.ToString(),
  1367. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1368. ex.ToString(),
  1369. LocalPath.LogExePath);
  1370. actionResult.Status = (int)Constant.PDAResult.Exception;
  1371. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1372. }
  1373. return actionResult;
  1374. }
  1375. public Stream GetFileTest(string path)
  1376. {
  1377. return PDAModuleLogic.GetImg(path);
  1378. }
  1379. public Stream GetFileStream()
  1380. {
  1381. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1382. long l = fs.Length;
  1383. return fs;
  1384. }
  1385. public byte[] GetFileTestByte(string path)
  1386. {
  1387. FileStream stream = new FileInfo(path).OpenRead();
  1388. Byte[] buffer = new Byte[stream.Length];
  1389. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1390. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1391. return buffer;
  1392. }
  1393. public string GetFile(string path)
  1394. {
  1395. string imgFilePath = path;
  1396. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1397. int i = (int)fs.Length;
  1398. byte[] content = new byte[i];
  1399. fs.Read(content, 0, i);
  1400. string result = Convert.ToBase64String(content);
  1401. fs.Close();
  1402. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1403. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1404. sw.Write(result);
  1405. sw.Close();
  1406. fsTxt.Close();
  1407. return result;
  1408. }
  1409. #endregion
  1410. /// <summary>
  1411. /// 获得产品分级
  1412. /// </summary>
  1413. /// <param name="accountCode">帐套code</param>
  1414. /// <param name="userCode">用户code</param>
  1415. /// <param name="userPassword">用户密码</param>
  1416. /// <param name="sessionKey">本次登陆密钥</param>
  1417. /// <param name="procedureID">当前工序ID</param>
  1418. /// <returns></returns>
  1419. /// <remarks>
  1420. /// 陈冰 2014.10.22 新建
  1421. /// </remarks>
  1422. public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1423. {
  1424. ActionResult actionResult = new ActionResult();
  1425. try
  1426. {
  1427. // 验证请求头信息
  1428. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1429. // 验证失败
  1430. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1431. {
  1432. return actionResult;
  1433. }
  1434. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1435. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1436. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1437. {
  1438. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1439. actionResult.Status = (int)Constant.PDAResult.Success;
  1440. }
  1441. else
  1442. {
  1443. actionResult.Status = (int)Constant.PDAResult.Fail;
  1444. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1445. }
  1446. }
  1447. catch (Exception ex)
  1448. {
  1449. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1450. OutputLog.TraceLog(LogPriority.Error,
  1451. this.ToString(),
  1452. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1453. ex.ToString(),
  1454. LocalPath.LogExePath);
  1455. actionResult.Status = (int)Constant.PDAResult.Exception;
  1456. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1457. }
  1458. return actionResult;
  1459. }
  1460. /// <summary>
  1461. /// 获得产品分级
  1462. /// </summary>
  1463. /// <param name="accountCode">帐套code</param>
  1464. /// <param name="userCode">用户code</param>
  1465. /// <param name="userPassword">用户密码</param>
  1466. /// <param name="sessionKey">本次登陆密钥</param>
  1467. /// <param name="barcode">条码</param>
  1468. /// <returns></returns>
  1469. public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1470. {
  1471. ActionResult actionResult = new ActionResult();
  1472. try
  1473. {
  1474. // 验证请求头信息
  1475. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1476. // 验证失败
  1477. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1478. {
  1479. return actionResult;
  1480. }
  1481. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1482. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1483. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1484. {
  1485. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1486. actionResult.Status = (int)Constant.PDAResult.Success;
  1487. }
  1488. else
  1489. {
  1490. actionResult.Status = (int)Constant.PDAResult.Fail;
  1491. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1492. }
  1493. }
  1494. catch (Exception ex)
  1495. {
  1496. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1497. OutputLog.TraceLog(LogPriority.Error,
  1498. this.ToString(),
  1499. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1500. ex.ToString(),
  1501. LocalPath.LogExePath);
  1502. actionResult.Status = (int)Constant.PDAResult.Exception;
  1503. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1504. }
  1505. return actionResult;
  1506. }
  1507. #region 统计
  1508. /// <summary>
  1509. /// 统计当日计数数量
  1510. /// </summary>
  1511. /// <param name="accountCode">帐套code</param>
  1512. /// <param name="userCode">用户code</param>
  1513. /// <param name="userPassword">用户密码</param>
  1514. /// <param name="sessionKey">本次登陆密钥</param>
  1515. /// <param name="procedureID">工序ID</param>
  1516. /// <returns></returns>
  1517. public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1518. {
  1519. ActionResult actionResult = new ActionResult();
  1520. try
  1521. {
  1522. // 验证请求头信息
  1523. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1524. // 验证失败
  1525. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1526. {
  1527. return actionResult;
  1528. }
  1529. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1530. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1531. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1532. {
  1533. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1534. actionResult.Status = (int)Constant.PDAResult.Success;
  1535. }
  1536. else
  1537. {
  1538. actionResult.Status = (int)Constant.PDAResult.Fail;
  1539. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1540. }
  1541. }
  1542. catch (Exception ex)
  1543. {
  1544. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1545. OutputLog.TraceLog(LogPriority.Error,
  1546. this.ToString(),
  1547. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1548. ex.ToString(),
  1549. LocalPath.LogExePath);
  1550. actionResult.Status = (int)Constant.PDAResult.Exception;
  1551. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1552. }
  1553. return actionResult;
  1554. }
  1555. /// <summary>
  1556. /// 统计当日计数数量
  1557. /// </summary>
  1558. /// <param name="accountCode">帐套code</param>
  1559. /// <param name="userCode">用户code</param>
  1560. /// <param name="userPassword">用户密码</param>
  1561. /// <param name="sessionKey">本次登陆密钥</param>
  1562. /// <param name="procedureID">工序ID</param>
  1563. /// <returns></returns>
  1564. public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1565. {
  1566. ActionResult actionResult = new ActionResult();
  1567. try
  1568. {
  1569. // 验证请求头信息
  1570. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1571. // 验证失败
  1572. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1573. {
  1574. return actionResult;
  1575. }
  1576. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1577. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1578. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1579. {
  1580. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1581. actionResult.Status = (int)Constant.PDAResult.Success;
  1582. }
  1583. else
  1584. {
  1585. actionResult.Status = (int)Constant.PDAResult.Fail;
  1586. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1587. }
  1588. }
  1589. catch (Exception ex)
  1590. {
  1591. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1592. OutputLog.TraceLog(LogPriority.Error,
  1593. this.ToString(),
  1594. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1595. ex.ToString(),
  1596. LocalPath.LogExePath);
  1597. actionResult.Status = (int)Constant.PDAResult.Exception;
  1598. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1599. }
  1600. return actionResult;
  1601. }
  1602. /// <summary>
  1603. /// 统计产品跟踪
  1604. /// </summary>
  1605. /// <param name="accountCode">帐套code</param>
  1606. /// <param name="userCode">用户code</param>
  1607. /// <param name="userPassword">用户密码</param>
  1608. /// <param name="sessionKey">本次登陆密钥</param>
  1609. /// <param name="procedureID">工序ID</param>
  1610. /// <returns></returns>
  1611. public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1612. {
  1613. ActionResult actionResult = new ActionResult();
  1614. try
  1615. {
  1616. // 验证请求头信息
  1617. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1618. // 验证失败
  1619. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1620. {
  1621. return actionResult;
  1622. }
  1623. RPT020101_SE se = new RPT020101_SE();
  1624. se.Barcode = barcode;
  1625. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1626. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1627. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1628. {
  1629. actionResult.Status = (int)Constant.PDAResult.Fail;
  1630. actionResult.Message = Messages.MSG_CMN_I002;
  1631. }
  1632. else
  1633. {
  1634. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1635. actionResult.Status = (int)Constant.PDAResult.Success;
  1636. }
  1637. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1638. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1639. //if (productionDataEntity != null)
  1640. //{
  1641. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1642. // actionResult.Status = (int)Constant.PDAResult.Success;
  1643. //}
  1644. //else
  1645. //{
  1646. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1647. // actionResult.Message = Messages.MSG_CMN_I002;
  1648. //}
  1649. }
  1650. catch (Exception ex)
  1651. {
  1652. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1653. OutputLog.TraceLog(LogPriority.Error,
  1654. this.ToString(),
  1655. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1656. ex.ToString() + ex.HelpLink,
  1657. LocalPath.LogExePath);
  1658. actionResult.Status = (int)Constant.PDAResult.Exception;
  1659. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1660. }
  1661. return actionResult;
  1662. }
  1663. #endregion
  1664. #region 撤销装车及成检
  1665. /// <summary>
  1666. /// 检验条码是否可以撤销装车
  1667. /// </summary>
  1668. /// <param name="accountCode">帐套code</param>
  1669. /// <param name="userCode">用户code</param>
  1670. /// <param name="userPassword">用户密码</param>
  1671. /// <param name="sessionKey">本次登陆密钥</param>
  1672. /// <param name="procedureID">当前工序ID</param>
  1673. /// <param name="barcode">条码</param>
  1674. /// <returns></returns>
  1675. public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1676. {
  1677. ActionResult actionResult = new ActionResult();
  1678. try
  1679. {
  1680. // 验证请求头信息
  1681. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1682. // 验证失败
  1683. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1684. {
  1685. return actionResult;
  1686. }
  1687. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1688. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1689. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1690. actionResult.Status = (int)Constant.PDAResult.Success;
  1691. }
  1692. catch (Exception ex)
  1693. {
  1694. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1695. OutputLog.TraceLog(LogPriority.Error,
  1696. this.ToString(),
  1697. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1698. ex.ToString(),
  1699. LocalPath.LogExePath);
  1700. actionResult.Status = (int)Constant.PDAResult.Exception;
  1701. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1702. }
  1703. return actionResult;
  1704. }
  1705. /// <summary>
  1706. /// 保存撤销装车的条码
  1707. /// </summary>
  1708. /// <param name="accountCode">帐套code</param>
  1709. /// <param name="userCode">用户code</param>
  1710. /// <param name="userPassword">用户密码</param>
  1711. /// <param name="sessionKey">本次登陆密钥</param>
  1712. /// <param name="procedureID">当前工序ID</param>
  1713. /// <param name="barcode">条码</param>
  1714. /// <returns></returns>
  1715. public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1716. {
  1717. ActionResult actionResult = new ActionResult();
  1718. try
  1719. {
  1720. // 验证请求头信息
  1721. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1722. // 验证失败
  1723. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1724. {
  1725. return actionResult;
  1726. }
  1727. string err = ServiceInvoker.Invoke<string>(this,
  1728. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1729. if (err == null)
  1730. {
  1731. err = "";
  1732. }
  1733. actionResult.Result = JsonHelper.ToJson(err);
  1734. actionResult.Status = (int)Constant.PDAResult.Success;
  1735. }
  1736. catch (Exception ex)
  1737. {
  1738. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1739. OutputLog.TraceLog(LogPriority.Error,
  1740. this.ToString(),
  1741. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1742. ex.ToString(),
  1743. LocalPath.LogExePath);
  1744. actionResult.Status = (int)Constant.PDAResult.Exception;
  1745. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1746. }
  1747. return actionResult;
  1748. }
  1749. /// <summary>
  1750. /// 由产品条码获取注浆信息
  1751. /// </summary>
  1752. /// <param name="barcode"></param>
  1753. /// <returns></returns>
  1754. public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1755. {
  1756. ActionResult actionResult = new ActionResult();
  1757. try
  1758. {
  1759. // 验证请求头信息
  1760. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1761. // 验证失败
  1762. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1763. {
  1764. return actionResult;
  1765. }
  1766. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1767. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1768. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1769. {
  1770. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1771. actionResult.Status = (int)Constant.PDAResult.Success;
  1772. }
  1773. else
  1774. {
  1775. actionResult.Status = (int)Constant.PDAResult.Fail;
  1776. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1777. }
  1778. }
  1779. catch (Exception ex)
  1780. {
  1781. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1782. OutputLog.TraceLog(LogPriority.Error,
  1783. this.ToString(),
  1784. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1785. ex.ToString(),
  1786. LocalPath.LogExePath);
  1787. actionResult.Status = (int)Constant.PDAResult.Exception;
  1788. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1789. }
  1790. return actionResult;
  1791. }
  1792. /// <summary>
  1793. /// 获取工号下的所有工种信息
  1794. /// </summary>
  1795. /// <param name="UserID">工号ID</param>
  1796. /// <returns></returns>
  1797. public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1798. {
  1799. ActionResult actionResult = new ActionResult();
  1800. try
  1801. {
  1802. // 验证请求头信息
  1803. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1804. // 验证失败
  1805. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1806. {
  1807. return actionResult;
  1808. }
  1809. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1810. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1811. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1812. {
  1813. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1814. actionResult.Status = (int)Constant.PDAResult.Success;
  1815. }
  1816. else
  1817. {
  1818. actionResult.Status = (int)Constant.PDAResult.Fail;
  1819. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1820. }
  1821. }
  1822. catch (Exception ex)
  1823. {
  1824. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1825. OutputLog.TraceLog(LogPriority.Error,
  1826. this.ToString(),
  1827. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1828. ex.ToString(),
  1829. LocalPath.LogExePath);
  1830. actionResult.Status = (int)Constant.PDAResult.Exception;
  1831. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1832. }
  1833. return actionResult;
  1834. }
  1835. /// <summary>
  1836. /// 根据所选工号对应的工种,查出缺陷责任员工
  1837. /// </summary>
  1838. /// <param name="jobs">工种ID</param>
  1839. /// <returns></returns>
  1840. public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  1841. {
  1842. ActionResult actionResult = new ActionResult();
  1843. try
  1844. {
  1845. // 验证请求头信息
  1846. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1847. // 验证失败
  1848. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1849. {
  1850. return actionResult;
  1851. }
  1852. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1853. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  1854. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1855. {
  1856. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1857. actionResult.Status = (int)Constant.PDAResult.Success;
  1858. }
  1859. else
  1860. {
  1861. actionResult.Status = (int)Constant.PDAResult.Fail;
  1862. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1863. }
  1864. }
  1865. catch (Exception ex)
  1866. {
  1867. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1868. OutputLog.TraceLog(LogPriority.Error,
  1869. this.ToString(),
  1870. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1871. ex.ToString(),
  1872. LocalPath.LogExePath);
  1873. actionResult.Status = (int)Constant.PDAResult.Exception;
  1874. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1875. }
  1876. return actionResult;
  1877. }
  1878. /// <summary>
  1879. /// 根据所选工号,查出漏检责任员工
  1880. /// </summary>
  1881. /// <param name="userid">工号</param>
  1882. /// <returns></returns>
  1883. public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  1884. {
  1885. ActionResult actionResult = new ActionResult();
  1886. try
  1887. {
  1888. // 验证请求头信息
  1889. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1890. // 验证失败
  1891. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1892. {
  1893. return actionResult;
  1894. }
  1895. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1896. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  1897. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1898. {
  1899. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1900. actionResult.Status = (int)Constant.PDAResult.Success;
  1901. }
  1902. else
  1903. {
  1904. actionResult.Status = (int)Constant.PDAResult.Fail;
  1905. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1906. }
  1907. }
  1908. catch (Exception ex)
  1909. {
  1910. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1911. OutputLog.TraceLog(LogPriority.Error,
  1912. this.ToString(),
  1913. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1914. ex.ToString(),
  1915. LocalPath.LogExePath);
  1916. actionResult.Status = (int)Constant.PDAResult.Exception;
  1917. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1918. }
  1919. return actionResult;
  1920. }
  1921. /// <summary>
  1922. /// 获取用户列表
  1923. /// </summary>
  1924. /// <param name="requestEntity">用户实体</param>
  1925. /// <returns></returns>
  1926. public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  1927. {
  1928. ActionResult actionResult = new ActionResult();
  1929. try
  1930. {
  1931. // 验证请求头信息
  1932. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1933. // 验证失败
  1934. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1935. {
  1936. return actionResult;
  1937. }
  1938. SUserEntity requestEntity = new SUserEntity();
  1939. requestEntity.IsWorker = IsWorker;
  1940. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1941. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  1942. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1943. {
  1944. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1945. actionResult.Status = (int)Constant.PDAResult.Success;
  1946. }
  1947. else
  1948. {
  1949. actionResult.Status = (int)Constant.PDAResult.Fail;
  1950. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1951. }
  1952. }
  1953. catch (Exception ex)
  1954. {
  1955. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1956. OutputLog.TraceLog(LogPriority.Error,
  1957. this.ToString(),
  1958. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1959. ex.ToString(),
  1960. LocalPath.LogExePath);
  1961. actionResult.Status = (int)Constant.PDAResult.Exception;
  1962. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1963. }
  1964. return actionResult;
  1965. }
  1966. /// <summary>
  1967. /// 获取数据字典管理的数据
  1968. /// </summary>
  1969. /// <param name="Pvalue">显示停用标识</param>
  1970. /// <param name="dictionaryType">字典类别</param>
  1971. /// <returns></returns>
  1972. /// <remarks>
  1973. /// 2014.12.03 新建
  1974. /// </remarks>
  1975. public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  1976. {
  1977. ActionResult actionResult = new ActionResult();
  1978. try
  1979. {
  1980. // 验证请求头信息
  1981. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1982. // 验证失败
  1983. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1984. {
  1985. return actionResult;
  1986. }
  1987. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1988. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  1989. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1990. {
  1991. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1992. actionResult.Status = (int)Constant.PDAResult.Success;
  1993. }
  1994. else
  1995. {
  1996. actionResult.Status = (int)Constant.PDAResult.Fail;
  1997. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1998. }
  1999. }
  2000. catch (Exception ex)
  2001. {
  2002. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2003. OutputLog.TraceLog(LogPriority.Error,
  2004. this.ToString(),
  2005. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2006. ex.ToString(),
  2007. LocalPath.LogExePath);
  2008. actionResult.Status = (int)Constant.PDAResult.Exception;
  2009. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2010. }
  2011. return actionResult;
  2012. }
  2013. #endregion
  2014. #region 保存半检数据
  2015. /// <summary>
  2016. /// 保存半检数据
  2017. /// </summary>
  2018. /// <param name="accountCode">帐套code</param>
  2019. /// <param name="userCode">用户code</param>
  2020. /// <param name="userPassword">用户密码</param>
  2021. /// <param name="sessionKey">本次登陆密钥</param>
  2022. /// <param name="productionDataEntitys">半检信息</param>
  2023. /// <returns></returns>
  2024. public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  2025. {
  2026. ActionResult actionResult = new ActionResult();
  2027. try
  2028. {
  2029. // 验证请求头信息
  2030. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2031. // 验证失败
  2032. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2033. {
  2034. return actionResult;
  2035. }
  2036. string err = ServiceInvoker.Invoke<string>(this,
  2037. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2038. if (err == null)
  2039. {
  2040. err = "";
  2041. }
  2042. actionResult.Result = JsonHelper.ToJson(err);
  2043. actionResult.Status = (int)Constant.PDAResult.Success;
  2044. }
  2045. catch (Exception ex)
  2046. {
  2047. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2048. OutputLog.TraceLog(LogPriority.Error,
  2049. this.ToString(),
  2050. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2051. ex.ToString(),
  2052. LocalPath.LogExePath);
  2053. actionResult.Status = (int)Constant.PDAResult.Exception;
  2054. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2055. }
  2056. return actionResult;
  2057. }
  2058. #endregion
  2059. /// <summary>
  2060. /// 获取产品列表
  2061. /// </summary>
  2062. /// <returns></returns>
  2063. public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  2064. {
  2065. ActionResult actionResult = new ActionResult();
  2066. try
  2067. {
  2068. // 验证请求头信息
  2069. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2070. // 验证失败
  2071. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2072. {
  2073. return actionResult;
  2074. }
  2075. GoodsEntity goodsEntity = new GoodsEntity();
  2076. goodsEntity.ValueFlag = 1;//有效标记
  2077. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2078. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2079. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2080. {
  2081. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2082. actionResult.Status = (int)Constant.PDAResult.Success;
  2083. }
  2084. else
  2085. {
  2086. actionResult.Status = (int)Constant.PDAResult.Fail;
  2087. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2088. }
  2089. }
  2090. catch (Exception ex)
  2091. {
  2092. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2093. OutputLog.TraceLog(LogPriority.Error,
  2094. this.ToString(),
  2095. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2096. ex.ToString(),
  2097. LocalPath.LogExePath);
  2098. actionResult.Status = (int)Constant.PDAResult.Exception;
  2099. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2100. }
  2101. return actionResult;
  2102. }
  2103. /// <summary>
  2104. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2105. /// </summary>
  2106. /// <param name="searchEntity">生产数据实体类</param>
  2107. /// <returns>DataTable</returns>
  2108. public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2109. {
  2110. ActionResult actionResult = new ActionResult();
  2111. try
  2112. {
  2113. // 验证请求头信息
  2114. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2115. // 验证失败
  2116. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2117. {
  2118. return actionResult;
  2119. }
  2120. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2121. searchEntity.ProcedureID = ProcedureID;
  2122. searchEntity.BarCode = BarCode;
  2123. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2124. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2125. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2126. {
  2127. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2128. actionResult.Status = (int)Constant.PDAResult.Success;
  2129. }
  2130. else
  2131. {
  2132. actionResult.Status = (int)Constant.PDAResult.Fail;
  2133. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2134. }
  2135. }
  2136. catch (Exception ex)
  2137. {
  2138. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2139. OutputLog.TraceLog(LogPriority.Error,
  2140. this.ToString(),
  2141. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2142. ex.ToString(),
  2143. LocalPath.LogExePath);
  2144. actionResult.Status = (int)Constant.PDAResult.Exception;
  2145. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2146. }
  2147. return actionResult;
  2148. }
  2149. /// <summary>
  2150. /// 根据所选生产数据ID,显示成检数据信息
  2151. /// </summary>
  2152. /// <param name="productionDataID">生产数据ID</param>
  2153. /// <returns>DataSet</returns>
  2154. public ActionResult GetProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2155. {
  2156. ActionResult actionResult = new ActionResult();
  2157. try
  2158. {
  2159. // 验证请求头信息
  2160. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2161. // 验证失败
  2162. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2163. {
  2164. return actionResult;
  2165. }
  2166. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2167. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2168. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2169. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2170. {
  2171. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2172. {
  2173. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2174. {
  2175. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2176. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2177. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2178. {
  2179. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2180. }
  2181. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2182. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2183. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2184. {
  2185. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2186. }
  2187. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2188. {
  2189. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2190. }
  2191. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2192. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2193. {
  2194. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2195. }
  2196. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2197. {
  2198. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2199. }
  2200. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2201. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2202. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2203. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2204. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2205. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2206. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2207. {
  2208. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2209. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2210. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2211. }
  2212. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2213. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2214. {
  2215. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2216. }
  2217. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2218. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2219. DataTable dtDefect = dvDefect.ToTable();
  2220. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2221. {
  2222. // 产品缺陷
  2223. PDADefectResult defect = new PDADefectResult();
  2224. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2225. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2226. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2227. {
  2228. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2229. }
  2230. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2231. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2232. {
  2233. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2234. }
  2235. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2236. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2237. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2238. {
  2239. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2240. }
  2241. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2242. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2243. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2244. {
  2245. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2246. }
  2247. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2248. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2249. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2250. {
  2251. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2252. }
  2253. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2254. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2255. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2256. {
  2257. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2258. }
  2259. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2260. {
  2261. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2262. }
  2263. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2264. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2265. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2266. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2267. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2268. {
  2269. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2270. }
  2271. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2272. {
  2273. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2274. }
  2275. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2276. {
  2277. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2278. }
  2279. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2280. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2281. //--------责任员工-------------------
  2282. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2283. if (drRow.Length > Constant.INT_IS_ZERO)
  2284. {
  2285. foreach (DataRow r in drRow)
  2286. {
  2287. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2288. if (r["ProductionDefectID"].ToString() != "")
  2289. {
  2290. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2291. }
  2292. if (r["StaffID"].ToString() != "")
  2293. {
  2294. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2295. }
  2296. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2297. defectResponsible.StaffName = r["StaffName"].ToString();
  2298. if (r["StaffStatus"].ToString() != "")
  2299. {
  2300. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2301. }
  2302. if (r["UJobsID"].ToString() != "")
  2303. {
  2304. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2305. }
  2306. if (r["SJobsID"].ToString() != "")
  2307. {
  2308. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2309. }
  2310. defect.PDADefectResponsibles.Add(defectResponsible);
  2311. }
  2312. }
  2313. //------------------------------
  2314. //--------漏检员工-------------------
  2315. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2316. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2317. {
  2318. foreach (DataRow r in drMissedRow)
  2319. {
  2320. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2321. if (r["ProductionDefectID"].ToString() != "")
  2322. {
  2323. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2324. }
  2325. if (r["StaffID"].ToString() != "")
  2326. {
  2327. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2328. }
  2329. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2330. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2331. if (r["StaffStatus"].ToString() != "")
  2332. {
  2333. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2334. }
  2335. if (r["UJobsID"].ToString() != "")
  2336. {
  2337. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2338. }
  2339. if (r["SJobsID"].ToString() != "")
  2340. {
  2341. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2342. }
  2343. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2344. }
  2345. }
  2346. //------------------------------
  2347. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2348. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2349. {
  2350. foreach (DataRow r in drImageRow)
  2351. {
  2352. PDADefectImageResult defectImage = new PDADefectImageResult();
  2353. if (r["ProductionDefectID"].ToString() != "")
  2354. {
  2355. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2356. }
  2357. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2358. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2359. //{
  2360. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2361. //}
  2362. defect.PDADefectImageResults.Add(defectImage);
  2363. }
  2364. }
  2365. productionData.PDADefects.Add(defect);
  2366. }
  2367. if (productionDatas.PDAProductionData == null)
  2368. {
  2369. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2370. }
  2371. productionDatas.PDAProductionData.Add(productionData);
  2372. //---------------------------------------------------------------------------------
  2373. }
  2374. }
  2375. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2376. actionResult.Status = (int)Constant.PDAResult.Success;
  2377. }
  2378. else
  2379. {
  2380. actionResult.Status = (int)Constant.PDAResult.Fail;
  2381. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2382. }
  2383. }
  2384. catch (Exception ex)
  2385. {
  2386. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2387. OutputLog.TraceLog(LogPriority.Error,
  2388. this.ToString(),
  2389. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2390. ex.ToString(),
  2391. LocalPath.LogExePath);
  2392. actionResult.Status = (int)Constant.PDAResult.Exception;
  2393. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2394. }
  2395. return actionResult;
  2396. }
  2397. /// <summary>
  2398. /// 编辑后删除生产数据
  2399. /// </summary>
  2400. /// <param name="productionDataID">生产数据ID</param>
  2401. /// <returns>int</returns>
  2402. public ActionResult DeleteProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2403. {
  2404. ActionResult actionResult = new ActionResult();
  2405. try
  2406. {
  2407. // 验证请求头信息
  2408. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2409. // 验证失败
  2410. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2411. {
  2412. return actionResult;
  2413. }
  2414. int row = ServiceInvoker.Invoke<int>(this,
  2415. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2416. actionResult.Result = JsonHelper.ToJson(row);
  2417. actionResult.Status = (int)Constant.PDAResult.Success;
  2418. }
  2419. catch (Exception ex)
  2420. {
  2421. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2422. OutputLog.TraceLog(LogPriority.Error,
  2423. this.ToString(),
  2424. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2425. ex.ToString(),
  2426. LocalPath.LogExePath);
  2427. actionResult.Status = (int)Constant.PDAResult.Exception;
  2428. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2429. }
  2430. return actionResult;
  2431. }
  2432. /// <summary>
  2433. /// 获取产品完成工序的ID
  2434. /// </summary>
  2435. /// <param name="barcode">产品条码</param>
  2436. /// <returns>int</returns>
  2437. public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2438. {
  2439. ActionResult actionResult = new ActionResult();
  2440. try
  2441. {
  2442. // 验证请求头信息
  2443. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2444. // 验证失败
  2445. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2446. {
  2447. return actionResult;
  2448. }
  2449. int row = ServiceInvoker.Invoke<int>(this,
  2450. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2451. actionResult.Result = JsonHelper.ToJson(row);
  2452. actionResult.Status = (int)Constant.PDAResult.Success;
  2453. }
  2454. catch (Exception ex)
  2455. {
  2456. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2457. OutputLog.TraceLog(LogPriority.Error,
  2458. this.ToString(),
  2459. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2460. ex.ToString(),
  2461. LocalPath.LogExePath);
  2462. actionResult.Status = (int)Constant.PDAResult.Exception;
  2463. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2464. }
  2465. return actionResult;
  2466. }
  2467. /// <summary>
  2468. /// 绑定图片
  2469. /// </summary>
  2470. /// <param name="accountCode">帐套code</param>
  2471. /// <param name="userCode">用户code</param>
  2472. /// <param name="userPassword">用户密码</param>
  2473. /// <param name="sessionKey">本次登陆密钥</param>
  2474. /// <param name="imagePath">图片路径</param>
  2475. /// <returns></returns>
  2476. public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2477. {
  2478. try
  2479. {
  2480. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2481. }
  2482. catch (Exception ex)
  2483. {
  2484. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2485. OutputLog.TraceLog(LogPriority.Error,
  2486. this.ToString(),
  2487. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2488. ex.ToString(),
  2489. LocalPath.LogExePath);
  2490. return null;
  2491. }
  2492. }
  2493. /// <summary>
  2494. /// 根据所选工号对应的工种,查出缺陷责任员工
  2495. /// </summary>
  2496. /// <param name="jobs">工种ID</param>
  2497. /// <returns></returns>
  2498. public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2499. {
  2500. ActionResult actionResult = new ActionResult();
  2501. try
  2502. {
  2503. // 验证请求头信息
  2504. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2505. // 验证失败
  2506. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2507. {
  2508. return actionResult;
  2509. }
  2510. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2511. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2512. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2513. {
  2514. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2515. actionResult.Status = (int)Constant.PDAResult.Success;
  2516. }
  2517. else
  2518. {
  2519. actionResult.Status = (int)Constant.PDAResult.Fail;
  2520. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2521. }
  2522. }
  2523. catch (Exception ex)
  2524. {
  2525. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2526. OutputLog.TraceLog(LogPriority.Error,
  2527. this.ToString(),
  2528. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2529. ex.ToString(),
  2530. LocalPath.LogExePath);
  2531. actionResult.Status = (int)Constant.PDAResult.Exception;
  2532. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2533. }
  2534. return actionResult;
  2535. }
  2536. #region 产品报废
  2537. /// <summary>
  2538. /// 验证废弃产品唯一性
  2539. /// </summary>
  2540. /// <param name="barcode">产品条码</param>
  2541. /// <returns>int</returns>
  2542. public ActionResult ScrapProductChack(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2543. {
  2544. ActionResult actionResult = new ActionResult();
  2545. try
  2546. {
  2547. // 验证请求头信息
  2548. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2549. // 验证失败
  2550. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2551. {
  2552. return actionResult;
  2553. }
  2554. string row = ServiceInvoker.Invoke<string>(this,
  2555. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2556. string[] rm = row.Split(':');
  2557. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2558. if (rm.Length > 1)
  2559. {
  2560. actionResult.Message = rm[1];
  2561. }
  2562. actionResult.Status = (int)Constant.PDAResult.Success;
  2563. }
  2564. catch (Exception ex)
  2565. {
  2566. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2567. OutputLog.TraceLog(LogPriority.Error,
  2568. this.ToString(),
  2569. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2570. ex.ToString(),
  2571. LocalPath.LogExePath);
  2572. actionResult.Status = (int)Constant.PDAResult.Exception;
  2573. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2574. }
  2575. return actionResult;
  2576. }
  2577. /// <summary>
  2578. /// 根据条码获取该产品的在产信息以及生产数据
  2579. /// </summary>
  2580. /// <param name="Barcode">产品条码</param>
  2581. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2582. public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2583. {
  2584. ActionResult actionResult = new ActionResult();
  2585. try
  2586. {
  2587. // 验证请求头信息
  2588. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2589. // 验证失败
  2590. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2591. {
  2592. return actionResult;
  2593. }
  2594. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2595. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2596. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2597. {
  2598. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2599. actionResult.Status = (int)Constant.PDAResult.Success;
  2600. }
  2601. else
  2602. {
  2603. actionResult.Status = (int)Constant.PDAResult.Fail;
  2604. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2605. }
  2606. }
  2607. catch (Exception ex)
  2608. {
  2609. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2610. OutputLog.TraceLog(LogPriority.Error,
  2611. this.ToString(),
  2612. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2613. ex.ToString(),
  2614. LocalPath.LogExePath);
  2615. actionResult.Status = (int)Constant.PDAResult.Exception;
  2616. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2617. }
  2618. return actionResult;
  2619. }
  2620. /// <summary>
  2621. /// 根据工号查询员工档案信息
  2622. /// </summary>
  2623. /// <param name="accountCode"></param>
  2624. /// <param name="userCode"></param>
  2625. /// <param name="userPassword"></param>
  2626. /// <param name="sessionKey"></param>
  2627. /// <param name="userId"></param>
  2628. /// <returns></returns>
  2629. public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2630. {
  2631. ActionResult actionResult = new ActionResult();
  2632. try
  2633. {
  2634. // 验证请求头信息
  2635. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2636. // 验证失败
  2637. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2638. {
  2639. return actionResult;
  2640. }
  2641. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2642. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2643. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2644. {
  2645. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2646. actionResult.Status = (int)Constant.PDAResult.Success;
  2647. }
  2648. else
  2649. {
  2650. actionResult.Status = (int)Constant.PDAResult.Fail;
  2651. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2652. }
  2653. }
  2654. catch (Exception ex)
  2655. {
  2656. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2657. OutputLog.TraceLog(LogPriority.Error,
  2658. this.ToString(),
  2659. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2660. ex.ToString(),
  2661. LocalPath.LogExePath);
  2662. actionResult.Status = (int)Constant.PDAResult.Exception;
  2663. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2664. }
  2665. return actionResult;
  2666. }
  2667. /// <summary>
  2668. /// 添加废弃产品记录
  2669. /// </summary>
  2670. /// <param name="SProductEntity">废弃产品实体</param>
  2671. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2672. /// <param name="SResponsibleList">责任者集合</param>
  2673. /// <param name="userInfo">用户基本信息</param>
  2674. /// <returns>int结果返回值</returns>
  2675. /// <remarks>
  2676. /// 庄天威 2014.09.24 新建
  2677. /// </remarks>
  2678. public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey,
  2679. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2680. ScrapResponsibleEntity[] SResponsibleList)
  2681. {
  2682. ActionResult actionResult = new ActionResult();
  2683. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2684. {
  2685. actionResult.Status = (int)Constant.PDAResult.Fail;
  2686. actionResult.Message = "没有选择责任人";
  2687. }
  2688. try
  2689. {
  2690. // 验证请求头信息
  2691. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2692. // 验证失败
  2693. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2694. {
  2695. return actionResult;
  2696. }
  2697. int addRow = ServiceInvoker.Invoke<int>(this,
  2698. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  2699. actionResult.Result = JsonHelper.ToJson(addRow);
  2700. actionResult.Status = (int)Constant.PDAResult.Success;
  2701. }
  2702. catch (Exception ex)
  2703. {
  2704. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2705. OutputLog.TraceLog(LogPriority.Error,
  2706. this.ToString(),
  2707. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2708. ex.ToString(),
  2709. LocalPath.LogExePath);
  2710. actionResult.Status = (int)Constant.PDAResult.Exception;
  2711. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2712. // TODO 空指针异常问题检测
  2713. try
  2714. {
  2715. OutputLog.TraceLog(LogPriority.Error,
  2716. this.ToString(),
  2717. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2718. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  2719. LocalPath.LogExePath);
  2720. string json1 = JsonHelper.ToJson(SProductEntity);
  2721. OutputLog.TraceLog(LogPriority.Error,
  2722. this.ToString(),
  2723. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2724. "SProductEntity:" + json1,
  2725. LocalPath.LogExePath);
  2726. string json2 = JsonHelper.ToJson(RProcedureEntity);
  2727. OutputLog.TraceLog(LogPriority.Error,
  2728. this.ToString(),
  2729. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2730. "RProcedureEntity:" + json2,
  2731. LocalPath.LogExePath);
  2732. string json3 = JsonHelper.ToJson(SResponsibleList);
  2733. OutputLog.TraceLog(LogPriority.Error,
  2734. this.ToString(),
  2735. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2736. "SResponsibleList:" + json3,
  2737. LocalPath.LogExePath);
  2738. }
  2739. catch (Exception exc)
  2740. {
  2741. OutputLog.TraceLog(LogPriority.Error,
  2742. this.ToString(),
  2743. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2744. "参数输入异常:" + exc.Message,
  2745. LocalPath.LogExePath);
  2746. }
  2747. }
  2748. return actionResult;
  2749. }
  2750. /// <summary>
  2751. /// 获取产品分级的数据(根据ID)
  2752. /// </summary>
  2753. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  2754. /// <param name="GoodsLevelID">分类ID</param>
  2755. /// <param name="sUserInfo">用户基本信息</param>
  2756. /// <returns>DataSet</returns>
  2757. /// <remarks>
  2758. /// 2014.10.22 庄天威 新建
  2759. public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  2760. {
  2761. ActionResult actionResult = new ActionResult();
  2762. try
  2763. {
  2764. // 验证请求头信息
  2765. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2766. // 验证失败
  2767. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2768. {
  2769. return actionResult;
  2770. }
  2771. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2772. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  2773. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2774. {
  2775. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2776. actionResult.Status = (int)Constant.PDAResult.Success;
  2777. }
  2778. else
  2779. {
  2780. actionResult.Status = (int)Constant.PDAResult.Fail;
  2781. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2782. }
  2783. }
  2784. catch (Exception ex)
  2785. {
  2786. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2787. OutputLog.TraceLog(LogPriority.Error,
  2788. this.ToString(),
  2789. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2790. ex.ToString(),
  2791. LocalPath.LogExePath);
  2792. actionResult.Status = (int)Constant.PDAResult.Exception;
  2793. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2794. }
  2795. return actionResult;
  2796. }
  2797. /// <summary>
  2798. /// 获取账务日期
  2799. /// </summary>
  2800. /// <param name="accountCode"></param>
  2801. /// <param name="userCode"></param>
  2802. /// <param name="userPassword"></param>
  2803. /// <param name="sessionKey"></param>
  2804. /// <returns></returns>
  2805. public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey)
  2806. {
  2807. ActionResult actionResult = new ActionResult();
  2808. try
  2809. {
  2810. // 验证请求头信息
  2811. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2812. // 验证失败
  2813. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2814. {
  2815. return actionResult;
  2816. }
  2817. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  2818. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  2819. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2820. actionResult.Status = (int)Constant.PDAResult.Success;
  2821. }
  2822. catch (Exception ex)
  2823. {
  2824. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2825. OutputLog.TraceLog(LogPriority.Error,
  2826. this.ToString(),
  2827. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2828. ex.ToString(),
  2829. LocalPath.LogExePath);
  2830. actionResult.Status = (int)Constant.PDAResult.Exception;
  2831. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2832. }
  2833. return actionResult;
  2834. }
  2835. /// <summary>
  2836. /// 获取登陆帐户有无报损权限
  2837. /// </summary>
  2838. /// <param name="accountCode"></param>
  2839. /// <param name="userCode"></param>
  2840. /// <param name="userPassword"></param>
  2841. /// <param name="sessionKey"></param>
  2842. /// <param name="usercode">工号编码</param>
  2843. /// <returns></returns>
  2844. public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  2845. {
  2846. ActionResult actionResult = new ActionResult();
  2847. try
  2848. {
  2849. // 验证请求头信息
  2850. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2851. // 验证失败
  2852. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2853. {
  2854. return actionResult;
  2855. }
  2856. int returnValue = ServiceInvoker.Invoke<int>(this,
  2857. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  2858. actionResult.Result = JsonHelper.ToJson(returnValue);
  2859. actionResult.Status = (int)Constant.PDAResult.Success;
  2860. }
  2861. catch (Exception ex)
  2862. {
  2863. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2864. OutputLog.TraceLog(LogPriority.Error,
  2865. this.ToString(),
  2866. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2867. ex.ToString(),
  2868. LocalPath.LogExePath);
  2869. actionResult.Status = (int)Constant.PDAResult.Exception;
  2870. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2871. }
  2872. return actionResult;
  2873. }
  2874. #endregion
  2875. /// <summary>
  2876. /// 获取是否存在报损未审核产品
  2877. /// </summary>
  2878. /// <param name="barcode">产品条码</param>
  2879. /// <returns>int</returns>
  2880. public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2881. {
  2882. ActionResult actionResult = new ActionResult();
  2883. try
  2884. {
  2885. // 验证请求头信息
  2886. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2887. // 验证失败
  2888. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2889. {
  2890. return actionResult;
  2891. }
  2892. int row = ServiceInvoker.Invoke<int>(this,
  2893. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  2894. actionResult.Result = JsonHelper.ToJson(row);
  2895. actionResult.Status = (int)Constant.PDAResult.Success;
  2896. }
  2897. catch (Exception ex)
  2898. {
  2899. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2900. OutputLog.TraceLog(LogPriority.Error,
  2901. this.ToString(),
  2902. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2903. ex.ToString(),
  2904. LocalPath.LogExePath);
  2905. actionResult.Status = (int)Constant.PDAResult.Exception;
  2906. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2907. }
  2908. return actionResult;
  2909. }
  2910. /// <summary>
  2911. /// 查询报废产品信息
  2912. /// </summary>
  2913. /// <param name="accountCode"></param>
  2914. /// <param name="userCode"></param>
  2915. /// <param name="userPassword"></param>
  2916. /// <param name="sessionKey"></param>
  2917. /// <param name="barCode">产品条码</param>
  2918. /// <param name="scrapProductID">报废产品ID</param>
  2919. /// <returns></returns>
  2920. public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  2921. {
  2922. ActionResult actionResult = new ActionResult();
  2923. try
  2924. {
  2925. // 验证请求头信息
  2926. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2927. // 验证失败
  2928. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2929. {
  2930. return actionResult;
  2931. }
  2932. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  2933. selectProEntity.BarCode = barCode;
  2934. selectProEntity.ScrapProductID = scrapProductID;
  2935. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2936. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  2937. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2938. {
  2939. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2940. actionResult.Status = (int)Constant.PDAResult.Success;
  2941. }
  2942. else
  2943. {
  2944. actionResult.Status = (int)Constant.PDAResult.Fail;
  2945. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2946. }
  2947. }
  2948. catch (Exception ex)
  2949. {
  2950. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2951. OutputLog.TraceLog(LogPriority.Error,
  2952. this.ToString(),
  2953. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2954. ex.ToString(),
  2955. LocalPath.LogExePath);
  2956. actionResult.Status = (int)Constant.PDAResult.Exception;
  2957. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2958. }
  2959. return actionResult;
  2960. }
  2961. /// <summary>
  2962. /// 根据废弃产品ID获取责任工序
  2963. /// </summary>
  2964. /// <param name="accountCode"></param>
  2965. /// <param name="userCode"></param>
  2966. /// <param name="userPassword"></param>
  2967. /// <param name="sessionKey"></param>
  2968. /// <param name="scrapProductID">报废产品ID</param>
  2969. /// <returns></returns>
  2970. public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  2971. {
  2972. ActionResult actionResult = new ActionResult();
  2973. try
  2974. {
  2975. // 验证请求头信息
  2976. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2977. // 验证失败
  2978. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2979. {
  2980. return actionResult;
  2981. }
  2982. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2983. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  2984. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2985. {
  2986. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2987. actionResult.Status = (int)Constant.PDAResult.Success;
  2988. }
  2989. else
  2990. {
  2991. actionResult.Status = (int)Constant.PDAResult.Fail;
  2992. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2993. }
  2994. }
  2995. catch (Exception ex)
  2996. {
  2997. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2998. OutputLog.TraceLog(LogPriority.Error,
  2999. this.ToString(),
  3000. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3001. ex.ToString(),
  3002. LocalPath.LogExePath);
  3003. actionResult.Status = (int)Constant.PDAResult.Exception;
  3004. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3005. }
  3006. return actionResult;
  3007. }
  3008. /// <summary>
  3009. /// 根据废弃产品ID获取责任人列表
  3010. /// </summary>
  3011. /// <param name="accountCode"></param>
  3012. /// <param name="userCode"></param>
  3013. /// <param name="userPassword"></param>
  3014. /// <param name="sessionKey"></param>
  3015. /// <param name="scrapProductID">报废产品ID</param>
  3016. /// <returns></returns>
  3017. public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3018. {
  3019. ActionResult actionResult = new ActionResult();
  3020. try
  3021. {
  3022. // 验证请求头信息
  3023. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3024. // 验证失败
  3025. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3026. {
  3027. return actionResult;
  3028. }
  3029. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3030. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  3031. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3032. {
  3033. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3034. actionResult.Status = (int)Constant.PDAResult.Success;
  3035. }
  3036. else
  3037. {
  3038. actionResult.Status = (int)Constant.PDAResult.Fail;
  3039. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3040. }
  3041. }
  3042. catch (Exception ex)
  3043. {
  3044. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3045. OutputLog.TraceLog(LogPriority.Error,
  3046. this.ToString(),
  3047. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3048. ex.ToString(),
  3049. LocalPath.LogExePath);
  3050. actionResult.Status = (int)Constant.PDAResult.Exception;
  3051. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3052. }
  3053. return actionResult;
  3054. }
  3055. /// <summary>
  3056. /// 添加废弃产品记录
  3057. /// </summary>
  3058. /// <param name="SProductEntity">废弃产品实体</param>
  3059. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3060. /// <param name="SResponsibleList">责任者集合</param>
  3061. /// <param name="userInfo">用户基本信息</param>
  3062. /// <returns>int结果返回值</returns>
  3063. /// <remarks>
  3064. /// 庄天威 2014.09.24 新建
  3065. /// </remarks>
  3066. public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3067. ResponProcedureEntity UpdateRProcedureEntity,
  3068. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3069. {
  3070. ActionResult actionResult = new ActionResult();
  3071. try
  3072. {
  3073. // 验证请求头信息
  3074. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3075. // 验证失败
  3076. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3077. {
  3078. return actionResult;
  3079. }
  3080. int addRow = ServiceInvoker.Invoke<int>(this,
  3081. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3082. actionResult.Result = JsonHelper.ToJson(addRow);
  3083. actionResult.Status = (int)Constant.PDAResult.Success;
  3084. }
  3085. catch (Exception ex)
  3086. {
  3087. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3088. OutputLog.TraceLog(LogPriority.Error,
  3089. this.ToString(),
  3090. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3091. ex.ToString(),
  3092. LocalPath.LogExePath);
  3093. actionResult.Status = (int)Constant.PDAResult.Exception;
  3094. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3095. }
  3096. return actionResult;
  3097. }
  3098. /// <summary>
  3099. /// 获取产品窑炉
  3100. /// </summary>
  3101. /// <param name="accountCode"></param>
  3102. /// <param name="userCode"></param>
  3103. /// <param name="userPassword"></param>
  3104. /// <param name="sessionKey"></param>
  3105. /// <returns>Datase</returns>
  3106. public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  3107. {
  3108. ActionResult actionResult = new ActionResult();
  3109. try
  3110. {
  3111. // 验证请求头信息
  3112. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3113. // 验证失败
  3114. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3115. {
  3116. return actionResult;
  3117. }
  3118. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3119. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3120. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3121. {
  3122. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3123. actionResult.Status = (int)Constant.PDAResult.Success;
  3124. }
  3125. else
  3126. {
  3127. actionResult.Status = (int)Constant.PDAResult.Fail;
  3128. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3129. }
  3130. }
  3131. catch (Exception ex)
  3132. {
  3133. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3134. OutputLog.TraceLog(LogPriority.Error,
  3135. this.ToString(),
  3136. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3137. ex.ToString(),
  3138. LocalPath.LogExePath);
  3139. actionResult.Status = (int)Constant.PDAResult.Exception;
  3140. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3141. }
  3142. return actionResult;
  3143. }
  3144. /// <summary>
  3145. /// 获取次品产品条码允许编辑
  3146. /// </summary>
  3147. /// <param name="accountCode"></param>
  3148. /// <param name="userCode"></param>
  3149. /// <param name="userPassword"></param>
  3150. /// <param name="sessionKey"></param>
  3151. /// <param name="barcode">产品条码</param>
  3152. /// <returns>Datase</returns>
  3153. public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3154. {
  3155. ActionResult actionResult = new ActionResult();
  3156. try
  3157. {
  3158. // 验证请求头信息
  3159. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3160. // 验证失败
  3161. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3162. {
  3163. return actionResult;
  3164. }
  3165. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3166. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3167. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3168. {
  3169. actionResult.Result = JsonHelper.ToJson(1);
  3170. actionResult.Status = (int)Constant.PDAResult.Success;
  3171. }
  3172. else
  3173. {
  3174. actionResult.Result = JsonHelper.ToJson(0);
  3175. actionResult.Status = (int)Constant.PDAResult.Fail;
  3176. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3177. }
  3178. }
  3179. catch (Exception ex)
  3180. {
  3181. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3182. OutputLog.TraceLog(LogPriority.Error,
  3183. this.ToString(),
  3184. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3185. ex.ToString(),
  3186. LocalPath.LogExePath);
  3187. actionResult.Status = (int)Constant.PDAResult.Exception;
  3188. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3189. }
  3190. return actionResult;
  3191. }
  3192. /// <summary>
  3193. /// 获取产品条码是否重烧
  3194. /// </summary>
  3195. /// <param name="accountCode"></param>
  3196. /// <param name="userCode"></param>
  3197. /// <param name="userPassword"></param>
  3198. /// <param name="sessionKey"></param>
  3199. /// <param name="barcode">产品条码</param>
  3200. /// <returns>Datase</returns>
  3201. public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3202. {
  3203. ActionResult actionResult = new ActionResult();
  3204. try
  3205. {
  3206. // 验证请求头信息
  3207. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3208. // 验证失败
  3209. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3210. {
  3211. return actionResult;
  3212. }
  3213. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3214. () => PDAModuleLogic.GetReFine(barcode));
  3215. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3216. {
  3217. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3218. }
  3219. else
  3220. {
  3221. actionResult.Result = JsonHelper.ToJson(0);
  3222. }
  3223. actionResult.Status = (int)Constant.PDAResult.Success;
  3224. }
  3225. catch (Exception ex)
  3226. {
  3227. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3228. OutputLog.TraceLog(LogPriority.Error,
  3229. this.ToString(),
  3230. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3231. ex.ToString(),
  3232. LocalPath.LogExePath);
  3233. actionResult.Status = (int)Constant.PDAResult.Exception;
  3234. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3235. }
  3236. return actionResult;
  3237. }
  3238. /// <summary>
  3239. /// 获取登陆帐户有无成检编辑权限
  3240. /// </summary>
  3241. /// <param name="accountCode"></param>
  3242. /// <param name="userCode"></param>
  3243. /// <param name="userPassword"></param>
  3244. /// <param name="sessionKey"></param>
  3245. /// <param name="usercode">工号编码</param>
  3246. /// <returns></returns>
  3247. public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3248. {
  3249. ActionResult actionResult = new ActionResult();
  3250. try
  3251. {
  3252. // 验证请求头信息
  3253. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3254. // 验证失败
  3255. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3256. {
  3257. return actionResult;
  3258. }
  3259. int returnValue = ServiceInvoker.Invoke<int>(this,
  3260. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3261. actionResult.Result = JsonHelper.ToJson(returnValue);
  3262. actionResult.Status = (int)Constant.PDAResult.Success;
  3263. }
  3264. catch (Exception ex)
  3265. {
  3266. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3267. OutputLog.TraceLog(LogPriority.Error,
  3268. this.ToString(),
  3269. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3270. ex.ToString(),
  3271. LocalPath.LogExePath);
  3272. actionResult.Status = (int)Constant.PDAResult.Exception;
  3273. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3274. }
  3275. return actionResult;
  3276. }
  3277. /// <summary>
  3278. /// 根据条码及工序判断是否漏扫
  3279. /// </summary>
  3280. /// <param name="accountCode"></param>
  3281. /// <param name="userCode"></param>
  3282. /// <param name="userPassword"></param>
  3283. /// <param name="sessionKey"></param>
  3284. /// <param name="usercode">工号编码</param>
  3285. /// <param name="barcode">产品条码</param>
  3286. /// <param name="produceid">工序ID</param>
  3287. /// <returns></returns>
  3288. public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3289. {
  3290. ActionResult actionResult = new ActionResult();
  3291. try
  3292. {
  3293. // 验证请求头信息
  3294. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3295. // 验证失败
  3296. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3297. {
  3298. return actionResult;
  3299. }
  3300. int returnValue = 1;
  3301. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3302. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3303. actionResult.Result = JsonHelper.ToJson(returnValue);
  3304. actionResult.Status = (int)Constant.PDAResult.Success;
  3305. }
  3306. catch (Exception ex)
  3307. {
  3308. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3309. OutputLog.TraceLog(LogPriority.Error,
  3310. this.ToString(),
  3311. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3312. ex.ToString(),
  3313. LocalPath.LogExePath);
  3314. actionResult.Status = (int)Constant.PDAResult.Exception;
  3315. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3316. }
  3317. return actionResult;
  3318. }
  3319. /// <summary>
  3320. /// 获取登陆帐户有无报损审批权限
  3321. /// </summary>
  3322. /// <param name="accountCode"></param>
  3323. /// <param name="userCode"></param>
  3324. /// <param name="userPassword"></param>
  3325. /// <param name="sessionKey"></param>
  3326. /// <param name="usercode">工号编码</param>
  3327. /// <returns></returns>
  3328. public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3329. {
  3330. ActionResult actionResult = new ActionResult();
  3331. try
  3332. {
  3333. // 验证请求头信息
  3334. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3335. // 验证失败
  3336. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3337. {
  3338. return actionResult;
  3339. }
  3340. int returnValue = ServiceInvoker.Invoke<int>(this,
  3341. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3342. actionResult.Result = JsonHelper.ToJson(returnValue);
  3343. actionResult.Status = (int)Constant.PDAResult.Success;
  3344. }
  3345. catch (Exception ex)
  3346. {
  3347. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3348. OutputLog.TraceLog(LogPriority.Error,
  3349. this.ToString(),
  3350. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3351. ex.ToString(),
  3352. LocalPath.LogExePath);
  3353. actionResult.Status = (int)Constant.PDAResult.Exception;
  3354. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3355. }
  3356. return actionResult;
  3357. }
  3358. /// <summary>
  3359. /// 获取登陆帐户有无报损审批权限
  3360. /// </summary>
  3361. /// <param name="accountCode"></param>
  3362. /// <param name="userCode"></param>
  3363. /// <param name="userPassword"></param>
  3364. /// <param name="sessionKey"></param>
  3365. /// <param name="usercode">工号编码</param>
  3366. /// <returns></returns>
  3367. public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3368. {
  3369. ActionResult actionResult = new ActionResult();
  3370. try
  3371. {
  3372. // 验证请求头信息
  3373. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3374. // 验证失败
  3375. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3376. {
  3377. return actionResult;
  3378. }
  3379. int returnValue = ServiceInvoker.Invoke<int>(this,
  3380. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3381. actionResult.Result = JsonHelper.ToJson(returnValue);
  3382. actionResult.Status = (int)Constant.PDAResult.Success;
  3383. }
  3384. catch (Exception ex)
  3385. {
  3386. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3387. OutputLog.TraceLog(LogPriority.Error,
  3388. this.ToString(),
  3389. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3390. ex.ToString(),
  3391. LocalPath.LogExePath);
  3392. actionResult.Status = (int)Constant.PDAResult.Exception;
  3393. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3394. }
  3395. return actionResult;
  3396. }
  3397. /// <summary>
  3398. /// 获取窑车对应产品列表
  3399. /// </summary>
  3400. /// <param name="accountCode"></param>
  3401. /// <param name="userCode"></param>
  3402. /// <param name="userPassword"></param>
  3403. /// <param name="sessionKey"></param>
  3404. /// <param name="KilnCarID">窑车ID</param>
  3405. /// <returns>Dataset</returns>
  3406. public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  3407. {
  3408. ActionResult actionResult = new ActionResult();
  3409. try
  3410. {
  3411. // 验证请求头信息
  3412. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3413. // 验证失败
  3414. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3415. {
  3416. return actionResult;
  3417. }
  3418. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3419. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3420. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3421. {
  3422. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3423. actionResult.Status = (int)Constant.PDAResult.Success;
  3424. }
  3425. else
  3426. {
  3427. actionResult.Status = (int)Constant.PDAResult.Fail;
  3428. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3429. }
  3430. }
  3431. catch (Exception ex)
  3432. {
  3433. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3434. OutputLog.TraceLog(LogPriority.Error,
  3435. this.ToString(),
  3436. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3437. ex.ToString(),
  3438. LocalPath.LogExePath);
  3439. actionResult.Status = (int)Constant.PDAResult.Exception;
  3440. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3441. }
  3442. return actionResult;
  3443. }
  3444. /// <summary>
  3445. /// 更换条码
  3446. /// </summary>
  3447. /// <param name="accountCode"></param>
  3448. /// <param name="userCode"></param>
  3449. /// <param name="userPassword"></param>
  3450. /// <param name="sessionKey"></param>
  3451. ///<param name="barcode">原条码</param>
  3452. /// <param name="newBarcode">新条码</param>
  3453. /// <param name="remarks">备注</param>
  3454. /// <returns>操作结果</returns>
  3455. public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  3456. {
  3457. ActionResult actionResult = new ActionResult();
  3458. try
  3459. {
  3460. // 验证请求头信息
  3461. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3462. // 验证失败
  3463. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3464. {
  3465. return actionResult;
  3466. }
  3467. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3468. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3469. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3470. {
  3471. actionResult.Result = 1;
  3472. actionResult.Status = (int)Constant.PDAResult.Success;
  3473. }
  3474. else
  3475. {
  3476. actionResult.Status = (int)Constant.PDAResult.Fail;
  3477. actionResult.Message = serviceResultEntity.Message;
  3478. }
  3479. }
  3480. catch (Exception ex)
  3481. {
  3482. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3483. OutputLog.TraceLog(LogPriority.Error,
  3484. this.ToString(),
  3485. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3486. ex.ToString(),
  3487. LocalPath.LogExePath);
  3488. actionResult.Status = (int)Constant.PDAResult.Exception;
  3489. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3490. }
  3491. return actionResult;
  3492. }
  3493. /// <summary>
  3494. /// 获取(注浆登记)的查询数据
  3495. /// </summary>
  3496. /// <param name="accountCode"></param>
  3497. /// <param name="userCode"></param>
  3498. /// <param name="userPassword"></param>
  3499. /// <param name="sessionKey"></param>
  3500. /// <param name="se">查询条件</param>
  3501. /// <returns>Dataset</returns>
  3502. public ActionResult GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  3503. {
  3504. ActionResult actionResult = new ActionResult();
  3505. try
  3506. {
  3507. // 验证请求头信息
  3508. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3509. // 验证失败
  3510. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3511. {
  3512. return actionResult;
  3513. }
  3514. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3515. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3516. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3517. {
  3518. // PDA不显示的列删除掉
  3519. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3520. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3521. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3522. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3523. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3524. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3525. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3526. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3527. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3528. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3529. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3530. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3531. actionResult.Status = (int)Constant.PDAResult.Success;
  3532. }
  3533. else
  3534. {
  3535. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3536. actionResult.Message = "无查询数据";
  3537. }
  3538. }
  3539. catch (Exception ex)
  3540. {
  3541. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3542. OutputLog.TraceLog(LogPriority.Error,
  3543. this.ToString(),
  3544. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3545. ex.ToString(),
  3546. LocalPath.LogExePath);
  3547. actionResult.Status = (int)Constant.PDAResult.Exception;
  3548. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3549. }
  3550. return actionResult;
  3551. }
  3552. /// <summary>
  3553. /// 获取(注浆登记)的查询数据
  3554. /// </summary>
  3555. /// <param name="accountCode"></param>
  3556. /// <param name="userCode"></param>
  3557. /// <param name="userPassword"></param>
  3558. /// <param name="sessionKey"></param>
  3559. /// <param name="se">查询条件</param>
  3560. /// <returns>Dataset</returns>
  3561. public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3562. {
  3563. ActionResult actionResult = new ActionResult();
  3564. try
  3565. {
  3566. // 验证请求头信息
  3567. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3568. // 验证失败
  3569. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3570. {
  3571. return actionResult;
  3572. }
  3573. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3574. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3575. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3576. {
  3577. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3578. actionResult.Status = (int)Constant.PDAResult.Success;
  3579. }
  3580. else
  3581. {
  3582. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3583. actionResult.Message = "无查询数据";
  3584. }
  3585. }
  3586. catch (Exception ex)
  3587. {
  3588. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3589. OutputLog.TraceLog(LogPriority.Error,
  3590. this.ToString(),
  3591. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3592. ex.ToString(),
  3593. LocalPath.LogExePath);
  3594. actionResult.Status = (int)Constant.PDAResult.Exception;
  3595. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3596. }
  3597. return actionResult;
  3598. }
  3599. /// <summary>
  3600. ///获得成型线信息
  3601. /// </summary>
  3602. /// <param name="accountCode"></param>
  3603. /// <param name="userCode"></param>
  3604. /// <param name="userPassword"></param>
  3605. /// <param name="sessionKey"></param>
  3606. /// <param name="se">查询条件</param>
  3607. /// <returns>Dataset</returns>
  3608. public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3609. {
  3610. ActionResult actionResult = new ActionResult();
  3611. try
  3612. {
  3613. // 验证请求头信息
  3614. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3615. // 验证失败
  3616. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3617. {
  3618. return actionResult;
  3619. }
  3620. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3621. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3622. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3623. {
  3624. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3625. actionResult.Status = (int)Constant.PDAResult.Success;
  3626. }
  3627. else
  3628. {
  3629. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3630. actionResult.Message = "无查询数据";
  3631. }
  3632. }
  3633. catch (Exception ex)
  3634. {
  3635. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3636. OutputLog.TraceLog(LogPriority.Error,
  3637. this.ToString(),
  3638. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3639. ex.ToString(),
  3640. LocalPath.LogExePath);
  3641. actionResult.Status = (int)Constant.PDAResult.Exception;
  3642. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3643. }
  3644. return actionResult;
  3645. }
  3646. /// <summary>
  3647. ///获取在产产品的信息标识列表
  3648. /// </summary>
  3649. /// <param name="accountCode"></param>
  3650. /// <param name="userCode"></param>
  3651. /// <param name="userPassword"></param>
  3652. /// <param name="sessionKey"></param>
  3653. /// <param name="barcode">查询条件</param>
  3654. /// <returns>Dataset</returns>
  3655. public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3656. {
  3657. ActionResult actionResult = new ActionResult();
  3658. try
  3659. {
  3660. // 验证请求头信息
  3661. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3662. // 验证失败
  3663. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3664. {
  3665. return actionResult;
  3666. }
  3667. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3668. () => PMModuleLogic.GetInProductionDataList(barcode));
  3669. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3670. {
  3671. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3672. actionResult.Status = (int)Constant.PDAResult.Success;
  3673. }
  3674. else
  3675. {
  3676. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3677. actionResult.Message = "无查询数据";
  3678. }
  3679. }
  3680. catch (Exception ex)
  3681. {
  3682. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3683. OutputLog.TraceLog(LogPriority.Error,
  3684. this.ToString(),
  3685. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3686. ex.ToString(),
  3687. LocalPath.LogExePath);
  3688. actionResult.Status = (int)Constant.PDAResult.Exception;
  3689. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3690. }
  3691. return actionResult;
  3692. }
  3693. /// <summary>
  3694. ///获取条码是否注浆登记过,0行无效
  3695. /// </summary>
  3696. /// <param name="accountCode"></param>
  3697. /// <param name="userCode"></param>
  3698. /// <param name="userPassword"></param>
  3699. /// <param name="sessionKey"></param>
  3700. /// <param name="barcode">查询条件</param>
  3701. /// <returns>Dataset</returns>
  3702. public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3703. {
  3704. ActionResult actionResult = new ActionResult();
  3705. try
  3706. {
  3707. // 验证请求头信息
  3708. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3709. // 验证失败
  3710. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3711. {
  3712. return actionResult;
  3713. }
  3714. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3715. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  3716. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3717. {
  3718. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3719. actionResult.Status = (int)Constant.PDAResult.Success;
  3720. }
  3721. else
  3722. {
  3723. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3724. actionResult.Message = "该产品条码无效,无法报损!";
  3725. }
  3726. }
  3727. catch (Exception ex)
  3728. {
  3729. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3730. OutputLog.TraceLog(LogPriority.Error,
  3731. this.ToString(),
  3732. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3733. ex.ToString(),
  3734. LocalPath.LogExePath);
  3735. actionResult.Status = (int)Constant.PDAResult.Exception;
  3736. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3737. }
  3738. return actionResult;
  3739. }
  3740. /// <summary>
  3741. /// 获取登陆帐户有变更条码权限
  3742. /// </summary>
  3743. /// <param name="accountCode"></param>
  3744. /// <param name="userCode"></param>
  3745. /// <param name="userPassword"></param>
  3746. /// <param name="sessionKey"></param>
  3747. /// <returns></returns>
  3748. public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3749. {
  3750. ActionResult actionResult = new ActionResult();
  3751. try
  3752. {
  3753. // 验证请求头信息
  3754. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3755. // 验证失败
  3756. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3757. {
  3758. return actionResult;
  3759. }
  3760. int returnValue = ServiceInvoker.Invoke<int>(this,
  3761. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  3762. actionResult.Result = JsonHelper.ToJson(returnValue);
  3763. actionResult.Status = (int)Constant.PDAResult.Success;
  3764. }
  3765. catch (Exception ex)
  3766. {
  3767. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3768. OutputLog.TraceLog(LogPriority.Error,
  3769. this.ToString(),
  3770. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3771. ex.ToString(),
  3772. LocalPath.LogExePath);
  3773. actionResult.Status = (int)Constant.PDAResult.Exception;
  3774. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3775. }
  3776. return actionResult;
  3777. }
  3778. /// <summary>
  3779. /// 成检时获取此条码是否报损
  3780. /// </summary>
  3781. /// <param name="accountCode"></param>
  3782. /// <param name="userCode"></param>
  3783. /// <param name="userPassword"></param>
  3784. /// <param name="sessionKey"></param>
  3785. /// <param name="barcode">产品条码</param>
  3786. /// <returns></returns>
  3787. public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3788. {
  3789. ActionResult actionResult = new ActionResult();
  3790. try
  3791. {
  3792. // 验证请求头信息
  3793. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3794. // 验证失败
  3795. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3796. {
  3797. return actionResult;
  3798. }
  3799. int returnValue = ServiceInvoker.Invoke<int>(this,
  3800. () => PMModuleLogic.CheckScrapProduct(barcode));
  3801. if (returnValue == -100)
  3802. {
  3803. actionResult.Result = JsonHelper.ToJson(returnValue);
  3804. actionResult.Status = (int)Constant.PDAResult.Success;
  3805. }
  3806. else
  3807. {
  3808. actionResult.Status = (int)Constant.PDAResult.Fail;
  3809. if (returnValue == 0)
  3810. {
  3811. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  3812. }
  3813. else
  3814. {
  3815. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  3816. }
  3817. }
  3818. }
  3819. catch (Exception ex)
  3820. {
  3821. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3822. OutputLog.TraceLog(LogPriority.Error,
  3823. this.ToString(),
  3824. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3825. ex.ToString(),
  3826. LocalPath.LogExePath);
  3827. actionResult.Status = (int)Constant.PDAResult.Exception;
  3828. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3829. }
  3830. return actionResult;
  3831. }
  3832. /// <summary>
  3833. /// 获取产品完成工序的ID(PDA)
  3834. /// </summary>
  3835. /// <param name="barcode">产品条码</param>
  3836. /// <returns>int</returns>
  3837. public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3838. {
  3839. ActionResult actionResult = new ActionResult();
  3840. try
  3841. {
  3842. // 验证请求头信息
  3843. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3844. // 验证失败
  3845. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3846. {
  3847. return actionResult;
  3848. }
  3849. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3850. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  3851. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3852. actionResult.Status = (int)Constant.PDAResult.Success;
  3853. }
  3854. catch (Exception ex)
  3855. {
  3856. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3857. OutputLog.TraceLog(LogPriority.Error,
  3858. this.ToString(),
  3859. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3860. ex.ToString(),
  3861. LocalPath.LogExePath);
  3862. actionResult.Status = (int)Constant.PDAResult.Exception;
  3863. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3864. }
  3865. return actionResult;
  3866. }
  3867. /// <summary>
  3868. /// 获取产品完成工序的ID(PDA)
  3869. /// </summary>
  3870. /// <param name="barcode">产品条码</param>
  3871. /// <returns>int</returns>
  3872. public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3873. {
  3874. ActionResult actionResult = new ActionResult();
  3875. try
  3876. {
  3877. // 验证请求头信息
  3878. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3879. // 验证失败
  3880. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3881. {
  3882. return actionResult;
  3883. }
  3884. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3885. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  3886. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3887. actionResult.Status = (int)Constant.PDAResult.Success;
  3888. }
  3889. catch (Exception ex)
  3890. {
  3891. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3892. OutputLog.TraceLog(LogPriority.Error,
  3893. this.ToString(),
  3894. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3895. ex.ToString(),
  3896. LocalPath.LogExePath);
  3897. actionResult.Status = (int)Constant.PDAResult.Exception;
  3898. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3899. }
  3900. return actionResult;
  3901. }
  3902. /// <summary>
  3903. /// 成检-校验生产工号
  3904. /// </summary>
  3905. /// <param name="usercode">生产工号</param>
  3906. /// <returns>int</returns>
  3907. public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode)
  3908. {
  3909. ActionResult actionResult = new ActionResult();
  3910. try
  3911. {
  3912. // 验证请求头信息
  3913. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3914. // 验证失败
  3915. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3916. {
  3917. return actionResult;
  3918. }
  3919. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3920. () => PDAModuleLogic.GetUserCode(usercode, sUserInfo));
  3921. actionResult.Result = JsonHelper.ToJson(ds);
  3922. actionResult.Status = (int)Constant.PDAResult.Success;
  3923. }
  3924. catch (Exception ex)
  3925. {
  3926. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3927. OutputLog.TraceLog(LogPriority.Error,
  3928. this.ToString(),
  3929. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3930. ex.ToString(),
  3931. LocalPath.LogExePath);
  3932. actionResult.Status = (int)Constant.PDAResult.Exception;
  3933. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3934. }
  3935. return actionResult;
  3936. }
  3937. /// <summary>
  3938. /// 更新漏扫的成型工号
  3939. /// </summary>
  3940. /// <param name="accountCode"></param>
  3941. /// <param name="userCode"></param>
  3942. /// <param name="userPassword"></param>
  3943. /// <param name="sessionKey"></param>
  3944. /// <param name="groutingUserCode">成型工号</param>
  3945. /// <param name="missingID">漏扫ID</param>
  3946. /// <returns></returns>
  3947. public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  3948. {
  3949. ActionResult actionResult = new ActionResult();
  3950. try
  3951. {
  3952. // 验证请求头信息
  3953. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3954. // 验证失败
  3955. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3956. {
  3957. return actionResult;
  3958. }
  3959. int returnValue = ServiceInvoker.Invoke<int>(this,
  3960. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  3961. if (returnValue != -1)
  3962. {
  3963. actionResult.Result = JsonHelper.ToJson(returnValue);
  3964. actionResult.Status = (int)Constant.PDAResult.Success;
  3965. }
  3966. else
  3967. {
  3968. actionResult.Status = (int)Constant.PDAResult.Fail;
  3969. actionResult.Message = "存在无效的漏扫工号";
  3970. }
  3971. }
  3972. catch (Exception ex)
  3973. {
  3974. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3975. OutputLog.TraceLog(LogPriority.Error,
  3976. this.ToString(),
  3977. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3978. ex.ToString(),
  3979. LocalPath.LogExePath);
  3980. actionResult.Status = (int)Constant.PDAResult.Exception;
  3981. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3982. }
  3983. return actionResult;
  3984. }
  3985. /// <summary>
  3986. /// 在入窑工序检验窑车号是否存在
  3987. /// </summary>
  3988. /// <param name="accountCode"></param>
  3989. /// <param name="userCode"></param>
  3990. /// <param name="userPassword"></param>
  3991. /// <param name="sessionKey"></param>
  3992. /// <param name="kilncarcode">窑车编码</param>
  3993. /// <param name="procedureid">工序ID</param>
  3994. /// <returns></returns>
  3995. public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  3996. {
  3997. ActionResult actionResult = new ActionResult();
  3998. try
  3999. {
  4000. // 验证请求头信息
  4001. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4002. // 验证失败
  4003. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4004. {
  4005. return actionResult;
  4006. }
  4007. int returnValue = ServiceInvoker.Invoke<int>(this,
  4008. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  4009. if (returnValue == 1)
  4010. {
  4011. actionResult.Result = JsonHelper.ToJson(returnValue);
  4012. actionResult.Status = (int)Constant.PDAResult.Success;
  4013. }
  4014. else
  4015. {
  4016. actionResult.Status = (int)Constant.PDAResult.Fail;
  4017. if (returnValue == -99)
  4018. actionResult.Message = "窑炉车号无效";
  4019. else if (returnValue == -98)
  4020. actionResult.Message = "窑车己无产品";
  4021. else if (returnValue == -97)
  4022. actionResult.Message = "窑车没有入窑,不可以撤销";
  4023. else if (returnValue == -1)
  4024. actionResult.Message = "保存失败";
  4025. }
  4026. }
  4027. catch (Exception ex)
  4028. {
  4029. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4030. OutputLog.TraceLog(LogPriority.Error,
  4031. this.ToString(),
  4032. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4033. ex.ToString(),
  4034. LocalPath.LogExePath);
  4035. actionResult.Status = (int)Constant.PDAResult.Exception;
  4036. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4037. }
  4038. return actionResult;
  4039. }
  4040. /// <summary>
  4041. /// 获取盘点单列表
  4042. /// </summary>
  4043. /// <param name="sUserInfo"></param>
  4044. /// <returns></returns>
  4045. public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey)
  4046. {
  4047. ActionResult actionResult = new ActionResult();
  4048. try
  4049. {
  4050. // 验证请求头信息
  4051. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4052. // 验证失败
  4053. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4054. {
  4055. return actionResult;
  4056. }
  4057. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4058. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  4059. actionResult.Result = JsonHelper.ToJson(ds);
  4060. actionResult.Status = (int)Constant.PDAResult.Success;
  4061. }
  4062. catch (Exception ex)
  4063. {
  4064. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4065. OutputLog.TraceLog(LogPriority.Error,
  4066. this.ToString(),
  4067. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4068. ex.ToString(),
  4069. LocalPath.LogExePath);
  4070. actionResult.Status = (int)Constant.PDAResult.Exception;
  4071. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4072. }
  4073. return actionResult;
  4074. }
  4075. /// <summary>
  4076. /// 进行盘点操作
  4077. /// </summary>
  4078. /// <param name="accountCode"></param>
  4079. /// <param name="userCode"></param>
  4080. /// <param name="userPassword"></param>
  4081. /// <param name="sessionKey"></param>
  4082. /// <param name="InCheckedID">盘点单ID</param>
  4083. /// <param name="BarCode">产品条码</param>
  4084. /// <returns></returns>
  4085. public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4086. {
  4087. ActionResult actionResult = new ActionResult();
  4088. try
  4089. {
  4090. // 验证请求头信息
  4091. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4092. // 验证失败
  4093. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4094. {
  4095. return actionResult;
  4096. }
  4097. int returnValue = ServiceInvoker.Invoke<int>(this,
  4098. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4099. if (returnValue > 0)
  4100. {
  4101. actionResult.Result = JsonHelper.ToJson(returnValue);
  4102. actionResult.Status = (int)Constant.PDAResult.Success;
  4103. actionResult.Message = "产品" + BarCode + "盘点成功";
  4104. }
  4105. else if (returnValue == 10)
  4106. {
  4107. actionResult.Result = JsonHelper.ToJson(returnValue);
  4108. actionResult.Status = (int)Constant.PDAResult.Success;
  4109. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4110. }
  4111. else
  4112. {
  4113. actionResult.Status = (int)Constant.PDAResult.Fail;
  4114. if (returnValue == -2)
  4115. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4116. //if (returnValue == 10)
  4117. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4118. //if (returnValue > 0)
  4119. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4120. if (returnValue == -22)
  4121. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4122. if (returnValue == -23)
  4123. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4124. if (returnValue == -24)
  4125. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4126. if (returnValue == -25)
  4127. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4128. else if (returnValue == 0)
  4129. actionResult.Message = "盘点失败";
  4130. }
  4131. }
  4132. catch (Exception ex)
  4133. {
  4134. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4135. OutputLog.TraceLog(LogPriority.Error,
  4136. this.ToString(),
  4137. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4138. ex.ToString(),
  4139. LocalPath.LogExePath);
  4140. actionResult.Status = (int)Constant.PDAResult.Exception;
  4141. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4142. }
  4143. return actionResult;
  4144. }
  4145. #region 班次配置
  4146. /// <summary>
  4147. /// 班次配置-通过工号获取工种列表
  4148. /// </summary>
  4149. /// <param name="userId">工号ID</param>
  4150. /// <returns></returns>
  4151. public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4152. {
  4153. ActionResult actionResult = new ActionResult();
  4154. try
  4155. {
  4156. // 验证请求头信息
  4157. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4158. // 验证失败
  4159. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4160. {
  4161. return actionResult;
  4162. }
  4163. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4164. () => SystemModuleLogic.GetJobByUserId(userId));
  4165. actionResult.Result = JsonHelper.ToJson(ds);
  4166. actionResult.Status = (int)Constant.PDAResult.Success;
  4167. }
  4168. catch (Exception ex)
  4169. {
  4170. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4171. OutputLog.TraceLog(LogPriority.Error,
  4172. this.ToString(),
  4173. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4174. ex.ToString(),
  4175. LocalPath.LogExePath);
  4176. actionResult.Status = (int)Constant.PDAResult.Exception;
  4177. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4178. }
  4179. return actionResult;
  4180. }
  4181. ///// <summary>
  4182. ///// 班次配置-根据工号查询员工档案信息
  4183. ///// </summary>
  4184. ///// <param name="userId">工号ID</param>
  4185. ///// <returns></returns>
  4186. //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4187. //{
  4188. // ActionResult actionResult = new ActionResult();
  4189. // try
  4190. // {
  4191. // // 验证请求头信息
  4192. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4193. // // 验证失败
  4194. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4195. // {
  4196. // return actionResult;
  4197. // }
  4198. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4199. // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
  4200. // actionResult.Result = JsonHelper.ToJson(ds);
  4201. // actionResult.Status = (int)Constant.PDAResult.Success;
  4202. // }
  4203. // catch (Exception ex)
  4204. // {
  4205. // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4206. // OutputLog.TraceLog(LogPriority.Error,
  4207. // this.ToString(),
  4208. // System.Reflection.MethodBase.GetCurrentMethod().Name,
  4209. // ex.ToString(),
  4210. // LocalPath.LogExePath);
  4211. // actionResult.Status = (int)Constant.PDAResult.Exception;
  4212. // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4213. // }
  4214. // return actionResult;
  4215. //}
  4216. /// <summary>
  4217. /// 班次配置-根据员工姓名查员工信息
  4218. /// </summary>
  4219. /// <param name="searchStaffEntity"></param>
  4220. /// <returns></returns>
  4221. public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4222. {
  4223. ActionResult actionResult = new ActionResult();
  4224. try
  4225. {
  4226. // 验证请求头信息
  4227. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4228. // 验证失败
  4229. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4230. {
  4231. return actionResult;
  4232. }
  4233. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4234. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4235. actionResult.Result = JsonHelper.ToJson(ds);
  4236. actionResult.Status = (int)Constant.PDAResult.Success;
  4237. }
  4238. catch (Exception ex)
  4239. {
  4240. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4241. OutputLog.TraceLog(LogPriority.Error,
  4242. this.ToString(),
  4243. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4244. ex.ToString(),
  4245. LocalPath.LogExePath);
  4246. actionResult.Status = (int)Constant.PDAResult.Exception;
  4247. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4248. }
  4249. return actionResult;
  4250. }
  4251. /// <summary>
  4252. /// 获取班次配置信息
  4253. /// </summary>
  4254. /// <param name="searchEntity"></param>
  4255. /// <returns></returns>
  4256. public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  4257. {
  4258. ActionResult actionResult = new ActionResult();
  4259. try
  4260. {
  4261. // 验证请求头信息
  4262. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4263. // 验证失败
  4264. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4265. {
  4266. return actionResult;
  4267. }
  4268. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4269. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4270. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4271. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4272. actionResult.Result = JsonHelper.ToJson(ds);
  4273. actionResult.Status = (int)Constant.PDAResult.Success;
  4274. }
  4275. catch (Exception ex)
  4276. {
  4277. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4278. OutputLog.TraceLog(LogPriority.Error,
  4279. this.ToString(),
  4280. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4281. ex.ToString(),
  4282. LocalPath.LogExePath);
  4283. actionResult.Status = (int)Constant.PDAResult.Exception;
  4284. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4285. }
  4286. return actionResult;
  4287. }
  4288. public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4289. {
  4290. ActionResult actionResult = new ActionResult();
  4291. try
  4292. {
  4293. // 验证请求头信息
  4294. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4295. // 验证失败
  4296. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4297. {
  4298. return actionResult;
  4299. }
  4300. int returnValue = ServiceInvoker.Invoke<int>(this,
  4301. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4302. if (returnValue > 0)
  4303. {
  4304. actionResult.Result = JsonHelper.ToJson(returnValue);
  4305. actionResult.Status = (int)Constant.PDAResult.Success;
  4306. }
  4307. else
  4308. {
  4309. actionResult.Status = (int)Constant.PDAResult.Fail;
  4310. actionResult.Message = "保存失败";
  4311. }
  4312. }
  4313. catch (Exception ex)
  4314. {
  4315. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4316. OutputLog.TraceLog(LogPriority.Error,
  4317. this.ToString(),
  4318. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4319. ex.ToString(),
  4320. LocalPath.LogExePath);
  4321. actionResult.Status = (int)Constant.PDAResult.Exception;
  4322. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4323. }
  4324. return actionResult;
  4325. }
  4326. /// <summary>
  4327. /// 班次配置--获取详细信息
  4328. /// </summary>
  4329. /// <param name="searchEntity"></param>
  4330. /// <returns></returns>
  4331. public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4332. {
  4333. ActionResult actionResult = new ActionResult();
  4334. try
  4335. {
  4336. // 验证请求头信息
  4337. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4338. // 验证失败
  4339. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4340. {
  4341. return actionResult;
  4342. }
  4343. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4344. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4345. actionResult.Result = JsonHelper.ToJson(ds);
  4346. actionResult.Status = (int)Constant.PDAResult.Success;
  4347. }
  4348. catch (Exception ex)
  4349. {
  4350. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4351. OutputLog.TraceLog(LogPriority.Error,
  4352. this.ToString(),
  4353. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4354. ex.ToString(),
  4355. LocalPath.LogExePath);
  4356. actionResult.Status = (int)Constant.PDAResult.Exception;
  4357. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4358. }
  4359. return actionResult;
  4360. }
  4361. /// <summary>
  4362. /// 获取用户是否有班次配置权限
  4363. /// </summary>
  4364. /// <param name="accountCode"></param>
  4365. /// <param name="userCode"></param>
  4366. /// <param name="userPassword"></param>
  4367. /// <param name="sessionKey"></param>
  4368. /// <returns></returns>
  4369. public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4370. {
  4371. ActionResult actionResult = new ActionResult();
  4372. try
  4373. {
  4374. // 验证请求头信息
  4375. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4376. // 验证失败
  4377. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4378. {
  4379. return actionResult;
  4380. }
  4381. int returnValue = ServiceInvoker.Invoke<int>(this,
  4382. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4383. actionResult.Result = JsonHelper.ToJson(returnValue);
  4384. actionResult.Status = (int)Constant.PDAResult.Success;
  4385. }
  4386. catch (Exception ex)
  4387. {
  4388. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4389. OutputLog.TraceLog(LogPriority.Error,
  4390. this.ToString(),
  4391. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4392. ex.ToString(),
  4393. LocalPath.LogExePath);
  4394. actionResult.Status = (int)Constant.PDAResult.Exception;
  4395. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4396. }
  4397. return actionResult;
  4398. }
  4399. /// <summary>
  4400. /// 获取盘点单列表
  4401. /// </summary>
  4402. /// <param name="sUserInfo"></param>
  4403. /// <returns></returns>
  4404. public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  4405. {
  4406. ActionResult actionResult = new ActionResult();
  4407. try
  4408. {
  4409. // 验证请求头信息
  4410. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4411. // 验证失败
  4412. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4413. {
  4414. return actionResult;
  4415. }
  4416. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4417. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4418. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4419. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4420. actionResult.Result = JsonHelper.ToJson(ds);
  4421. actionResult.Status = (int)Constant.PDAResult.Success;
  4422. }
  4423. catch (Exception ex)
  4424. {
  4425. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4426. OutputLog.TraceLog(LogPriority.Error,
  4427. this.ToString(),
  4428. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4429. ex.ToString(),
  4430. LocalPath.LogExePath);
  4431. actionResult.Status = (int)Constant.PDAResult.Exception;
  4432. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4433. }
  4434. return actionResult;
  4435. }
  4436. #endregion
  4437. #region PDA报表
  4438. /// <summary>
  4439. /// 产品质量跟踪
  4440. /// </summary>
  4441. /// <param name="accountCode"></param>
  4442. /// <param name="userCode"></param>
  4443. /// <param name="userPassword"></param>
  4444. /// <param name="sessionKey"></param>
  4445. /// <param name="se"></param>
  4446. /// <returns></returns>
  4447. public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4448. {
  4449. ActionResult actionResult = new ActionResult();
  4450. try
  4451. {
  4452. // 验证请求头信息
  4453. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4454. // 验证失败
  4455. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4456. {
  4457. return actionResult;
  4458. }
  4459. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4460. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4461. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4462. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4463. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4464. {
  4465. actionResult.Status = (int)Constant.PDAResult.Fail;
  4466. actionResult.Message = Messages.MSG_CMN_I002;
  4467. }
  4468. else
  4469. {
  4470. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4471. actionResult.Status = (int)Constant.PDAResult.Success;
  4472. }
  4473. }
  4474. catch (Exception ex)
  4475. {
  4476. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4477. OutputLog.TraceLog(LogPriority.Error,
  4478. this.ToString(),
  4479. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4480. ex.ToString(),
  4481. LocalPath.LogExePath);
  4482. actionResult.Status = (int)Constant.PDAResult.Exception;
  4483. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4484. }
  4485. return actionResult;
  4486. }
  4487. /// <summary>
  4488. /// 工号产量质量分析表
  4489. /// </summary>
  4490. /// <param name="accountCode"></param>
  4491. /// <param name="userCode"></param>
  4492. /// <param name="userPassword"></param>
  4493. /// <param name="sessionKey"></param>
  4494. /// <param name="se"></param>
  4495. /// <returns></returns>
  4496. public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4497. int rptSProcedureID, string workcode, string date)
  4498. {
  4499. ActionResult actionResult = new ActionResult();
  4500. try
  4501. {
  4502. // 验证请求头信息
  4503. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4504. // 验证失败
  4505. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4506. {
  4507. return actionResult;
  4508. }
  4509. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4510. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4511. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4512. {
  4513. actionResult.Status = (int)Constant.PDAResult.Fail;
  4514. actionResult.Message = Messages.MSG_CMN_I002;
  4515. }
  4516. else
  4517. {
  4518. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4519. actionResult.Status = (int)Constant.PDAResult.Success;
  4520. }
  4521. }
  4522. catch (Exception ex)
  4523. {
  4524. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4525. OutputLog.TraceLog(LogPriority.Error,
  4526. this.ToString(),
  4527. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4528. ex.ToString(),
  4529. LocalPath.LogExePath);
  4530. actionResult.Status = (int)Constant.PDAResult.Exception;
  4531. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4532. }
  4533. return actionResult;
  4534. }
  4535. /// <summary>
  4536. /// 半检数据统计表
  4537. /// </summary>
  4538. /// <param name="accountCode"></param>
  4539. /// <param name="userCode"></param>
  4540. /// <param name="userPassword"></param>
  4541. /// <param name="sessionKey"></param>
  4542. /// <param name="se"></param>
  4543. /// <returns></returns>
  4544. public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4545. string workcode, string datebegin, string dateend)
  4546. {
  4547. ActionResult actionResult = new ActionResult();
  4548. try
  4549. {
  4550. // 验证请求头信息
  4551. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4552. // 验证失败
  4553. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4554. {
  4555. return actionResult;
  4556. }
  4557. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4558. DateTime datetimeend = Convert.ToDateTime(dateend);
  4559. datetimebegin = datetimebegin.Date;
  4560. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4561. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4562. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4563. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4564. {
  4565. actionResult.Status = (int)Constant.PDAResult.Fail;
  4566. actionResult.Message = Messages.MSG_CMN_I002;
  4567. }
  4568. else
  4569. {
  4570. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4571. actionResult.Status = (int)Constant.PDAResult.Success;
  4572. }
  4573. }
  4574. catch (Exception ex)
  4575. {
  4576. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4577. OutputLog.TraceLog(LogPriority.Error,
  4578. this.ToString(),
  4579. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4580. ex.ToString(),
  4581. LocalPath.LogExePath);
  4582. actionResult.Status = (int)Constant.PDAResult.Exception;
  4583. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4584. }
  4585. return actionResult;
  4586. }
  4587. /// <summary>
  4588. /// 工号质量统计表
  4589. /// </summary>
  4590. /// <param name="accountCode"></param>
  4591. /// <param name="userCode"></param>
  4592. /// <param name="userPassword"></param>
  4593. /// <param name="sessionKey"></param>
  4594. /// <param name="se"></param>
  4595. /// <returns></returns>
  4596. public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4597. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4598. {
  4599. ActionResult actionResult = new ActionResult();
  4600. try
  4601. {
  4602. // 验证请求头信息
  4603. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4604. // 验证失败
  4605. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4606. {
  4607. return actionResult;
  4608. }
  4609. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4610. DateTime datetimeend = Convert.ToDateTime(dateend);
  4611. datetimebegin = datetimebegin.Date;
  4612. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4613. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4614. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4615. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4616. {
  4617. actionResult.Status = (int)Constant.PDAResult.Fail;
  4618. actionResult.Message = Messages.MSG_CMN_I002;
  4619. }
  4620. else
  4621. {
  4622. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4623. actionResult.Status = (int)Constant.PDAResult.Success;
  4624. }
  4625. }
  4626. catch (Exception ex)
  4627. {
  4628. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4629. OutputLog.TraceLog(LogPriority.Error,
  4630. this.ToString(),
  4631. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4632. ex.ToString(),
  4633. LocalPath.LogExePath);
  4634. actionResult.Status = (int)Constant.PDAResult.Exception;
  4635. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4636. }
  4637. return actionResult;
  4638. }
  4639. /// <summary>
  4640. /// 损坯数据统计表
  4641. /// </summary>
  4642. /// <param name="accountCode"></param>
  4643. /// <param name="userCode"></param>
  4644. /// <param name="userPassword"></param>
  4645. /// <param name="sessionKey"></param>
  4646. /// <param name="se"></param>
  4647. /// <returns></returns>
  4648. public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4649. string workcode, string datebegin, string dateend)
  4650. {
  4651. ActionResult actionResult = new ActionResult();
  4652. try
  4653. {
  4654. // 验证请求头信息
  4655. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4656. // 验证失败
  4657. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4658. {
  4659. return actionResult;
  4660. }
  4661. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4662. DateTime datetimeend = Convert.ToDateTime(dateend);
  4663. datetimebegin = datetimebegin.Date;
  4664. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4665. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4666. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4667. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4668. {
  4669. actionResult.Status = (int)Constant.PDAResult.Fail;
  4670. actionResult.Message = Messages.MSG_CMN_I002;
  4671. }
  4672. else
  4673. {
  4674. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4675. actionResult.Status = (int)Constant.PDAResult.Success;
  4676. }
  4677. }
  4678. catch (Exception ex)
  4679. {
  4680. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4681. OutputLog.TraceLog(LogPriority.Error,
  4682. this.ToString(),
  4683. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4684. ex.ToString(),
  4685. LocalPath.LogExePath);
  4686. actionResult.Status = (int)Constant.PDAResult.Exception;
  4687. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4688. }
  4689. return actionResult;
  4690. }
  4691. #endregion
  4692. /// <summary>
  4693. /// 取得报表数据源数据
  4694. /// </summary>
  4695. /// <param name="accountCode"></param>
  4696. /// <param name="userCode"></param>
  4697. /// <param name="userPassword"></param>
  4698. /// <param name="sessionKey"></param>
  4699. /// <returns></returns>
  4700. public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
  4701. {
  4702. ActionResult actionResult = new ActionResult();
  4703. try
  4704. {
  4705. // 验证请求头信息
  4706. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4707. // 验证失败
  4708. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4709. {
  4710. return actionResult;
  4711. }
  4712. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4713. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4714. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4715. {
  4716. actionResult.Status = (int)Constant.PDAResult.Fail;
  4717. actionResult.Message = Messages.MSG_CMN_I002;
  4718. }
  4719. else
  4720. {
  4721. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4722. actionResult.Status = (int)Constant.PDAResult.Success;
  4723. }
  4724. }
  4725. catch (Exception ex)
  4726. {
  4727. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4728. OutputLog.TraceLog(LogPriority.Error,
  4729. this.ToString(),
  4730. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4731. ex.ToString(),
  4732. LocalPath.LogExePath);
  4733. actionResult.Status = (int)Constant.PDAResult.Exception;
  4734. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4735. }
  4736. return actionResult;
  4737. }
  4738. /// <summary>
  4739. /// 取得报表的查询数据源统计工序数据
  4740. /// </summary>
  4741. /// <param name="accountCode"></param>
  4742. /// <param name="userCode"></param>
  4743. /// <param name="userPassword"></param>
  4744. /// <param name="sessionKey"></param>
  4745. /// <param name="RptProcedureID"></param>
  4746. /// <returns></returns>
  4747. public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  4748. {
  4749. ActionResult actionResult = new ActionResult();
  4750. try
  4751. {
  4752. // 验证请求头信息
  4753. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4754. // 验证失败
  4755. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4756. {
  4757. return actionResult;
  4758. }
  4759. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4760. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  4761. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4762. {
  4763. actionResult.Status = (int)Constant.PDAResult.Fail;
  4764. actionResult.Message = Messages.MSG_CMN_I002;
  4765. }
  4766. else
  4767. {
  4768. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4769. actionResult.Status = (int)Constant.PDAResult.Success;
  4770. }
  4771. }
  4772. catch (Exception ex)
  4773. {
  4774. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4775. OutputLog.TraceLog(LogPriority.Error,
  4776. this.ToString(),
  4777. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4778. ex.ToString(),
  4779. LocalPath.LogExePath);
  4780. actionResult.Status = (int)Constant.PDAResult.Exception;
  4781. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4782. }
  4783. return actionResult;
  4784. }
  4785. /// <summary>
  4786. /// 获取用户是否有统计产成品权限
  4787. /// </summary>
  4788. /// <param name="accountCode"></param>
  4789. /// <param name="userCode"></param>
  4790. /// <param name="userPassword"></param>
  4791. /// <param name="sessionKey"></param>
  4792. /// <returns></returns>
  4793. public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4794. {
  4795. ActionResult actionResult = new ActionResult();
  4796. try
  4797. {
  4798. // 验证请求头信息
  4799. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4800. // 验证失败
  4801. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4802. {
  4803. return actionResult;
  4804. }
  4805. int returnValue = ServiceInvoker.Invoke<int>(this,
  4806. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  4807. actionResult.Result = JsonHelper.ToJson(returnValue);
  4808. actionResult.Status = (int)Constant.PDAResult.Success;
  4809. }
  4810. catch (Exception ex)
  4811. {
  4812. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4813. OutputLog.TraceLog(LogPriority.Error,
  4814. this.ToString(),
  4815. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4816. ex.ToString(),
  4817. LocalPath.LogExePath);
  4818. actionResult.Status = (int)Constant.PDAResult.Exception;
  4819. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4820. }
  4821. return actionResult;
  4822. }
  4823. /// <summary>
  4824. /// 获取用户是否有盘点权限
  4825. /// </summary>
  4826. /// <param name="accountCode"></param>
  4827. /// <param name="userCode"></param>
  4828. /// <param name="userPassword"></param>
  4829. /// <param name="sessionKey"></param>
  4830. /// <returns></returns>
  4831. public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4832. {
  4833. ActionResult actionResult = new ActionResult();
  4834. try
  4835. {
  4836. // 验证请求头信息
  4837. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4838. // 验证失败
  4839. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4840. {
  4841. return actionResult;
  4842. }
  4843. int returnValue = ServiceInvoker.Invoke<int>(this,
  4844. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  4845. actionResult.Result = JsonHelper.ToJson(returnValue);
  4846. actionResult.Status = (int)Constant.PDAResult.Success;
  4847. }
  4848. catch (Exception ex)
  4849. {
  4850. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4851. OutputLog.TraceLog(LogPriority.Error,
  4852. this.ToString(),
  4853. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4854. ex.ToString(),
  4855. LocalPath.LogExePath);
  4856. actionResult.Status = (int)Constant.PDAResult.Exception;
  4857. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4858. }
  4859. return actionResult;
  4860. }
  4861. /// <summary>
  4862. /// 根据条件查询是否存在班次配置
  4863. /// </summary>
  4864. /// <param name="accountCode"></param>
  4865. /// <param name="userCode"></param>
  4866. /// <param name="userPassword"></param>
  4867. /// <param name="sessionKey"></param>
  4868. /// <param name="userCode">工号编码</param>
  4869. /// <returns></returns>
  4870. public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  4871. {
  4872. ActionResult actionResult = new ActionResult();
  4873. try
  4874. {
  4875. // 验证请求头信息
  4876. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4877. // 验证失败
  4878. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4879. {
  4880. return actionResult;
  4881. }
  4882. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4883. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  4884. actionResult.Result = JsonHelper.ToJson(ds);
  4885. actionResult.Status = (int)Constant.PDAResult.Success;
  4886. }
  4887. catch (Exception ex)
  4888. {
  4889. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4890. OutputLog.TraceLog(LogPriority.Error,
  4891. this.ToString(),
  4892. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4893. ex.ToString(),
  4894. LocalPath.LogExePath);
  4895. actionResult.Status = (int)Constant.PDAResult.Exception;
  4896. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4897. }
  4898. return actionResult;
  4899. }
  4900. /// <summary>
  4901. /// 报损工序查出工号根据生产数据ID
  4902. /// </summary>
  4903. /// <param name="accountCode"></param>
  4904. /// <param name="userCode"></param>
  4905. /// <param name="userPassword"></param>
  4906. /// <param name="sessionKey"></param>
  4907. /// <param name="ProductionDataID">生产数据ID</param>
  4908. /// <returns></returns>
  4909. public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  4910. {
  4911. ActionResult actionResult = new ActionResult();
  4912. try
  4913. {
  4914. // 验证请求头信息
  4915. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4916. // 验证失败
  4917. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4918. {
  4919. return actionResult;
  4920. }
  4921. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  4922. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  4923. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  4924. {
  4925. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  4926. actionResult.Status = (int)Constant.PDAResult.Success;
  4927. }
  4928. else
  4929. {
  4930. actionResult.Status = (int)Constant.PDAResult.Fail;
  4931. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  4932. }
  4933. }
  4934. catch (Exception ex)
  4935. {
  4936. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4937. OutputLog.TraceLog(LogPriority.Error,
  4938. this.ToString(),
  4939. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4940. ex.ToString(),
  4941. LocalPath.LogExePath);
  4942. actionResult.Status = (int)Constant.PDAResult.Exception;
  4943. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4944. }
  4945. return actionResult;
  4946. }
  4947. /// <summary>
  4948. /// 在入窑工序检验窑车号是否存在
  4949. /// </summary>
  4950. /// <param name="accountCode"></param>
  4951. /// <param name="userCode"></param>
  4952. /// <param name="userPassword"></param>
  4953. /// <param name="sessionKey"></param>
  4954. /// <param name="kilncarcode">窑车编码</param>
  4955. /// <param name="procedureid">工序ID</param>
  4956. /// <returns></returns>
  4957. public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4958. {
  4959. ActionResult actionResult = new ActionResult();
  4960. try
  4961. {
  4962. // 验证请求头信息
  4963. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4964. // 验证失败
  4965. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4966. {
  4967. return actionResult;
  4968. }
  4969. int returnValue = ServiceInvoker.Invoke<int>(this,
  4970. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  4971. if (returnValue == 1)
  4972. {
  4973. actionResult.Result = JsonHelper.ToJson(returnValue);
  4974. actionResult.Status = (int)Constant.PDAResult.Success;
  4975. }
  4976. else
  4977. {
  4978. actionResult.Status = (int)Constant.PDAResult.Fail;
  4979. if (returnValue == -99)
  4980. actionResult.Message = "窑炉车号无效";
  4981. else if (returnValue == -98)
  4982. actionResult.Message = "窑车己无产品";
  4983. else if (returnValue == -97)
  4984. actionResult.Message = "窑车没有入窑,不可以撤销";
  4985. else if (returnValue == -1)
  4986. actionResult.Message = "保存失败";
  4987. }
  4988. }
  4989. catch (Exception ex)
  4990. {
  4991. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4992. OutputLog.TraceLog(LogPriority.Error,
  4993. this.ToString(),
  4994. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4995. ex.ToString(),
  4996. LocalPath.LogExePath);
  4997. actionResult.Status = (int)Constant.PDAResult.Exception;
  4998. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4999. }
  5000. return actionResult;
  5001. }
  5002. /// <summary>
  5003. /// 撤销包装
  5004. /// </summary>
  5005. /// <param name="accountCode"></param>
  5006. /// <param name="userCode"></param>
  5007. /// <param name="userPassword"></param>
  5008. /// <param name="sessionKey"></param>
  5009. /// <param name="barcode"></param>
  5010. /// <returns></returns>
  5011. public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5012. {
  5013. ActionResult actionResult = new ActionResult();
  5014. try
  5015. {
  5016. // 验证请求头信息
  5017. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5018. // 验证失败
  5019. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5020. {
  5021. return actionResult;
  5022. }
  5023. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5024. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  5025. if (Convert.ToInt32(returnValue.Result) > 0)
  5026. {
  5027. actionResult.Result = JsonHelper.ToJson(returnValue);
  5028. actionResult.Status = (int)Constant.PDAResult.Success;
  5029. }
  5030. else
  5031. {
  5032. actionResult.Status = (int)Constant.PDAResult.Fail;
  5033. if (Convert.ToInt32(returnValue.Result) == -1)
  5034. actionResult.Message = "产品条码不存在包装记录";
  5035. else if (Convert.ToInt32(returnValue.Result) == -200)
  5036. actionResult.Message = returnValue.Message;
  5037. else
  5038. actionResult.Message = "成品撤销失败";
  5039. }
  5040. }
  5041. catch (Exception ex)
  5042. {
  5043. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5044. OutputLog.TraceLog(LogPriority.Error,
  5045. this.ToString(),
  5046. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5047. ex.ToString(),
  5048. LocalPath.LogExePath);
  5049. actionResult.Status = (int)Constant.PDAResult.Exception;
  5050. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5051. }
  5052. return actionResult;
  5053. }
  5054. /*
  5055. /// <summary>
  5056. /// 获取用户是否有撤销包装权限
  5057. /// </summary>
  5058. /// <param name="accountCode"></param>
  5059. /// <param name="userCode"></param>
  5060. /// <param name="userPassword"></param>
  5061. /// <param name="sessionKey"></param>
  5062. /// <returns></returns>
  5063. public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5064. {
  5065. ActionResult actionResult = new ActionResult();
  5066. try
  5067. {
  5068. // 验证请求头信息
  5069. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5070. // 验证失败
  5071. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5072. {
  5073. return actionResult;
  5074. }
  5075. int returnValue = ServiceInvoker.Invoke<int>(this,
  5076. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5077. actionResult.Result = JsonHelper.ToJson(returnValue);
  5078. actionResult.Status = (int)Constant.PDAResult.Success;
  5079. }
  5080. catch (Exception ex)
  5081. {
  5082. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5083. OutputLog.TraceLog(LogPriority.Error,
  5084. this.ToString(),
  5085. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5086. ex.ToString(),
  5087. LocalPath.LogExePath);
  5088. actionResult.Status = (int)Constant.PDAResult.Exception;
  5089. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5090. }
  5091. return actionResult;
  5092. }
  5093. */
  5094. /// <summary>
  5095. /// 窑车状态明细表查询
  5096. /// </summary>
  5097. /// <param name="accountCode"></param>
  5098. /// <param name="userCode"></param>
  5099. /// <param name="userPassword"></param>
  5100. /// <param name="sessionKey"></param>
  5101. /// <param name="kilnCarCode"></param>
  5102. /// <returns></returns>
  5103. public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5104. {
  5105. ActionResult actionResult = new ActionResult();
  5106. try
  5107. {
  5108. // 验证请求头信息
  5109. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5110. // 验证失败
  5111. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5112. {
  5113. return actionResult;
  5114. }
  5115. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5116. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5117. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5118. {
  5119. actionResult.Status = (int)Constant.PDAResult.Fail;
  5120. actionResult.Message = Messages.MSG_CMN_I002;
  5121. }
  5122. else
  5123. {
  5124. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5125. actionResult.Status = (int)Constant.PDAResult.Success;
  5126. }
  5127. }
  5128. catch (Exception ex)
  5129. {
  5130. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5131. OutputLog.TraceLog(LogPriority.Error,
  5132. this.ToString(),
  5133. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5134. ex.ToString(),
  5135. LocalPath.LogExePath);
  5136. actionResult.Status = (int)Constant.PDAResult.Exception;
  5137. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5138. }
  5139. return actionResult;
  5140. }
  5141. /// <summary>
  5142. /// 损坯撤销
  5143. /// </summary>
  5144. /// <param name="accountCode"></param>
  5145. /// <param name="userCode"></param>
  5146. /// <param name="userPassword"></param>
  5147. /// <param name="sessionKey"></param>
  5148. /// <param name="barcode"></param>
  5149. /// <returns></returns>
  5150. public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5151. {
  5152. ActionResult actionResult = new ActionResult();
  5153. try
  5154. {
  5155. // 验证请求头信息
  5156. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5157. // 验证失败
  5158. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5159. {
  5160. return actionResult;
  5161. }
  5162. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5163. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5164. if (Convert.ToInt32(returnValue.Result) > 0)
  5165. {
  5166. actionResult.Result = JsonHelper.ToJson(returnValue);
  5167. actionResult.Status = (int)Constant.PDAResult.Success;
  5168. }
  5169. else
  5170. {
  5171. actionResult.Status = (int)Constant.PDAResult.Fail;
  5172. if (Convert.ToInt32(returnValue.Result) == -1)
  5173. actionResult.Message = "此产品没有损坯,不能撤销";
  5174. else if (Convert.ToInt32(returnValue.Result) == -200)
  5175. actionResult.Message = returnValue.Message;
  5176. else
  5177. actionResult.Message = "损坯撤销失败";
  5178. }
  5179. }
  5180. catch (Exception ex)
  5181. {
  5182. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5183. OutputLog.TraceLog(LogPriority.Error,
  5184. this.ToString(),
  5185. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5186. ex.ToString(),
  5187. LocalPath.LogExePath);
  5188. actionResult.Status = (int)Constant.PDAResult.Exception;
  5189. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5190. }
  5191. return actionResult;
  5192. }
  5193. /*
  5194. /// <summary>
  5195. /// 获取用户是否有损坯撤销权限
  5196. /// </summary>
  5197. /// <param name="accountCode"></param>
  5198. /// <param name="userCode"></param>
  5199. /// <param name="userPassword"></param>
  5200. /// <param name="sessionKey"></param>
  5201. /// <returns></returns>
  5202. public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5203. {
  5204. ActionResult actionResult = new ActionResult();
  5205. try
  5206. {
  5207. // 验证请求头信息
  5208. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5209. // 验证失败
  5210. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5211. {
  5212. return actionResult;
  5213. }
  5214. int returnValue = ServiceInvoker.Invoke<int>(this,
  5215. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5216. actionResult.Result = JsonHelper.ToJson(returnValue);
  5217. actionResult.Status = (int)Constant.PDAResult.Success;
  5218. }
  5219. catch (Exception ex)
  5220. {
  5221. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5222. OutputLog.TraceLog(LogPriority.Error,
  5223. this.ToString(),
  5224. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5225. ex.ToString(),
  5226. LocalPath.LogExePath);
  5227. actionResult.Status = (int)Constant.PDAResult.Exception;
  5228. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5229. }
  5230. return actionResult;
  5231. }
  5232. */
  5233. /// <summary>
  5234. /// 获取条码注浆信息
  5235. /// </summary>
  5236. /// <param name="accountCode"></param>
  5237. /// <param name="userCode"></param>
  5238. /// <param name="userPassword"></param>
  5239. /// <param name="sessionKey"></param>
  5240. /// <returns></returns>
  5241. public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5242. {
  5243. ActionResult actionResult = new ActionResult();
  5244. try
  5245. {
  5246. // 验证请求头信息
  5247. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5248. // 验证失败
  5249. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5250. {
  5251. return actionResult;
  5252. }
  5253. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5254. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5255. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5256. {
  5257. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5258. actionResult.Status = (int)Constant.PDAResult.Success;
  5259. }
  5260. else
  5261. {
  5262. actionResult.Status = (int)Constant.PDAResult.Fail;
  5263. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5264. }
  5265. }
  5266. catch (Exception ex)
  5267. {
  5268. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5269. OutputLog.TraceLog(LogPriority.Error,
  5270. this.ToString(),
  5271. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5272. ex.ToString(),
  5273. LocalPath.LogExePath);
  5274. actionResult.Status = (int)Constant.PDAResult.Exception;
  5275. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5276. }
  5277. return actionResult;
  5278. }
  5279. /// <summary>
  5280. /// 获取条码注浆信息
  5281. /// </summary>
  5282. /// <param name="accountCode"></param>
  5283. /// <param name="userCode"></param>
  5284. /// <param name="userPassword"></param>
  5285. /// <param name="sessionKey"></param>
  5286. /// <returns></returns>
  5287. public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5288. {
  5289. ActionResult actionResult = new ActionResult();
  5290. try
  5291. {
  5292. // 验证请求头信息
  5293. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5294. // 验证失败
  5295. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5296. {
  5297. return actionResult;
  5298. }
  5299. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5300. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5301. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5302. {
  5303. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5304. actionResult.Status = (int)Constant.PDAResult.Success;
  5305. }
  5306. else
  5307. {
  5308. actionResult.Status = (int)Constant.PDAResult.Fail;
  5309. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5310. }
  5311. }
  5312. catch (Exception ex)
  5313. {
  5314. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5315. OutputLog.TraceLog(LogPriority.Error,
  5316. this.ToString(),
  5317. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5318. ex.ToString(),
  5319. LocalPath.LogExePath);
  5320. actionResult.Status = (int)Constant.PDAResult.Exception;
  5321. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5322. }
  5323. return actionResult;
  5324. }
  5325. /// <summary>
  5326. /// 公坯设定
  5327. /// </summary>
  5328. /// <param name="accountCode"></param>
  5329. /// <param name="userCode"></param>
  5330. /// <param name="userPassword"></param>
  5331. /// <param name="sessionKey"></param>
  5332. /// <param name="barcode"></param>
  5333. /// <returns></returns>
  5334. public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5335. {
  5336. ActionResult actionResult = new ActionResult();
  5337. try
  5338. {
  5339. // 验证请求头信息
  5340. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5341. // 验证失败
  5342. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5343. {
  5344. return actionResult;
  5345. }
  5346. int returnValue = ServiceInvoker.Invoke<int>(this,
  5347. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5348. if (returnValue > 0)
  5349. {
  5350. actionResult.Result = JsonHelper.ToJson(returnValue);
  5351. actionResult.Status = (int)Constant.PDAResult.Success;
  5352. }
  5353. else
  5354. {
  5355. actionResult.Status = (int)Constant.PDAResult.Fail;
  5356. if (returnValue == -1)
  5357. actionResult.Message = "此产品不在生产线上";
  5358. else if (returnValue == -2)
  5359. actionResult.Message = "该产品已经标识为公坯";
  5360. else
  5361. actionResult.Message = "公坯设定失败";
  5362. }
  5363. }
  5364. catch (Exception ex)
  5365. {
  5366. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5367. OutputLog.TraceLog(LogPriority.Error,
  5368. this.ToString(),
  5369. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5370. ex.ToString(),
  5371. LocalPath.LogExePath);
  5372. actionResult.Status = (int)Constant.PDAResult.Exception;
  5373. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5374. }
  5375. return actionResult;
  5376. }
  5377. /*
  5378. /// <summary>
  5379. /// 获取用户是否有公坯设定
  5380. /// </summary>
  5381. /// <param name="accountCode"></param>
  5382. /// <param name="userCode"></param>
  5383. /// <param name="userPassword"></param>
  5384. /// <param name="sessionKey"></param>
  5385. /// <returns></returns>
  5386. public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5387. {
  5388. ActionResult actionResult = new ActionResult();
  5389. try
  5390. {
  5391. // 验证请求头信息
  5392. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5393. // 验证失败
  5394. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5395. {
  5396. return actionResult;
  5397. }
  5398. int returnValue = ServiceInvoker.Invoke<int>(this,
  5399. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5400. actionResult.Result = JsonHelper.ToJson(returnValue);
  5401. actionResult.Status = (int)Constant.PDAResult.Success;
  5402. }
  5403. catch (Exception ex)
  5404. {
  5405. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5406. OutputLog.TraceLog(LogPriority.Error,
  5407. this.ToString(),
  5408. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5409. ex.ToString(),
  5410. LocalPath.LogExePath);
  5411. actionResult.Status = (int)Constant.PDAResult.Exception;
  5412. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5413. }
  5414. return actionResult;
  5415. }
  5416. */
  5417. /// <summary>
  5418. /// 校验产品条码是否可以走到该工序
  5419. /// </summary>
  5420. /// <param name="accountCode">帐套code</param>
  5421. /// <param name="userCode">用户code</param>
  5422. /// <param name="userPassword">用户密码</param>
  5423. /// <param name="sessionKey">本次登陆密钥</param>
  5424. /// <param name="procedureID">工序ID</param>
  5425. /// <param name="barcode">条码</param>
  5426. /// <returns></returns>
  5427. /// <remarks>
  5428. /// 陈冰 2014.09.18 新建
  5429. /// </remarks>
  5430. public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5431. {
  5432. ActionResult actionResult = new ActionResult();
  5433. try
  5434. {
  5435. // 验证请求头信息
  5436. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5437. // 验证失败
  5438. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5439. {
  5440. return actionResult;
  5441. }
  5442. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5443. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5444. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5445. {
  5446. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5447. actionResult.Status = (int)Constant.PDAResult.Success;
  5448. }
  5449. else
  5450. {
  5451. actionResult.Status = (int)Constant.PDAResult.Fail;
  5452. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5453. }
  5454. }
  5455. catch (Exception ex)
  5456. {
  5457. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5458. OutputLog.TraceLog(LogPriority.Error,
  5459. this.ToString(),
  5460. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5461. ex.ToString(),
  5462. LocalPath.LogExePath);
  5463. actionResult.Status = (int)Constant.PDAResult.Exception;
  5464. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5465. }
  5466. return actionResult;
  5467. }
  5468. /// <summary>
  5469. /// 获取用户所有菜单权限
  5470. /// </summary>
  5471. /// <param name="accountCode"></param>
  5472. /// <param name="userCode"></param>
  5473. /// <param name="userPassword"></param>
  5474. /// <param name="sessionKey"></param>
  5475. /// <returns></returns>
  5476. public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
  5477. {
  5478. ActionResult actionResult = new ActionResult();
  5479. try
  5480. {
  5481. // 验证请求头信息
  5482. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5483. // 验证失败
  5484. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5485. {
  5486. return actionResult;
  5487. }
  5488. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5489. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5490. actionResult.Result = JsonHelper.ToJson(returnValue);
  5491. actionResult.Status = (int)Constant.PDAResult.Success;
  5492. }
  5493. catch (Exception ex)
  5494. {
  5495. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5496. OutputLog.TraceLog(LogPriority.Error,
  5497. this.ToString(),
  5498. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5499. ex.ToString(),
  5500. LocalPath.LogExePath);
  5501. actionResult.Status = (int)Constant.PDAResult.Exception;
  5502. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5503. }
  5504. return actionResult;
  5505. }
  5506. public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5507. {
  5508. ActionResult actionResult = new ActionResult();
  5509. try
  5510. {
  5511. // 验证请求头信息
  5512. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5513. // 验证失败
  5514. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5515. {
  5516. return actionResult;
  5517. }
  5518. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5519. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5520. if (Convert.ToInt32(returnValue.Result) > 0)
  5521. {
  5522. actionResult.Result = JsonHelper.ToJson(returnValue);
  5523. actionResult.Status = (int)Constant.PDAResult.Success;
  5524. }
  5525. else
  5526. {
  5527. actionResult.Status = (int)Constant.PDAResult.Fail;
  5528. if (Convert.ToInt32(returnValue.Result) == -1)
  5529. actionResult.Message = "无效条码";
  5530. else if (Convert.ToInt32(returnValue.Result) == -2)
  5531. actionResult.Message = "已经生产完成";
  5532. else if (Convert.ToInt32(returnValue.Result) == -3)
  5533. actionResult.Message = "条码已经申请报废";
  5534. else if (Convert.ToInt32(returnValue.Result) == -4)
  5535. actionResult.Message = "此条码当前工序不允许进行撤销";
  5536. else if (Convert.ToInt32(returnValue.Result) == -5)
  5537. actionResult.Message = "此条码没有生产数据";
  5538. else if (Convert.ToInt32(returnValue.Result) == -6)
  5539. actionResult.Message = "没有当前工序权限";
  5540. else if (Convert.ToInt32(returnValue.Result) == -7)
  5541. actionResult.Message = "条码不在生产线上";
  5542. else if (Convert.ToInt32(returnValue.Result) == -8)
  5543. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5544. else if (Convert.ToInt32(returnValue.Result) == -9)
  5545. actionResult.Message = "条码已经是返工状态";
  5546. else if (Convert.ToInt32(returnValue.Result) == -200)
  5547. actionResult.Message = returnValue.Message;
  5548. }
  5549. }
  5550. catch (Exception ex)
  5551. {
  5552. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5553. OutputLog.TraceLog(LogPriority.Error,
  5554. this.ToString(),
  5555. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5556. ex.ToString(),
  5557. LocalPath.LogExePath);
  5558. actionResult.Status = (int)Constant.PDAResult.Exception;
  5559. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5560. }
  5561. return actionResult;
  5562. }
  5563. public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5564. {
  5565. ActionResult actionResult = new ActionResult();
  5566. try
  5567. {
  5568. // 验证请求头信息
  5569. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5570. // 验证失败
  5571. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5572. {
  5573. return actionResult;
  5574. }
  5575. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5576. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5577. if (Convert.ToInt32(returnValue.Result) > 0)
  5578. {
  5579. actionResult.Result = JsonHelper.ToJson(returnValue);
  5580. actionResult.Status = (int)Constant.PDAResult.Success;
  5581. }
  5582. else
  5583. {
  5584. actionResult.Status = (int)Constant.PDAResult.Fail;
  5585. if (Convert.ToInt32(returnValue.Result) == -1)
  5586. actionResult.Message = "无效条码";
  5587. else if (Convert.ToInt32(returnValue.Result) == -2)
  5588. actionResult.Message = "已经生产完成";
  5589. else if (Convert.ToInt32(returnValue.Result) == -3)
  5590. actionResult.Message = "条码已经申请报废";
  5591. else if (Convert.ToInt32(returnValue.Result) == -4)
  5592. actionResult.Message = "此条码当前工序不允许进行撤销";
  5593. else if (Convert.ToInt32(returnValue.Result) == -5)
  5594. actionResult.Message = "此条码没有生产数据";
  5595. else if (Convert.ToInt32(returnValue.Result) == -55)
  5596. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5597. else if (Convert.ToInt32(returnValue.Result) == -6)
  5598. actionResult.Message = "没有任何影响行";
  5599. else if (Convert.ToInt32(returnValue.Result) == -7)
  5600. actionResult.Message = "条码不在生产线上";
  5601. else if (Convert.ToInt32(returnValue.Result) == -8)
  5602. actionResult.Message = "条码已经是返工状态";
  5603. else if (Convert.ToInt32(returnValue.Result) == -200)
  5604. actionResult.Message = returnValue.Message;
  5605. }
  5606. }
  5607. catch (Exception ex)
  5608. {
  5609. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5610. OutputLog.TraceLog(LogPriority.Error,
  5611. this.ToString(),
  5612. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5613. ex.ToString(),
  5614. LocalPath.LogExePath);
  5615. actionResult.Status = (int)Constant.PDAResult.Exception;
  5616. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5617. }
  5618. return actionResult;
  5619. }
  5620. public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  5621. {
  5622. ActionResult actionResult = new ActionResult();
  5623. try
  5624. {
  5625. // 验证请求头信息
  5626. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5627. // 验证失败
  5628. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5629. {
  5630. return actionResult;
  5631. }
  5632. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5633. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5634. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5635. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5636. {
  5637. //DataView dv = returnValue.Tables[0].DefaultView;
  5638. //dv.RowFilter = "ValueFlag=1";
  5639. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5640. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5641. actionResult.Status = (int)Constant.PDAResult.Success;
  5642. }
  5643. }
  5644. catch (Exception ex)
  5645. {
  5646. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5647. OutputLog.TraceLog(LogPriority.Error,
  5648. this.ToString(),
  5649. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5650. ex.ToString(),
  5651. LocalPath.LogExePath);
  5652. actionResult.Status = (int)Constant.PDAResult.Exception;
  5653. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5654. }
  5655. return actionResult;
  5656. }
  5657. public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5658. {
  5659. ActionResult actionResult = new ActionResult();
  5660. try
  5661. {
  5662. // 验证请求头信息
  5663. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5664. // 验证失败
  5665. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5666. {
  5667. return actionResult;
  5668. }
  5669. int returnValue = ServiceInvoker.Invoke<int>(this,
  5670. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5671. actionResult.Result = JsonHelper.ToJson(returnValue);
  5672. actionResult.Status = (int)Constant.PDAResult.Success;
  5673. }
  5674. catch (Exception ex)
  5675. {
  5676. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5677. OutputLog.TraceLog(LogPriority.Error,
  5678. this.ToString(),
  5679. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5680. ex.ToString(),
  5681. LocalPath.LogExePath);
  5682. actionResult.Status = (int)Constant.PDAResult.Exception;
  5683. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5684. }
  5685. return actionResult;
  5686. }
  5687. public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  5688. {
  5689. ActionResult actionResult = new ActionResult();
  5690. try
  5691. {
  5692. // 验证请求头信息
  5693. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5694. // 验证失败
  5695. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5696. {
  5697. return actionResult;
  5698. }
  5699. int returnValue = ServiceInvoker.Invoke<int>(this,
  5700. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo));
  5701. actionResult.Result = JsonHelper.ToJson(returnValue);
  5702. actionResult.Status = (int)Constant.PDAResult.Success;
  5703. }
  5704. catch (Exception ex)
  5705. {
  5706. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5707. OutputLog.TraceLog(LogPriority.Error,
  5708. this.ToString(),
  5709. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5710. ex.ToString(),
  5711. LocalPath.LogExePath);
  5712. actionResult.Status = (int)Constant.PDAResult.Exception;
  5713. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5714. }
  5715. return actionResult;
  5716. }
  5717. public ActionResult SaveBarCodeLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  5718. string barcode, int logoid, int glazetypeid)
  5719. {
  5720. ActionResult actionResult = new ActionResult();
  5721. try
  5722. {
  5723. // 验证请求头信息
  5724. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5725. // 验证失败
  5726. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5727. {
  5728. return actionResult;
  5729. }
  5730. int returnValue = ServiceInvoker.Invoke<int>(this,
  5731. () => PMModuleLogicDAL.SaveBarCodeLogoAndGlazetypeid(barcode, logoid, glazetypeid, sUserInfo));
  5732. actionResult.Result = JsonHelper.ToJson(returnValue);
  5733. if (returnValue > 0)
  5734. {
  5735. actionResult.Status = (int)Constant.PDAResult.Success;
  5736. }
  5737. else
  5738. {
  5739. actionResult.Status = (int)Constant.PDAResult.Fail;
  5740. actionResult.Message = "条码不存在";
  5741. }
  5742. }
  5743. catch (Exception ex)
  5744. {
  5745. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5746. OutputLog.TraceLog(LogPriority.Error,
  5747. this.ToString(),
  5748. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5749. ex.ToString(),
  5750. LocalPath.LogExePath);
  5751. actionResult.Status = (int)Constant.PDAResult.Exception;
  5752. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5753. }
  5754. return actionResult;
  5755. }
  5756. public ActionResult SaveBarCodesLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  5757. string[] barcodes, int logoid, int glazetypeid)
  5758. {
  5759. ActionResult actionResult = new ActionResult();
  5760. try
  5761. {
  5762. // 验证请求头信息
  5763. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5764. // 验证失败
  5765. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5766. {
  5767. return actionResult;
  5768. }
  5769. int returnValue = ServiceInvoker.Invoke<int>(this,
  5770. () => PMModuleLogicDAL.SaveBarCodesLogoAndGlazetypeid(barcodes, logoid, glazetypeid, sUserInfo));
  5771. actionResult.Result = JsonHelper.ToJson(returnValue);
  5772. if (returnValue > 0)
  5773. {
  5774. actionResult.Status = (int)Constant.PDAResult.Success;
  5775. }
  5776. else
  5777. {
  5778. actionResult.Status = (int)Constant.PDAResult.Fail;
  5779. actionResult.Message = "条码不存在";
  5780. }
  5781. }
  5782. catch (Exception ex)
  5783. {
  5784. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5785. OutputLog.TraceLog(LogPriority.Error,
  5786. this.ToString(),
  5787. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5788. ex.ToString(),
  5789. LocalPath.LogExePath);
  5790. actionResult.Status = (int)Constant.PDAResult.Exception;
  5791. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5792. }
  5793. return actionResult;
  5794. }
  5795. public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5796. {
  5797. ActionResult actionResult = new ActionResult();
  5798. try
  5799. {
  5800. // 验证请求头信息
  5801. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5802. // 验证失败
  5803. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5804. {
  5805. return actionResult;
  5806. }
  5807. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5808. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  5809. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5810. {
  5811. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5812. actionResult.Status = (int)Constant.PDAResult.Success;
  5813. }
  5814. }
  5815. catch (Exception ex)
  5816. {
  5817. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5818. OutputLog.TraceLog(LogPriority.Error,
  5819. this.ToString(),
  5820. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5821. ex.ToString(),
  5822. LocalPath.LogExePath);
  5823. actionResult.Status = (int)Constant.PDAResult.Exception;
  5824. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5825. }
  5826. return actionResult;
  5827. }
  5828. /// <summary>
  5829. /// 半检时,入窑前检验获取此条码是否报损为废品
  5830. /// </summary>
  5831. /// <param name="accountCode"></param>
  5832. /// <param name="userCode"></param>
  5833. /// <param name="userPassword"></param>
  5834. /// <param name="sessionKey"></param>
  5835. /// <param name="barcode">产品条码</param>
  5836. /// <returns></returns>
  5837. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5838. {
  5839. ActionResult actionResult = new ActionResult();
  5840. try
  5841. {
  5842. // 验证请求头信息
  5843. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5844. // 验证失败
  5845. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5846. {
  5847. return actionResult;
  5848. }
  5849. int returnValue = ServiceInvoker.Invoke<int>(this,
  5850. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  5851. if (returnValue != -100)
  5852. {
  5853. actionResult.Result = JsonHelper.ToJson(returnValue);
  5854. actionResult.Status = (int)Constant.PDAResult.Success;
  5855. }
  5856. else
  5857. {
  5858. actionResult.Status = (int)Constant.PDAResult.Fail;
  5859. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  5860. }
  5861. }
  5862. catch (Exception ex)
  5863. {
  5864. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5865. OutputLog.TraceLog(LogPriority.Error,
  5866. this.ToString(),
  5867. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5868. ex.ToString(),
  5869. LocalPath.LogExePath);
  5870. actionResult.Status = (int)Constant.PDAResult.Exception;
  5871. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5872. }
  5873. return actionResult;
  5874. }
  5875. /// <summary>
  5876. /// 获取登陆帐户有无入窑前检验数据编辑权限
  5877. /// </summary>
  5878. /// <param name="accountCode"></param>
  5879. /// <param name="userCode"></param>
  5880. /// <param name="userPassword"></param>
  5881. /// <param name="sessionKey"></param>
  5882. /// <param name="usercode">工号编码</param>
  5883. /// <returns></returns>
  5884. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5885. {
  5886. ActionResult actionResult = new ActionResult();
  5887. try
  5888. {
  5889. // 验证请求头信息
  5890. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5891. // 验证失败
  5892. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5893. {
  5894. return actionResult;
  5895. }
  5896. int returnValue = ServiceInvoker.Invoke<int>(this,
  5897. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  5898. actionResult.Result = JsonHelper.ToJson(returnValue);
  5899. actionResult.Status = (int)Constant.PDAResult.Success;
  5900. }
  5901. catch (Exception ex)
  5902. {
  5903. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5904. OutputLog.TraceLog(LogPriority.Error,
  5905. this.ToString(),
  5906. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5907. ex.ToString(),
  5908. LocalPath.LogExePath);
  5909. actionResult.Status = (int)Constant.PDAResult.Exception;
  5910. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5911. }
  5912. return actionResult;
  5913. }
  5914. /// <summary>
  5915. /// 获取登陆帐户有无半检验数据编辑权限
  5916. /// </summary>
  5917. /// <param name="accountCode"></param>
  5918. /// <param name="userCode"></param>
  5919. /// <param name="userPassword"></param>
  5920. /// <param name="sessionKey"></param>
  5921. /// <param name="usercode">工号编码</param>
  5922. /// <returns></returns>
  5923. public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5924. {
  5925. ActionResult actionResult = new ActionResult();
  5926. try
  5927. {
  5928. // 验证请求头信息
  5929. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5930. // 验证失败
  5931. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5932. {
  5933. return actionResult;
  5934. }
  5935. int returnValue = ServiceInvoker.Invoke<int>(this,
  5936. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  5937. actionResult.Result = JsonHelper.ToJson(returnValue);
  5938. actionResult.Status = (int)Constant.PDAResult.Success;
  5939. }
  5940. catch (Exception ex)
  5941. {
  5942. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5943. OutputLog.TraceLog(LogPriority.Error,
  5944. this.ToString(),
  5945. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5946. ex.ToString(),
  5947. LocalPath.LogExePath);
  5948. actionResult.Status = (int)Constant.PDAResult.Exception;
  5949. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5950. }
  5951. return actionResult;
  5952. }
  5953. /// <summary>
  5954. /// 获取缺陷扣罚管理的全部数据
  5955. /// </summary>
  5956. /// <param name="accountCode"></param>
  5957. /// <param name="userCode"></param>
  5958. /// <param name="userPassword"></param>
  5959. /// <param name="sessionKey"></param>
  5960. /// <returns></returns>
  5961. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  5962. {
  5963. ActionResult actionResult = new ActionResult();
  5964. try
  5965. {
  5966. // 验证请求头信息
  5967. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5968. // 验证失败
  5969. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5970. {
  5971. return actionResult;
  5972. }
  5973. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5974. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  5975. if (ds != null && ds.Tables[0].Rows.Count > 0)
  5976. {
  5977. DataView dv = ds.Tables[0].DefaultView;
  5978. dv.RowFilter = "valueflag=1";
  5979. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5980. actionResult.Status = (int)Constant.PDAResult.Success;
  5981. }
  5982. else
  5983. {
  5984. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  5985. actionResult.Status = (int)Constant.PDAResult.Success;
  5986. }
  5987. }
  5988. catch (Exception ex)
  5989. {
  5990. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5991. OutputLog.TraceLog(LogPriority.Error,
  5992. this.ToString(),
  5993. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5994. ex.ToString(),
  5995. LocalPath.LogExePath);
  5996. actionResult.Status = (int)Constant.PDAResult.Exception;
  5997. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5998. }
  5999. return actionResult;
  6000. }
  6001. /// <summary>
  6002. /// 获取缺陷扣除数管理的全部数据
  6003. /// </summary>
  6004. /// <param name="accountCode"></param>
  6005. /// <param name="userCode"></param>
  6006. /// <param name="userPassword"></param>
  6007. /// <param name="sessionKey"></param>
  6008. /// <returns></returns>
  6009. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  6010. {
  6011. ActionResult actionResult = new ActionResult();
  6012. try
  6013. {
  6014. // 验证请求头信息
  6015. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6016. // 验证失败
  6017. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6018. {
  6019. return actionResult;
  6020. }
  6021. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6022. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  6023. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6024. {
  6025. DataView dv = ds.Tables[0].DefaultView;
  6026. dv.RowFilter = "valueflag=1";
  6027. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6028. actionResult.Status = (int)Constant.PDAResult.Success;
  6029. }
  6030. else
  6031. {
  6032. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6033. actionResult.Status = (int)Constant.PDAResult.Success;
  6034. }
  6035. }
  6036. catch (Exception ex)
  6037. {
  6038. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6039. OutputLog.TraceLog(LogPriority.Error,
  6040. this.ToString(),
  6041. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6042. ex.ToString(),
  6043. LocalPath.LogExePath);
  6044. actionResult.Status = (int)Constant.PDAResult.Exception;
  6045. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6046. }
  6047. return actionResult;
  6048. }
  6049. /// <summary>
  6050. /// 获取缺陷扣罚关系管理的全部数据
  6051. /// </summary>
  6052. /// <param name="accountCode"></param>
  6053. /// <param name="userCode"></param>
  6054. /// <param name="userPassword"></param>
  6055. /// <param name="sessionKey"></param>
  6056. /// <returns></returns>
  6057. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6058. {
  6059. ActionResult actionResult = new ActionResult();
  6060. try
  6061. {
  6062. // 验证请求头信息
  6063. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6064. // 验证失败
  6065. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6066. {
  6067. return actionResult;
  6068. }
  6069. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6070. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  6071. DataTable dt = new DataTable();
  6072. dt.Columns.Add("DefectID");
  6073. dt.Columns.Add("DefectFineID");
  6074. DataView dv = ds.Tables[0].DefaultView;
  6075. DataTable dtFor = dv.ToTable("defectid", true);
  6076. for (int i = 0; i < dtFor.Rows.Count; i++)
  6077. {
  6078. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6079. string substring = "";
  6080. foreach (DataRow r1 in r)
  6081. {
  6082. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  6083. }
  6084. if (substring != "")
  6085. {
  6086. DataRow drnew = dt.NewRow();
  6087. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6088. drnew["DefectFineID"] = substring.TrimEnd(',');
  6089. dt.Rows.Add(drnew);
  6090. }
  6091. }
  6092. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6093. actionResult.Status = (int)Constant.PDAResult.Success;
  6094. }
  6095. catch (Exception ex)
  6096. {
  6097. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6098. OutputLog.TraceLog(LogPriority.Error,
  6099. this.ToString(),
  6100. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6101. ex.ToString(),
  6102. LocalPath.LogExePath);
  6103. actionResult.Status = (int)Constant.PDAResult.Exception;
  6104. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6105. }
  6106. return actionResult;
  6107. }
  6108. /// <summary>
  6109. /// 获取缺陷扣除数关系管理的全部数据
  6110. /// </summary>
  6111. /// <param name="accountCode"></param>
  6112. /// <param name="userCode"></param>
  6113. /// <param name="userPassword"></param>
  6114. /// <param name="sessionKey"></param>
  6115. /// <returns></returns>
  6116. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6117. {
  6118. ActionResult actionResult = new ActionResult();
  6119. try
  6120. {
  6121. // 验证请求头信息
  6122. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6123. // 验证失败
  6124. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6125. {
  6126. return actionResult;
  6127. }
  6128. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6129. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6130. DataTable dt = new DataTable();
  6131. dt.Columns.Add("DefectID");
  6132. dt.Columns.Add("DefectDeductionNum");
  6133. DataView dv = ds.Tables[0].DefaultView;
  6134. DataTable dtFor = dv.ToTable("defectid", true);
  6135. for (int i = 0; i < dtFor.Rows.Count; i++)
  6136. {
  6137. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6138. string substring = "";
  6139. foreach (DataRow r1 in r)
  6140. {
  6141. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6142. }
  6143. if (substring != "")
  6144. {
  6145. DataRow drnew = dt.NewRow();
  6146. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6147. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6148. dt.Rows.Add(drnew);
  6149. }
  6150. }
  6151. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6152. actionResult.Status = (int)Constant.PDAResult.Success;
  6153. }
  6154. catch (Exception ex)
  6155. {
  6156. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6157. OutputLog.TraceLog(LogPriority.Error,
  6158. this.ToString(),
  6159. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6160. ex.ToString(),
  6161. LocalPath.LogExePath);
  6162. actionResult.Status = (int)Constant.PDAResult.Exception;
  6163. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6164. }
  6165. return actionResult;
  6166. }
  6167. /// <summary>
  6168. /// 获取盘点单明细
  6169. /// </summary>
  6170. /// <param name="sUserInfo"></param>
  6171. /// <returns></returns>
  6172. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6173. {
  6174. ActionResult actionResult = new ActionResult();
  6175. try
  6176. {
  6177. // 验证请求头信息
  6178. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6179. // 验证失败
  6180. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6181. {
  6182. return actionResult;
  6183. }
  6184. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6185. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6186. actionResult.Result = JsonHelper.ToJson(ds);
  6187. actionResult.Status = (int)Constant.PDAResult.Success;
  6188. }
  6189. catch (Exception ex)
  6190. {
  6191. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6192. OutputLog.TraceLog(LogPriority.Error,
  6193. this.ToString(),
  6194. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6195. ex.ToString(),
  6196. LocalPath.LogExePath);
  6197. actionResult.Status = (int)Constant.PDAResult.Exception;
  6198. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6199. }
  6200. return actionResult;
  6201. }
  6202. /// <summary>
  6203. /// 半检检验条码
  6204. /// </summary>
  6205. /// <param name="sUserInfo"></param>
  6206. /// <returns></returns>
  6207. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6208. {
  6209. ActionResult actionResult = new ActionResult();
  6210. try
  6211. {
  6212. // 验证请求头信息
  6213. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6214. // 验证失败
  6215. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6216. {
  6217. return actionResult;
  6218. }
  6219. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6220. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6221. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6222. if (Convert.ToInt32(resultEntity.Result) < 0)
  6223. {
  6224. actionResult.Status = (int)Constant.PDAResult.Fail;
  6225. }
  6226. else
  6227. {
  6228. actionResult.Status = (int)Constant.PDAResult.Success;
  6229. }
  6230. actionResult.Message = resultEntity.Message;
  6231. }
  6232. catch (Exception ex)
  6233. {
  6234. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6235. OutputLog.TraceLog(LogPriority.Error,
  6236. this.ToString(),
  6237. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6238. ex.ToString(),
  6239. LocalPath.LogExePath);
  6240. actionResult.Status = (int)Constant.PDAResult.Exception;
  6241. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6242. }
  6243. return actionResult;
  6244. }
  6245. /// <summary>
  6246. /// 根据条码获取经过的工序,用于绑定返工工序
  6247. /// </summary>
  6248. /// <param name="sUserInfo"></param>
  6249. /// <returns></returns>
  6250. public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6251. {
  6252. ActionResult actionResult = new ActionResult();
  6253. try
  6254. {
  6255. // 验证请求头信息
  6256. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6257. // 验证失败
  6258. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6259. {
  6260. return actionResult;
  6261. }
  6262. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6263. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6264. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6265. actionResult.Status = (int)Constant.PDAResult.Success;
  6266. }
  6267. catch (Exception ex)
  6268. {
  6269. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6270. OutputLog.TraceLog(LogPriority.Error,
  6271. this.ToString(),
  6272. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6273. ex.ToString(),
  6274. LocalPath.LogExePath);
  6275. actionResult.Status = (int)Constant.PDAResult.Exception;
  6276. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6277. }
  6278. return actionResult;
  6279. }
  6280. /// <summary>
  6281. /// 获取登陆帐户有无半检状态权限
  6282. /// </summary>
  6283. /// <param name="sUserInfo"></param>
  6284. /// <returns></returns>
  6285. public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6286. {
  6287. ActionResult actionResult = new ActionResult();
  6288. try
  6289. {
  6290. // 验证请求头信息
  6291. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6292. // 验证失败
  6293. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6294. {
  6295. return actionResult;
  6296. }
  6297. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6298. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6299. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6300. actionResult.Status = (int)Constant.PDAResult.Success;
  6301. }
  6302. catch (Exception ex)
  6303. {
  6304. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6305. OutputLog.TraceLog(LogPriority.Error,
  6306. this.ToString(),
  6307. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6308. ex.ToString(),
  6309. LocalPath.LogExePath);
  6310. actionResult.Status = (int)Constant.PDAResult.Exception;
  6311. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6312. }
  6313. return actionResult;
  6314. }
  6315. /// <summary>
  6316. /// 复检状态数据源
  6317. /// </summary>
  6318. /// <param name="sUserInfo"></param>
  6319. /// <returns></returns>
  6320. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6321. {
  6322. ActionResult actionResult = new ActionResult();
  6323. try
  6324. {
  6325. // 验证请求头信息
  6326. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6327. // 验证失败
  6328. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6329. {
  6330. return actionResult;
  6331. }
  6332. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6333. () => SystemModuleLogic.GetSemiCheckType());
  6334. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6335. actionResult.Status = (int)Constant.PDAResult.Success;
  6336. }
  6337. catch (Exception ex)
  6338. {
  6339. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6340. OutputLog.TraceLog(LogPriority.Error,
  6341. this.ToString(),
  6342. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6343. ex.ToString(),
  6344. LocalPath.LogExePath);
  6345. actionResult.Status = (int)Constant.PDAResult.Exception;
  6346. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6347. }
  6348. return actionResult;
  6349. }
  6350. /// <summary>
  6351. /// 根据半成品检验数据ID,显示半成品数据信息
  6352. /// </summary>
  6353. /// <param name="sUserInfo"></param>
  6354. /// <returns></returns>
  6355. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6356. {
  6357. ActionResult actionResult = new ActionResult();
  6358. try
  6359. {
  6360. // 验证请求头信息
  6361. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6362. // 验证失败
  6363. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6364. {
  6365. return actionResult;
  6366. }
  6367. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6368. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6369. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6370. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6371. {
  6372. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6373. {
  6374. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6375. {
  6376. SemiCheckEntity productionData = new SemiCheckEntity();
  6377. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6378. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6379. {
  6380. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6381. }
  6382. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6383. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6384. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6385. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6386. productionData.ReFine = 0;
  6387. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6388. {
  6389. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6390. }
  6391. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6392. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6393. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6394. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6395. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6396. {
  6397. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6398. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6399. }
  6400. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6401. {
  6402. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6403. }
  6404. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6405. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6406. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6407. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6408. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6409. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6410. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6411. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6412. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6413. {
  6414. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6415. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6416. }
  6417. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6418. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6419. {
  6420. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6421. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6422. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6423. }
  6424. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6425. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6426. {
  6427. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6428. }
  6429. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6430. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6431. DataTable dtDefect = dvDefect.ToTable();
  6432. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6433. {
  6434. // 产品缺陷
  6435. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6436. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6437. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6438. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6439. //{
  6440. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6441. //}
  6442. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6443. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6444. {
  6445. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6446. }
  6447. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6448. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6449. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6450. {
  6451. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6452. }
  6453. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6454. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6455. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6456. {
  6457. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6458. }
  6459. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6460. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6461. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6462. {
  6463. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6464. }
  6465. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6466. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6467. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6468. //{
  6469. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6470. //}
  6471. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6472. //{
  6473. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6474. //}
  6475. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6476. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6477. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6478. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6479. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6480. {
  6481. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6482. }
  6483. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6484. {
  6485. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6486. }
  6487. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6488. //{
  6489. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6490. //}
  6491. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6492. //--------责任员工-------------------
  6493. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6494. if (drRow.Length > Constant.INT_IS_ZERO)
  6495. {
  6496. if (defect.DefectResponsibles == null)
  6497. {
  6498. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6499. }
  6500. foreach (DataRow r in drRow)
  6501. {
  6502. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6503. if (r["SemiCheckDefectID"].ToString() != "")
  6504. {
  6505. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6506. }
  6507. if (r["StaffID"].ToString() != "")
  6508. {
  6509. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6510. }
  6511. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6512. defectResponsible.StaffName = r["StaffName"].ToString();
  6513. if (r["StaffStatus"].ToString() != "")
  6514. {
  6515. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6516. }
  6517. if (r["UJobsID"].ToString() != "")
  6518. {
  6519. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6520. }
  6521. if (r["SJobsID"].ToString() != "")
  6522. {
  6523. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6524. }
  6525. defect.DefectResponsibles.Add(defectResponsible);
  6526. }
  6527. }
  6528. //------------------------------
  6529. if (productionData.SemiCheckDefects == null)
  6530. {
  6531. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6532. }
  6533. productionData.SemiCheckDefects.Add(defect);
  6534. }
  6535. //if (productionDatas.PDAProductionData == null)
  6536. //{
  6537. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6538. //}
  6539. productionDatas[0] = productionData;
  6540. //---------------------------------------------------------------------------------
  6541. }
  6542. }
  6543. }
  6544. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6545. actionResult.Status = (int)Constant.PDAResult.Success;
  6546. }
  6547. catch (Exception ex)
  6548. {
  6549. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6550. OutputLog.TraceLog(LogPriority.Error,
  6551. this.ToString(),
  6552. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6553. ex.ToString(),
  6554. LocalPath.LogExePath);
  6555. actionResult.Status = (int)Constant.PDAResult.Exception;
  6556. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6557. }
  6558. return actionResult;
  6559. }
  6560. /// <summary>
  6561. /// 保存半检登记
  6562. /// </summary>
  6563. /// <param name="accountCode">帐套code</param>
  6564. /// <param name="userCode">用户code</param>
  6565. /// <param name="userPassword">用户密码</param>
  6566. /// <param name="sessionKey">本次登陆密钥</param>
  6567. /// <param name="entity">半检实体类</param>
  6568. /// <param name="sUserInfo">用户基本信息</param>
  6569. /// <returns></returns>
  6570. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6571. {
  6572. ActionResult actionResult = new ActionResult();
  6573. try
  6574. {
  6575. // 验证请求头信息
  6576. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6577. // 验证失败
  6578. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6579. {
  6580. return actionResult;
  6581. }
  6582. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6583. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6584. string err = string.Empty;
  6585. err = resultEntity.Message;
  6586. if (err == null)
  6587. {
  6588. err = "";
  6589. }
  6590. SemiCheckEntity entity = entityobj[0];
  6591. if (entity.SemiCheckCategory == 1) // 半检登记
  6592. {
  6593. }
  6594. else if (entity.SemiCheckCategory == 2)// 复检登记
  6595. {
  6596. err = JsonHelper.ToJson(err);
  6597. }
  6598. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6599. {
  6600. err = JsonHelper.ToJson(err);
  6601. }
  6602. //actionResult.Result = JsonHelper.ToJson(err);
  6603. actionResult.Result = err;//JsonHelper.ToJson(err);
  6604. actionResult.Status = (int)Constant.PDAResult.Success;
  6605. }
  6606. catch (Exception ex)
  6607. {
  6608. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6609. OutputLog.TraceLog(LogPriority.Error,
  6610. this.ToString(),
  6611. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6612. ex.ToString(),
  6613. LocalPath.LogExePath);
  6614. actionResult.Status = (int)Constant.PDAResult.Exception;
  6615. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6616. }
  6617. return actionResult;
  6618. }
  6619. /// <summary>
  6620. /// 根据所选工号,查出缺陷责任员工
  6621. /// </summary>
  6622. /// <param name="sUserInfo"></param>
  6623. /// <returns></returns>
  6624. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6625. {
  6626. ActionResult actionResult = new ActionResult();
  6627. try
  6628. {
  6629. // 验证请求头信息
  6630. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6631. // 验证失败
  6632. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6633. {
  6634. return actionResult;
  6635. }
  6636. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6637. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  6638. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6639. actionResult.Status = (int)Constant.PDAResult.Success;
  6640. }
  6641. catch (Exception ex)
  6642. {
  6643. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6644. OutputLog.TraceLog(LogPriority.Error,
  6645. this.ToString(),
  6646. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6647. ex.ToString(),
  6648. LocalPath.LogExePath);
  6649. actionResult.Status = (int)Constant.PDAResult.Exception;
  6650. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6651. }
  6652. return actionResult;
  6653. }
  6654. /// <summary>
  6655. /// 获取半成品缺陷管理的全部数据
  6656. /// </summary>
  6657. /// <param name="sUserInfo"></param>
  6658. /// <returns></returns>
  6659. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  6660. {
  6661. ActionResult actionResult = new ActionResult();
  6662. try
  6663. {
  6664. // 验证请求头信息
  6665. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6666. // 验证失败
  6667. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6668. {
  6669. return actionResult;
  6670. }
  6671. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6672. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  6673. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6674. actionResult.Status = (int)Constant.PDAResult.Success;
  6675. }
  6676. catch (Exception ex)
  6677. {
  6678. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6679. OutputLog.TraceLog(LogPriority.Error,
  6680. this.ToString(),
  6681. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6682. ex.ToString(),
  6683. LocalPath.LogExePath);
  6684. actionResult.Status = (int)Constant.PDAResult.Exception;
  6685. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6686. }
  6687. return actionResult;
  6688. }
  6689. /// <summary>
  6690. /// 获取半成品缺陷位置管理的全部数据
  6691. /// </summary>
  6692. /// <param name="sUserInfo"></param>
  6693. /// <returns></returns>
  6694. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  6695. {
  6696. ActionResult actionResult = new ActionResult();
  6697. try
  6698. {
  6699. // 验证请求头信息
  6700. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6701. // 验证失败
  6702. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6703. {
  6704. return actionResult;
  6705. }
  6706. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6707. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  6708. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6709. actionResult.Status = (int)Constant.PDAResult.Success;
  6710. }
  6711. catch (Exception ex)
  6712. {
  6713. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6714. OutputLog.TraceLog(LogPriority.Error,
  6715. this.ToString(),
  6716. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6717. ex.ToString(),
  6718. LocalPath.LogExePath);
  6719. actionResult.Status = (int)Constant.PDAResult.Exception;
  6720. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6721. }
  6722. return actionResult;
  6723. }
  6724. /// <summary>
  6725. /// 复检验条码
  6726. /// </summary>
  6727. /// <param name="sUserInfo"></param>
  6728. /// <returns></returns>
  6729. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6730. {
  6731. ActionResult actionResult = new ActionResult();
  6732. try
  6733. {
  6734. // 验证请求头信息
  6735. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6736. // 验证失败
  6737. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6738. {
  6739. return actionResult;
  6740. }
  6741. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6742. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  6743. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6744. if (Convert.ToInt32(resultEntity.Result) < 0)
  6745. {
  6746. actionResult.Status = (int)Constant.PDAResult.Fail;
  6747. }
  6748. else
  6749. {
  6750. actionResult.Status = (int)Constant.PDAResult.Success;
  6751. }
  6752. actionResult.Message = resultEntity.Message;
  6753. }
  6754. catch (Exception ex)
  6755. {
  6756. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6757. OutputLog.TraceLog(LogPriority.Error,
  6758. this.ToString(),
  6759. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6760. ex.ToString(),
  6761. LocalPath.LogExePath);
  6762. actionResult.Status = (int)Constant.PDAResult.Exception;
  6763. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6764. }
  6765. return actionResult;
  6766. }
  6767. /// <summary>
  6768. /// 撤销复检验条码
  6769. /// </summary>
  6770. /// <param name="sUserInfo"></param>
  6771. /// <returns></returns>
  6772. public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6773. {
  6774. ActionResult actionResult = new ActionResult();
  6775. try
  6776. {
  6777. // 验证请求头信息
  6778. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6779. // 验证失败
  6780. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6781. {
  6782. return actionResult;
  6783. }
  6784. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6785. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  6786. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6787. if (Convert.ToInt32(resultEntity.Result) < 0)
  6788. {
  6789. actionResult.Status = (int)Constant.PDAResult.Fail;
  6790. }
  6791. else
  6792. {
  6793. actionResult.Status = (int)Constant.PDAResult.Success;
  6794. }
  6795. actionResult.Message = resultEntity.Message;
  6796. }
  6797. catch (Exception ex)
  6798. {
  6799. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6800. OutputLog.TraceLog(LogPriority.Error,
  6801. this.ToString(),
  6802. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6803. ex.ToString(),
  6804. LocalPath.LogExePath);
  6805. actionResult.Status = (int)Constant.PDAResult.Exception;
  6806. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6807. }
  6808. return actionResult;
  6809. }
  6810. /// <summary>
  6811. /// 恢复数据
  6812. /// </summary>
  6813. /// <param name="sUserInfo"></param>
  6814. /// <returns></returns>
  6815. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6816. {
  6817. ActionResult actionResult = new ActionResult();
  6818. try
  6819. {
  6820. // 验证请求头信息
  6821. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6822. // 验证失败
  6823. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6824. {
  6825. return actionResult;
  6826. }
  6827. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6828. () => PMModuleLogicDAL.ResetBarCode(barcode));
  6829. if (resultEntity > 0)
  6830. {
  6831. actionResult.Status = (int)Constant.PDAResult.Success;
  6832. actionResult.Message = "恢复数据成功";
  6833. }
  6834. else
  6835. {
  6836. actionResult.Status = (int)Constant.PDAResult.Fail;
  6837. if (resultEntity == -1)
  6838. {
  6839. actionResult.Message = "此条码没有清除,不能恢复";
  6840. }
  6841. else if (resultEntity == 0)
  6842. {
  6843. actionResult.Message = "没有可恢复的数据";
  6844. }
  6845. }
  6846. }
  6847. catch (Exception ex)
  6848. {
  6849. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6850. OutputLog.TraceLog(LogPriority.Error,
  6851. this.ToString(),
  6852. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6853. ex.ToString(),
  6854. LocalPath.LogExePath);
  6855. actionResult.Status = (int)Constant.PDAResult.Exception;
  6856. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6857. }
  6858. return actionResult;
  6859. }
  6860. /// <summary>
  6861. /// 通过SettingCode获取系统参数管理的数据
  6862. /// </summary>
  6863. /// <param name="accountCode"></param>
  6864. /// <param name="userCode"></param>
  6865. /// <param name="userPassword"></param>
  6866. /// <param name="sessionKey"></param>
  6867. /// <param name="settingcode">设置编码</param>
  6868. /// <returns></returns>
  6869. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  6870. {
  6871. ActionResult actionResult = new ActionResult();
  6872. try
  6873. {
  6874. // 验证请求头信息
  6875. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6876. // 验证失败
  6877. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6878. {
  6879. return actionResult;
  6880. }
  6881. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6882. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  6883. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6884. actionResult.Status = (int)Constant.PDAResult.Success;
  6885. }
  6886. catch (Exception ex)
  6887. {
  6888. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6889. OutputLog.TraceLog(LogPriority.Error,
  6890. this.ToString(),
  6891. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6892. ex.ToString(),
  6893. LocalPath.LogExePath);
  6894. actionResult.Status = (int)Constant.PDAResult.Exception;
  6895. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6896. }
  6897. return actionResult;
  6898. }
  6899. /// <summary>
  6900. /// 校验条码是否允许撤销,如果不允许提示错误消息
  6901. /// </summary>
  6902. /// <param name="accountCode"></param>
  6903. /// <param name="userCode"></param>
  6904. /// <param name="userPassword"></param>
  6905. /// <param name="sessionKey"></param>
  6906. /// <param name="orgTime">原时间</param>
  6907. /// <param name="days">允许撤销天数</param>
  6908. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  6909. /// <returns></returns>
  6910. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  6911. {
  6912. ActionResult actionResult = new ActionResult();
  6913. try
  6914. {
  6915. // 验证请求头信息
  6916. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6917. // 验证失败
  6918. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6919. {
  6920. return actionResult;
  6921. }
  6922. string[] subOrgTime = orgTime.Split('-');
  6923. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  6924. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6925. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  6926. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6927. if (Convert.ToInt32(resultEntity.Result) < 0)
  6928. {
  6929. actionResult.Status = (int)Constant.PDAResult.Fail;
  6930. }
  6931. else
  6932. {
  6933. actionResult.Status = (int)Constant.PDAResult.Success;
  6934. }
  6935. actionResult.Message = resultEntity.Message;
  6936. }
  6937. catch (Exception ex)
  6938. {
  6939. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6940. OutputLog.TraceLog(LogPriority.Error,
  6941. this.ToString(),
  6942. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6943. ex.ToString(),
  6944. LocalPath.LogExePath);
  6945. actionResult.Status = (int)Constant.PDAResult.Exception;
  6946. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6947. }
  6948. return actionResult;
  6949. }
  6950. /// <summary>
  6951. /// 获取生产订单管理的全部数据
  6952. /// </summary>
  6953. /// <param name="sUserInfo"></param>
  6954. /// <returns></returns>
  6955. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  6956. {
  6957. ActionResult actionResult = new ActionResult();
  6958. try
  6959. {
  6960. // 验证请求头信息
  6961. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6962. // 验证失败
  6963. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6964. {
  6965. return actionResult;
  6966. }
  6967. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6968. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  6969. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6970. actionResult.Status = (int)Constant.PDAResult.Success;
  6971. }
  6972. catch (Exception ex)
  6973. {
  6974. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6975. OutputLog.TraceLog(LogPriority.Error,
  6976. this.ToString(),
  6977. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6978. ex.ToString(),
  6979. LocalPath.LogExePath);
  6980. actionResult.Status = (int)Constant.PDAResult.Exception;
  6981. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6982. }
  6983. return actionResult;
  6984. }
  6985. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6986. {
  6987. ActionResult actionResult = new ActionResult();
  6988. try
  6989. {
  6990. // 验证请求头信息
  6991. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6992. // 验证失败
  6993. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6994. {
  6995. return actionResult;
  6996. }
  6997. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6998. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  6999. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7000. if (Convert.ToInt32(resultEntity.Result) < 0)
  7001. {
  7002. actionResult.Status = (int)Constant.PDAResult.Fail;
  7003. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  7004. }
  7005. else
  7006. {
  7007. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  7008. actionResult.Status = (int)Constant.PDAResult.Success;
  7009. }
  7010. actionResult.Message = resultEntity.Message;
  7011. }
  7012. catch (Exception ex)
  7013. {
  7014. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7015. OutputLog.TraceLog(LogPriority.Error,
  7016. this.ToString(),
  7017. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7018. ex.ToString(),
  7019. LocalPath.LogExePath);
  7020. actionResult.Status = (int)Constant.PDAResult.Exception;
  7021. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7022. }
  7023. return actionResult;
  7024. }
  7025. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  7026. {
  7027. ActionResult actionResult = new ActionResult();
  7028. try
  7029. {
  7030. // 验证请求头信息
  7031. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7032. // 验证失败
  7033. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7034. {
  7035. return actionResult;
  7036. }
  7037. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7038. () => SystemModuleLogic.GetSystemData(sUserInfo));
  7039. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7040. actionResult.Status = (int)Constant.PDAResult.Success;
  7041. }
  7042. catch (Exception ex)
  7043. {
  7044. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7045. OutputLog.TraceLog(LogPriority.Error,
  7046. this.ToString(),
  7047. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7048. ex.ToString(),
  7049. LocalPath.LogExePath);
  7050. actionResult.Status = (int)Constant.PDAResult.Exception;
  7051. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7052. }
  7053. return actionResult;
  7054. }
  7055. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  7056. {
  7057. ActionResult actionResult = new ActionResult();
  7058. try
  7059. {
  7060. // 验证请求头信息
  7061. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7062. // 验证失败
  7063. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7064. {
  7065. return actionResult;
  7066. }
  7067. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  7068. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7069. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  7070. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7071. if (Convert.ToInt32(resultEntity.Result) < 0)
  7072. {
  7073. actionResult.Status = (int)Constant.PDAResult.Fail;
  7074. }
  7075. else
  7076. {
  7077. actionResult.Status = (int)Constant.PDAResult.Success;
  7078. }
  7079. actionResult.Message = resultEntity.Message;
  7080. }
  7081. catch (Exception ex)
  7082. {
  7083. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7084. OutputLog.TraceLog(LogPriority.Error,
  7085. this.ToString(),
  7086. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7087. ex.ToString(),
  7088. LocalPath.LogExePath);
  7089. actionResult.Status = (int)Constant.PDAResult.Exception;
  7090. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7091. }
  7092. return actionResult;
  7093. }
  7094. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7095. {
  7096. ActionResult actionResult = new ActionResult();
  7097. try
  7098. {
  7099. // 验证请求头信息
  7100. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7101. // 验证失败
  7102. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7103. {
  7104. return actionResult;
  7105. }
  7106. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7107. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7108. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7109. if (Convert.ToInt32(resultEntity.Result) < 0)
  7110. {
  7111. actionResult.Status = (int)Constant.PDAResult.Fail;
  7112. }
  7113. else
  7114. {
  7115. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7116. actionResult.Status = (int)Constant.PDAResult.Success;
  7117. }
  7118. actionResult.Message = resultEntity.Message;
  7119. }
  7120. catch (Exception ex)
  7121. {
  7122. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7123. OutputLog.TraceLog(LogPriority.Error,
  7124. this.ToString(),
  7125. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7126. ex.ToString(),
  7127. LocalPath.LogExePath);
  7128. actionResult.Status = (int)Constant.PDAResult.Exception;
  7129. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7130. }
  7131. return actionResult;
  7132. }
  7133. public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7134. {
  7135. ActionResult actionResult = new ActionResult();
  7136. try
  7137. {
  7138. // 验证请求头信息
  7139. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7140. // 验证失败
  7141. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7142. {
  7143. return actionResult;
  7144. }
  7145. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7146. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7147. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7148. if (Convert.ToInt32(resultEntity.Result) < 0)
  7149. {
  7150. actionResult.Status = (int)Constant.PDAResult.Fail;
  7151. }
  7152. else
  7153. {
  7154. actionResult.Status = (int)Constant.PDAResult.Success;
  7155. }
  7156. actionResult.Message = resultEntity.Message;
  7157. }
  7158. catch (Exception ex)
  7159. {
  7160. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7161. OutputLog.TraceLog(LogPriority.Error,
  7162. this.ToString(),
  7163. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7164. ex.ToString(),
  7165. LocalPath.LogExePath);
  7166. actionResult.Status = (int)Constant.PDAResult.Exception;
  7167. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7168. }
  7169. return actionResult;
  7170. }
  7171. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7172. {
  7173. ActionResult actionResult = new ActionResult();
  7174. try
  7175. {
  7176. // 验证请求头信息
  7177. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7178. // 验证失败
  7179. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7180. {
  7181. return actionResult;
  7182. }
  7183. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7184. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7185. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7186. if (Convert.ToInt32(resultEntity.Result) < 0)
  7187. {
  7188. actionResult.Status = (int)Constant.PDAResult.Fail;
  7189. }
  7190. else
  7191. {
  7192. actionResult.Status = (int)Constant.PDAResult.Success;
  7193. }
  7194. actionResult.Message = resultEntity.Message;
  7195. }
  7196. catch (Exception ex)
  7197. {
  7198. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7199. OutputLog.TraceLog(LogPriority.Error,
  7200. this.ToString(),
  7201. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7202. ex.ToString(),
  7203. LocalPath.LogExePath);
  7204. actionResult.Status = (int)Constant.PDAResult.Exception;
  7205. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7206. }
  7207. return actionResult;
  7208. }
  7209. #region PDA条码打印
  7210. /// <summary>
  7211. /// 获取条码打印机
  7212. /// </summary>
  7213. /// <param name="accountCode"></param>
  7214. /// <param name="userCode"></param>
  7215. /// <param name="userPassword"></param>
  7216. /// <param name="sessionKey"></param>
  7217. /// <returns></returns>
  7218. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printType=0)
  7219. {
  7220. ActionResult actionResult = new ActionResult();
  7221. try
  7222. {
  7223. // 验证请求头信息
  7224. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7225. // 验证失败
  7226. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7227. {
  7228. return actionResult;
  7229. }
  7230. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType);
  7231. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7232. actionResult.Status = (int)Constant.PDAResult.Success;
  7233. }
  7234. catch (Exception ex)
  7235. {
  7236. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7237. OutputLog.TraceLog(LogPriority.Error,
  7238. this.ToString(),
  7239. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7240. ex.ToString(),
  7241. LocalPath.LogExePath);
  7242. actionResult.Status = (int)Constant.PDAResult.Exception;
  7243. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7244. }
  7245. return actionResult;
  7246. }
  7247. /// <summary>
  7248. /// 打印条码样式(补打)
  7249. /// </summary>
  7250. /// <param name="accountCode"></param>
  7251. /// <param name="userCode"></param>
  7252. /// <param name="userPassword"></param>
  7253. /// <param name="sessionKey"></param>
  7254. /// <returns></returns>
  7255. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey,
  7256. string barcode, int copies, int printerID, int printWay=2)
  7257. {
  7258. ActionResult actionResult = new ActionResult();
  7259. try
  7260. {
  7261. // 验证请求头信息
  7262. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7263. // 验证失败
  7264. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7265. {
  7266. return actionResult;
  7267. }
  7268. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7269. // copies, printerID, sUserInfo);
  7270. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(barcode,
  7271. copies, printerID, sUserInfo, printWay);
  7272. if (sre.Status != Constant.ServiceResultStatus.Success)
  7273. {
  7274. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7275. actionResult.Message = sre.Message;
  7276. return actionResult;
  7277. }
  7278. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7279. actionResult.Status = (int)Constant.PDAResult.Success;
  7280. }
  7281. catch (Exception ex)
  7282. {
  7283. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7284. OutputLog.TraceLog(LogPriority.Error,
  7285. this.ToString(),
  7286. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7287. ex.ToString(),
  7288. LocalPath.LogExePath);
  7289. actionResult.Status = (int)Constant.PDAResult.Exception;
  7290. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7291. }
  7292. return actionResult;
  7293. }
  7294. #endregion PDA条码打印
  7295. #region 统计报表
  7296. /// <summary>
  7297. /// 成型结算报表
  7298. /// </summary>
  7299. /// <param name="accountCode"></param>
  7300. /// <param name="userCode"></param>
  7301. /// <param name="userPassword"></param>
  7302. /// <param name="sessionKey"></param>
  7303. /// <returns></returns>
  7304. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7305. int currentMonth)
  7306. {
  7307. ActionResult actionResult = new ActionResult();
  7308. try
  7309. {
  7310. // 验证请求头信息
  7311. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7312. // 验证失败
  7313. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7314. {
  7315. return actionResult;
  7316. }
  7317. DateTime date = DateTime.Now;
  7318. if (currentMonth != 1)
  7319. {
  7320. date = date.AddMonths(-1);
  7321. }
  7322. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7323. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7324. if (resultEntity == null || resultEntity.Data == null)
  7325. {
  7326. actionResult.Status = (int)Constant.PDAResult.Fail;
  7327. actionResult.Message = "查询失败";
  7328. return actionResult;
  7329. }
  7330. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7331. {
  7332. actionResult.Status = (int)Constant.PDAResult.Fail;
  7333. actionResult.Message = resultEntity.Message;
  7334. return actionResult;
  7335. }
  7336. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7337. actionResult.Status = (int)Constant.PDAResult.Success;
  7338. }
  7339. catch (Exception ex)
  7340. {
  7341. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7342. OutputLog.TraceLog(LogPriority.Error,
  7343. this.ToString(),
  7344. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7345. ex.ToString(),
  7346. LocalPath.LogExePath);
  7347. actionResult.Status = (int)Constant.PDAResult.Exception;
  7348. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7349. }
  7350. return actionResult;
  7351. }
  7352. #endregion
  7353. #region 设置当期用户默认打印机配置
  7354. /// <summary>
  7355. /// 设置当期用户默认打印机配置
  7356. /// </summary>
  7357. /// <param name="accountCode"></param>
  7358. /// <param name="userCode"></param>
  7359. /// <param name="userPassword"></param>
  7360. /// <param name="sessionKey"></param>
  7361. /// <param name="printerID"></param>
  7362. /// <returns></returns>
  7363. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7364. int printerID)
  7365. {
  7366. ActionResult actionResult = new ActionResult();
  7367. try
  7368. {
  7369. // 验证请求头信息
  7370. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7371. // 验证失败
  7372. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7373. {
  7374. return actionResult;
  7375. }
  7376. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7377. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7378. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7379. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7380. {
  7381. actionResult.Status = (int)Constant.PDAResult.Fail;
  7382. }
  7383. else
  7384. {
  7385. actionResult.Status = (int)Constant.PDAResult.Success;
  7386. }
  7387. actionResult.Message = resultEntity.Message;
  7388. }
  7389. catch (Exception ex)
  7390. {
  7391. OutputLog.TraceLog(LogPriority.Error,
  7392. this.ToString(),
  7393. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7394. ex.ToString(),
  7395. LocalPath.LogExePath);
  7396. actionResult.Status = (int)Constant.PDAResult.Exception;
  7397. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7398. }
  7399. return actionResult;
  7400. }
  7401. /// <summary>
  7402. /// 校验产品条码是否可以进行回收
  7403. /// </summary>
  7404. /// <param name="accountCode">帐套code</param>
  7405. /// <param name="userCode">用户code</param>
  7406. /// <param name="userPassword">用户密码</param>
  7407. /// <param name="sessionKey">本次登陆密钥</param>
  7408. /// <param name="procedureID">工序ID</param>
  7409. /// <param name="barcode">条码</param>
  7410. /// <returns></returns>
  7411. /// <remarks>
  7412. /// 王鑫 2017.7.21 新建
  7413. /// </remarks>
  7414. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7415. {
  7416. ActionResult actionResult = new ActionResult();
  7417. try
  7418. {
  7419. // 验证请求头信息
  7420. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7421. // 验证失败
  7422. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7423. {
  7424. return actionResult;
  7425. }
  7426. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7427. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7428. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7429. {
  7430. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7431. actionResult.Status = (int)Constant.PDAResult.Success;
  7432. }
  7433. else
  7434. {
  7435. actionResult.Status = (int)Constant.PDAResult.Fail;
  7436. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7437. }
  7438. }
  7439. catch (Exception ex)
  7440. {
  7441. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7442. OutputLog.TraceLog(LogPriority.Error,
  7443. this.ToString(),
  7444. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7445. ex.ToString(),
  7446. LocalPath.LogExePath);
  7447. actionResult.Status = (int)Constant.PDAResult.Exception;
  7448. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7449. }
  7450. return actionResult;
  7451. }
  7452. /// <summary>
  7453. /// 获取回收标识
  7454. /// </summary>
  7455. /// <param name="accountCode"></param>
  7456. /// <param name="userCode"></param>
  7457. /// <param name="userPassword"></param>
  7458. /// <param name="sessionKey"></param>
  7459. /// <param name="usercode">工号编码</param>
  7460. /// <returns></returns>
  7461. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7462. {
  7463. ActionResult actionResult = new ActionResult();
  7464. try
  7465. {
  7466. // 验证请求头信息
  7467. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7468. // 验证失败
  7469. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7470. {
  7471. return actionResult;
  7472. }
  7473. int returnValue = ServiceInvoker.Invoke<int>(this,
  7474. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7475. actionResult.Result = JsonHelper.ToJson(returnValue);
  7476. actionResult.Status = (int)Constant.PDAResult.Success;
  7477. }
  7478. catch (Exception ex)
  7479. {
  7480. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7481. OutputLog.TraceLog(LogPriority.Error,
  7482. this.ToString(),
  7483. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7484. ex.ToString(),
  7485. LocalPath.LogExePath);
  7486. actionResult.Status = (int)Constant.PDAResult.Exception;
  7487. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7488. }
  7489. return actionResult;
  7490. }
  7491. #endregion
  7492. #region 注浆盘点
  7493. /// <summary>
  7494. /// 获取注浆盘点单列表
  7495. /// </summary>
  7496. /// <param name="sUserInfo"></param>
  7497. /// <returns></returns>
  7498. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7499. {
  7500. ActionResult actionResult = new ActionResult();
  7501. try
  7502. {
  7503. // 验证请求头信息
  7504. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7505. // 验证失败
  7506. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7507. {
  7508. return actionResult;
  7509. }
  7510. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7511. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7512. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7513. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7514. actionResult.Result = JsonHelper.ToJson(ds);
  7515. actionResult.Status = (int)Constant.PDAResult.Success;
  7516. }
  7517. catch (Exception ex)
  7518. {
  7519. string json = JsonHelper.ToJson(entity);
  7520. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7521. OutputLog.TraceLog(LogPriority.Error,
  7522. this.ToString(),
  7523. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7524. ex.ToString(),
  7525. LocalPath.LogExePath);
  7526. actionResult.Status = (int)Constant.PDAResult.Exception;
  7527. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7528. }
  7529. return actionResult;
  7530. }
  7531. /// <summary>
  7532. /// 进行盘点操作
  7533. /// </summary>
  7534. /// <param name="accountCode"></param>
  7535. /// <param name="userCode"></param>
  7536. /// <param name="userPassword"></param>
  7537. /// <param name="sessionKey"></param>
  7538. /// <param name="InCheckedID">盘点单ID</param>
  7539. /// <param name="BarCode">产品条码</param>
  7540. /// <returns></returns>
  7541. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7542. {
  7543. ActionResult actionResult = new ActionResult();
  7544. try
  7545. {
  7546. // 验证请求头信息
  7547. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7548. // 验证失败
  7549. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7550. {
  7551. return actionResult;
  7552. }
  7553. ClientRequestEntity cre = new ClientRequestEntity();
  7554. cre.Properties["CheckedID"] = CheckedID;
  7555. cre.Properties["Barcode"] = BarCode;
  7556. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7557. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7558. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7559. {
  7560. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7561. actionResult.Status = (int)Constant.PDAResult.Success;
  7562. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7563. }
  7564. else
  7565. {
  7566. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7567. actionResult.Status = (int)Constant.PDAResult.Fail;
  7568. actionResult.Message = returnValue.Message;
  7569. }
  7570. }
  7571. catch (Exception ex)
  7572. {
  7573. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7574. OutputLog.TraceLog(LogPriority.Error,
  7575. this.ToString(),
  7576. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7577. ex.ToString(),
  7578. LocalPath.LogExePath);
  7579. actionResult.Status = (int)Constant.PDAResult.Exception;
  7580. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7581. }
  7582. return actionResult;
  7583. }
  7584. /// <summary>
  7585. /// 获取盘点单明细
  7586. /// </summary>
  7587. /// <param name="sUserInfo"></param>
  7588. /// <returns></returns>
  7589. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7590. {
  7591. ActionResult actionResult = new ActionResult();
  7592. try
  7593. {
  7594. // 验证请求头信息
  7595. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7596. // 验证失败
  7597. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7598. {
  7599. return actionResult;
  7600. }
  7601. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7602. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  7603. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  7604. actionResult.Result = JsonHelper.ToJson(ds);
  7605. actionResult.Status = (int)Constant.PDAResult.Success;
  7606. }
  7607. catch (Exception ex)
  7608. {
  7609. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7610. OutputLog.TraceLog(LogPriority.Error,
  7611. this.ToString(),
  7612. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7613. ex.ToString(),
  7614. LocalPath.LogExePath);
  7615. actionResult.Status = (int)Constant.PDAResult.Exception;
  7616. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7617. }
  7618. return actionResult;
  7619. }
  7620. #endregion
  7621. #region 模具盘点
  7622. /// <summary>
  7623. /// 获取模具盘点单列表
  7624. /// </summary>
  7625. /// <param name="sUserInfo"></param>
  7626. /// <returns></returns>
  7627. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7628. {
  7629. ActionResult actionResult = new ActionResult();
  7630. try
  7631. {
  7632. // 验证请求头信息
  7633. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7634. // 验证失败
  7635. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7636. {
  7637. return actionResult;
  7638. }
  7639. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7640. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7641. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7642. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  7643. actionResult.Result = JsonHelper.ToJson(ds);
  7644. actionResult.Status = (int)Constant.PDAResult.Success;
  7645. }
  7646. catch (Exception ex)
  7647. {
  7648. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7649. OutputLog.TraceLog(LogPriority.Error,
  7650. this.ToString(),
  7651. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7652. ex.ToString(),
  7653. LocalPath.LogExePath);
  7654. actionResult.Status = (int)Constant.PDAResult.Exception;
  7655. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7656. }
  7657. return actionResult;
  7658. }
  7659. /// <summary>
  7660. /// 进行盘点操作
  7661. /// </summary>
  7662. /// <param name="accountCode"></param>
  7663. /// <param name="userCode"></param>
  7664. /// <param name="userPassword"></param>
  7665. /// <param name="sessionKey"></param>
  7666. /// <param name="InCheckedID">盘点单ID</param>
  7667. /// <param name="BarCode">产品条码</param>
  7668. /// <returns></returns>
  7669. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7670. {
  7671. ActionResult actionResult = new ActionResult();
  7672. try
  7673. {
  7674. // 验证请求头信息
  7675. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7676. // 验证失败
  7677. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7678. {
  7679. return actionResult;
  7680. }
  7681. ClientRequestEntity cre = new ClientRequestEntity();
  7682. cre.Properties["CheckedID"] = CheckedID;
  7683. cre.Properties["Barcode"] = BarCode;
  7684. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7685. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  7686. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7687. {
  7688. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7689. actionResult.Status = (int)Constant.PDAResult.Success;
  7690. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7691. }
  7692. else
  7693. {
  7694. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7695. actionResult.Status = (int)Constant.PDAResult.Fail;
  7696. actionResult.Message = returnValue.Message;
  7697. }
  7698. }
  7699. catch (Exception ex)
  7700. {
  7701. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7702. OutputLog.TraceLog(LogPriority.Error,
  7703. this.ToString(),
  7704. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7705. ex.ToString(),
  7706. LocalPath.LogExePath);
  7707. actionResult.Status = (int)Constant.PDAResult.Exception;
  7708. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7709. }
  7710. return actionResult;
  7711. }
  7712. /// <summary>
  7713. /// 获取盘点单明细
  7714. /// </summary>
  7715. /// <param name="sUserInfo"></param>
  7716. /// <returns></returns>
  7717. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7718. {
  7719. ActionResult actionResult = new ActionResult();
  7720. try
  7721. {
  7722. // 验证请求头信息
  7723. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7724. // 验证失败
  7725. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7726. {
  7727. return actionResult;
  7728. }
  7729. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7730. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  7731. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  7732. actionResult.Result = JsonHelper.ToJson(ds);
  7733. actionResult.Status = (int)Constant.PDAResult.Success;
  7734. }
  7735. catch (Exception ex)
  7736. {
  7737. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7738. OutputLog.TraceLog(LogPriority.Error,
  7739. this.ToString(),
  7740. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7741. ex.ToString(),
  7742. LocalPath.LogExePath);
  7743. actionResult.Status = (int)Constant.PDAResult.Exception;
  7744. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7745. }
  7746. return actionResult;
  7747. }
  7748. #endregion
  7749. #region 通用接口
  7750. /// <summary>
  7751. /// PDA调用通用接口
  7752. /// </summary>
  7753. /// <param name="accountCode"></param>
  7754. /// <param name="userCode"></param>
  7755. /// <param name="userPassword"></param>
  7756. /// <param name="sessionKey"></param>
  7757. /// <param name="module"></param>
  7758. /// <param name="action"></param>
  7759. /// <param name="data"></param>
  7760. /// <returns></returns>
  7761. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  7762. string module, string action, string jsonData)
  7763. {
  7764. ActionResult actionResult = null;
  7765. try
  7766. {
  7767. // 验证请求头信息
  7768. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7769. // 验证失败
  7770. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7771. {
  7772. return actionResult;
  7773. }
  7774. actionResult.Status = (int)Constant.PDAResult.Fail;
  7775. Dictionary<string, object> data = null;
  7776. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  7777. {
  7778. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  7779. }
  7780. #region PDA报表
  7781. if (module == "Report")
  7782. {
  7783. // 成型月度结算
  7784. if (action == "GetGroutingSettlementInfo")
  7785. {
  7786. DateTime month = DateTime.Now;
  7787. month = new DateTime(month.Year, month.Month, 1);
  7788. //month = new DateTime(2017, 6, 1);
  7789. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7790. if (currentMonth != 1)
  7791. {
  7792. month = month.AddMonths(-1);
  7793. }
  7794. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  7795. if (sre.Status == Constant.ServiceResultStatus.Success)
  7796. {
  7797. actionResult.Status = (int)Constant.PDAResult.Success;
  7798. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7799. }
  7800. else
  7801. {
  7802. actionResult.Status = (int)Constant.PDAResult.Fail;
  7803. actionResult.Message = sre.Message;
  7804. }
  7805. return actionResult;
  7806. }
  7807. // 成型月度结算-明细
  7808. if (action == "GetGroutingSettlementDetail")
  7809. {
  7810. DateTime month = DateTime.Now;
  7811. month = new DateTime(month.Year, month.Month, 1);
  7812. //month = new DateTime(2017, 6, 1);
  7813. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7814. if (currentMonth != 1)
  7815. {
  7816. month = month.AddMonths(-1);
  7817. }
  7818. string goodsCode = data["GoodsCode"].ToString();
  7819. string detailDate = data["DetailDate"].ToString();
  7820. DateTime? date = null;
  7821. if (detailDate != "合计")
  7822. {
  7823. date = DateTime.Parse(detailDate);
  7824. }
  7825. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  7826. if (sre.Status == Constant.ServiceResultStatus.Success)
  7827. {
  7828. actionResult.Status = (int)Constant.PDAResult.Success;
  7829. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7830. }
  7831. else
  7832. {
  7833. actionResult.Status = (int)Constant.PDAResult.Fail;
  7834. actionResult.Message = sre.Message;
  7835. }
  7836. return actionResult;
  7837. }
  7838. // 产成品交接汇总
  7839. if (action == "GetFinishedProductHandoverSum")
  7840. {
  7841. DateTime date = DateTime.Parse(data["date"].ToString());
  7842. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  7843. data["goodscode"] as string, sUserInfo);
  7844. if (sre.Status == Constant.ServiceResultStatus.Success)
  7845. {
  7846. actionResult.Status = (int)Constant.PDAResult.Success;
  7847. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7848. }
  7849. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  7850. {
  7851. actionResult.Status = (int)Constant.PDAResult.Success;
  7852. }
  7853. else
  7854. {
  7855. actionResult.Status = (int)Constant.PDAResult.Fail;
  7856. actionResult.Message = sre.Message;
  7857. }
  7858. return actionResult;
  7859. }
  7860. //xuwei add 2019-10-21
  7861. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  7862. if (action == "GetSemiReworkDayCount")
  7863. {
  7864. //不指定参数查询当天
  7865. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  7866. //dateStr = "2019-10-17";
  7867. //指定参数查询特定日期
  7868. if(data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  7869. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  7870. if (sre.Status == Constant.ServiceResultStatus.Success)
  7871. {
  7872. actionResult.Status = (int)Constant.PDAResult.Success;
  7873. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7874. }
  7875. else
  7876. {
  7877. actionResult.Status = (int)Constant.PDAResult.Fail;
  7878. actionResult.Message = sre.Message;
  7879. }
  7880. return actionResult;
  7881. }
  7882. //xuwe end
  7883. return actionResult;
  7884. }
  7885. #endregion
  7886. #region 模具管理
  7887. if (module == "PC_Mould")
  7888. {
  7889. #region 模具新建画面数据初始化
  7890. if (action == "GetMouldAddInit")
  7891. {
  7892. ClientRequestEntity cre = new ClientRequestEntity();
  7893. cre.Properties["MouldID"] = 0;
  7894. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  7895. if (sre.Status == Constant.ServiceResultStatus.Success)
  7896. {
  7897. actionResult.Status = (int)Constant.PDAResult.Success;
  7898. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7899. }
  7900. else
  7901. {
  7902. actionResult.Status = (int)Constant.PDAResult.Fail;
  7903. actionResult.Message = sre.Message;
  7904. }
  7905. return actionResult;
  7906. }
  7907. #endregion
  7908. #region 验证模具产品型号
  7909. if (action == "CheckGoodsCodeOnMould")
  7910. {
  7911. ClientRequestEntity cre = new ClientRequestEntity();
  7912. cre.Properties["GoodsCode"] = data["GoodsCode"];
  7913. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  7914. if (sre.Status == Constant.ServiceResultStatus.Success &&
  7915. sre.Data.Tables[0].Rows.Count > 0)
  7916. {
  7917. actionResult.Status = (int)Constant.PDAResult.Success;
  7918. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7919. }
  7920. else
  7921. {
  7922. actionResult.Status = (int)Constant.PDAResult.Fail;
  7923. actionResult.Message = "无效产品型号";
  7924. }
  7925. return actionResult;
  7926. }
  7927. #endregion
  7928. #region 验证模具生产工号
  7929. if (action == "CheckUserCodeOnMould")
  7930. {
  7931. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  7932. if (sre != null && sre.Rows.Count > 0)
  7933. {
  7934. actionResult.Status = (int)Constant.PDAResult.Success;
  7935. actionResult.Result = JsonHelper.ToJson(sre);
  7936. }
  7937. else
  7938. {
  7939. actionResult.Status = (int)Constant.PDAResult.Fail;
  7940. actionResult.Message = "无效生产工号";
  7941. }
  7942. return actionResult;
  7943. }
  7944. #endregion
  7945. #region 新建保存
  7946. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  7947. {
  7948. ClientRequestEntity cre = new ClientRequestEntity();
  7949. foreach (string item in data.Keys)
  7950. {
  7951. if (item == "ProductionDate")
  7952. {
  7953. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  7954. }
  7955. else
  7956. {
  7957. cre.Properties.Add(item, data[item]);
  7958. }
  7959. }
  7960. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  7961. if (sre.Status == Constant.ServiceResultStatus.Success)
  7962. {
  7963. actionResult.Status = (int)Constant.PDAResult.Success;
  7964. }
  7965. else
  7966. {
  7967. actionResult.Status = (int)Constant.PDAResult.Fail;
  7968. actionResult.Result = sre.OtherStatus;
  7969. actionResult.Message = sre.Message;
  7970. }
  7971. return actionResult;
  7972. }
  7973. #endregion
  7974. #region 模具编辑画面数据初始化
  7975. if (action == "GetMouldEditInfo")
  7976. {
  7977. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  7978. if (sre != null && sre.Rows.Count > 0)
  7979. {
  7980. actionResult.Status = (int)Constant.PDAResult.Success;
  7981. actionResult.Result = JsonHelper.ToJson(sre);
  7982. }
  7983. else
  7984. {
  7985. actionResult.Status = (int)Constant.PDAResult.Fail;
  7986. actionResult.Message = "无效模具条码";
  7987. }
  7988. return actionResult;
  7989. }
  7990. #endregion
  7991. #region 模具操作-画面初始化
  7992. if (action == "GetMouldOperationInit")
  7993. {
  7994. ClientRequestEntity cre = new ClientRequestEntity();
  7995. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  7996. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  7997. if (sre.Status == Constant.ServiceResultStatus.Success)
  7998. {
  7999. actionResult.Status = (int)Constant.PDAResult.Success;
  8000. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8001. }
  8002. else
  8003. {
  8004. actionResult.Status = (int)Constant.PDAResult.Fail;
  8005. actionResult.Result = sre.OtherStatus;
  8006. actionResult.Message = sre.Message;
  8007. }
  8008. return actionResult;
  8009. }
  8010. #endregion
  8011. #region 模具操作-验证模具条码
  8012. if (action == "CheckMouldBarcode")
  8013. {
  8014. ClientRequestEntity cre = new ClientRequestEntity();
  8015. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8016. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8017. if (sre.Status == Constant.ServiceResultStatus.Success)
  8018. {
  8019. if (sre.Data.Tables[0].Rows.Count == 0)
  8020. {
  8021. actionResult.Status = (int)Constant.PDAResult.Fail;
  8022. actionResult.Result = -1;
  8023. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8024. return actionResult;
  8025. }
  8026. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8027. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8028. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8029. #region 报损
  8030. if (mouldOperationType == 2)
  8031. {
  8032. if (mouldStatusID == 1 || mouldStatusID == 3)
  8033. {
  8034. actionResult.Status = (int)Constant.PDAResult.Success;
  8035. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8036. }
  8037. else
  8038. {
  8039. actionResult.Status = (int)Constant.PDAResult.Fail;
  8040. actionResult.Result = -2;
  8041. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8042. }
  8043. return actionResult;
  8044. }
  8045. #endregion
  8046. #region 撤销
  8047. if (mouldOperationType == 3)
  8048. {
  8049. if (mouldStatusID == 4)
  8050. {
  8051. actionResult.Status = (int)Constant.PDAResult.Success;
  8052. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8053. }
  8054. else
  8055. {
  8056. actionResult.Status = (int)Constant.PDAResult.Fail;
  8057. actionResult.Result = -2;
  8058. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  8059. }
  8060. return actionResult;
  8061. }
  8062. #endregion
  8063. #region 领用
  8064. if (mouldOperationType == 4)
  8065. {
  8066. if (mouldStatusID == 1)
  8067. {
  8068. actionResult.Status = (int)Constant.PDAResult.Success;
  8069. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8070. }
  8071. else
  8072. {
  8073. actionResult.Status = (int)Constant.PDAResult.Fail;
  8074. actionResult.Result = -2;
  8075. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  8076. }
  8077. return actionResult;
  8078. }
  8079. #endregion
  8080. #region 回收
  8081. if (mouldOperationType == 5)
  8082. {
  8083. if (mouldStatusID == 3)
  8084. {
  8085. actionResult.Status = (int)Constant.PDAResult.Success;
  8086. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8087. }
  8088. else
  8089. {
  8090. actionResult.Status = (int)Constant.PDAResult.Fail;
  8091. actionResult.Result = -2;
  8092. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  8093. }
  8094. return actionResult;
  8095. }
  8096. #endregion
  8097. #region 变更型号
  8098. if (mouldOperationType == -1)
  8099. {
  8100. if (mouldStatusID != 4)
  8101. {
  8102. actionResult.Status = (int)Constant.PDAResult.Success;
  8103. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8104. }
  8105. else
  8106. {
  8107. actionResult.Status = (int)Constant.PDAResult.Fail;
  8108. actionResult.Result = -2;
  8109. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  8110. }
  8111. return actionResult;
  8112. }
  8113. #endregion
  8114. #region 替换条码
  8115. if (mouldOperationType == -2)
  8116. {
  8117. actionResult.Status = (int)Constant.PDAResult.Success;
  8118. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8119. return actionResult;
  8120. }
  8121. #endregion
  8122. return actionResult;
  8123. }
  8124. }
  8125. #endregion
  8126. #region 模具操作-保存
  8127. if (action == "SetMouldOperation")
  8128. {
  8129. ClientRequestEntity cre = new ClientRequestEntity();
  8130. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8131. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8132. cre.Properties["Remarks"] = data["Remarks"];
  8133. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8134. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8135. {
  8136. cre.Properties["GoodsID"] = data["GoodsID"];
  8137. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8138. }
  8139. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8140. {
  8141. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8142. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8143. }
  8144. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8145. if (sre.Status == Constant.ServiceResultStatus.Success)
  8146. {
  8147. actionResult.Status = (int)Constant.PDAResult.Success;
  8148. }
  8149. else
  8150. {
  8151. actionResult.Status = (int)Constant.PDAResult.Fail;
  8152. }
  8153. return actionResult;
  8154. }
  8155. #endregion
  8156. #region 模具操作-替换条码
  8157. if (action == "ChangedMouldBarcode")
  8158. {
  8159. ClientRequestEntity cre = new ClientRequestEntity();
  8160. cre.Properties["MouldID"] = data["MouldID"];
  8161. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8162. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8163. cre.Properties["Remarks"] = data["Remarks"];
  8164. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8165. if (sre.Status == Constant.ServiceResultStatus.Success)
  8166. {
  8167. actionResult.Status = (int)Constant.PDAResult.Success;
  8168. }
  8169. else
  8170. {
  8171. actionResult.Status = (int)Constant.PDAResult.Fail;
  8172. actionResult.Result = sre.OtherStatus;
  8173. actionResult.Message = sre.Message;
  8174. }
  8175. return actionResult;
  8176. }
  8177. #endregion
  8178. #region 模具跟踪表
  8179. if (action == "GetMoldTracking")
  8180. {
  8181. ClientRequestEntity cre = new ClientRequestEntity();
  8182. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8183. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8184. if (sre.Status == Constant.ServiceResultStatus.Success)
  8185. {
  8186. actionResult.Status = (int)Constant.PDAResult.Success;
  8187. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8188. }
  8189. else
  8190. {
  8191. actionResult.Status = (int)Constant.PDAResult.Fail;
  8192. actionResult.Message = "此模具条码不存在";
  8193. }
  8194. return actionResult;
  8195. }
  8196. #endregion
  8197. return actionResult;
  8198. }
  8199. #endregion
  8200. #region 成型线模具管理
  8201. if (module == "PC_GroutingLineMould")
  8202. {
  8203. #region 获取当前用户成型线模具管理权限
  8204. if (action == "GetGMouldStatusRight")
  8205. {
  8206. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8207. actionResult.Status = (int)Constant.PDAResult.Success;
  8208. if (right != null && right.Rows.Count > 0)
  8209. {
  8210. actionResult.Result = JsonHelper.ToJson(right);
  8211. }
  8212. return actionResult;
  8213. }
  8214. #endregion
  8215. #region 获取成型线状态等信息,和成型模具信息
  8216. if (action == "GetGroutingLineMould")
  8217. {
  8218. int? groutingLineID = null;
  8219. string groutingLineCode = null;
  8220. if (data.ContainsKey("GroutingLineID"))
  8221. {
  8222. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8223. }
  8224. else
  8225. {
  8226. groutingLineCode = data["GroutingLineCode"] + "";
  8227. }
  8228. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8229. if (lineInfo == null)
  8230. {
  8231. actionResult.Status = (int)Constant.PDAResult.Fail;
  8232. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8233. }
  8234. else
  8235. {
  8236. actionResult.Status = (int)Constant.PDAResult.Success;
  8237. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8238. }
  8239. return actionResult;
  8240. }
  8241. #endregion
  8242. #region 模具操作-画面初始化
  8243. if (action == "GetMouldOperationInit")
  8244. {
  8245. ClientRequestEntity cre = new ClientRequestEntity();
  8246. cre.Properties["MouldOperationType"] = 2;
  8247. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8248. if (sre.Status == Constant.ServiceResultStatus.Success)
  8249. {
  8250. actionResult.Status = (int)Constant.PDAResult.Success;
  8251. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8252. }
  8253. else
  8254. {
  8255. actionResult.Status = (int)Constant.PDAResult.Fail;
  8256. actionResult.Result = sre.OtherStatus;
  8257. actionResult.Message = sre.Message;
  8258. }
  8259. return actionResult;
  8260. }
  8261. #endregion
  8262. #region 成型模具操作-画面初始化
  8263. if (action == "GetGroutingMouldOperationInit")
  8264. {
  8265. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8266. if (initData != null && initData.Rows.Count > 0)
  8267. {
  8268. actionResult.Status = (int)Constant.PDAResult.Success;
  8269. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8270. foreach (DataRow item in initData.Rows)
  8271. {
  8272. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8273. }
  8274. actionResult.Result = JsonHelper.ToJson(syssetting);
  8275. }
  8276. else
  8277. {
  8278. actionResult.Status = (int)Constant.PDAResult.Fail;
  8279. }
  8280. return actionResult;
  8281. }
  8282. #endregion
  8283. #region 模具操作-验证模具条码
  8284. if (action == "CheckMouldBarcode")
  8285. {
  8286. ClientRequestEntity cre = new ClientRequestEntity();
  8287. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8288. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8289. if (sre.Status == Constant.ServiceResultStatus.Success)
  8290. {
  8291. if (sre.Data.Tables[0].Rows.Count == 0)
  8292. {
  8293. actionResult.Status = (int)Constant.PDAResult.Fail;
  8294. actionResult.Result = -1;
  8295. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8296. return actionResult;
  8297. }
  8298. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8299. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8300. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8301. #region 上线
  8302. if (mouldOperationType == 6)
  8303. {
  8304. if (mouldStatusID == 1 || mouldStatusID == 3)
  8305. {
  8306. if (data.ContainsKey("GoodsID"))
  8307. {
  8308. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8309. {
  8310. actionResult.Status = (int)Constant.PDAResult.Fail;
  8311. actionResult.Result = -3;
  8312. actionResult.Message =
  8313. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8314. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8315. "】与当前不一致";
  8316. return actionResult;
  8317. }
  8318. }
  8319. actionResult.Status = (int)Constant.PDAResult.Success;
  8320. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8321. }
  8322. else
  8323. {
  8324. actionResult.Status = (int)Constant.PDAResult.Fail;
  8325. actionResult.Result = -2;
  8326. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8327. }
  8328. return actionResult;
  8329. }
  8330. #endregion
  8331. return actionResult;
  8332. }
  8333. }
  8334. #endregion
  8335. #region 停用
  8336. if (action == "StopGroutingLineDetail")
  8337. {
  8338. if (data == null || !data.ContainsKey("Details"))
  8339. {
  8340. actionResult.Status = (int)Constant.PDAResult.Fail;
  8341. actionResult.Message = "参数错误";
  8342. return actionResult;
  8343. }
  8344. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8345. DataTable gTable = new DataTable();
  8346. gTable.Columns.Add("GroutingLineID", typeof(int));
  8347. gTable.Columns.Add("GroutingLineCode");
  8348. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8349. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8350. gTable.Columns.Add("GroutingMouldCode");
  8351. gTable.Columns.Add("RecordRemarks");
  8352. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8353. gTable.Columns.Add("MouldID", typeof(int));
  8354. gTable.Columns.Add("MouldCode");
  8355. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8356. string groutingLineCode = data["GroutingLineCode"] + "";
  8357. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8358. foreach (Dictionary<string, object> item in details)
  8359. {
  8360. int? mouldID = null;
  8361. if (item.ContainsKey("MouldID"))
  8362. {
  8363. mouldID = Convert.ToInt32(item["MouldID"]);
  8364. if (mouldID == 0)
  8365. {
  8366. mouldID = null;
  8367. }
  8368. }
  8369. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8370. item["GLineDetailID"], item["GLineDetailCode"],
  8371. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8372. mouldID, item["MouldCode"]);
  8373. }
  8374. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8375. if (result > 0)
  8376. {
  8377. actionResult.Status = (int)Constant.PDAResult.Success;
  8378. }
  8379. else
  8380. {
  8381. actionResult.Status = (int)Constant.PDAResult.Fail;
  8382. actionResult.Result = result;
  8383. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8384. return actionResult;
  8385. }
  8386. return actionResult;
  8387. }
  8388. #endregion
  8389. #region 启用
  8390. if (action == "StartGroutingLineDetail")
  8391. {
  8392. if (data == null || !data.ContainsKey("Details"))
  8393. {
  8394. actionResult.Status = (int)Constant.PDAResult.Fail;
  8395. actionResult.Message = "参数错误";
  8396. return actionResult;
  8397. }
  8398. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8399. DataTable gTable = new DataTable();
  8400. gTable.Columns.Add("GroutingLineID", typeof(int));
  8401. gTable.Columns.Add("GroutingLineCode");
  8402. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8403. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8404. gTable.Columns.Add("GroutingMouldCode");
  8405. gTable.Columns.Add("RecordRemarks");
  8406. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8407. gTable.Columns.Add("MouldID", typeof(int));
  8408. gTable.Columns.Add("MouldCode");
  8409. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8410. string groutingLineCode = data["GroutingLineCode"] + "";
  8411. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8412. foreach (Dictionary<string, object> item in details)
  8413. {
  8414. int? mouldID = null;
  8415. if (item.ContainsKey("MouldID"))
  8416. {
  8417. mouldID = Convert.ToInt32(item["MouldID"]);
  8418. if (mouldID == 0)
  8419. {
  8420. mouldID = null;
  8421. }
  8422. }
  8423. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8424. item["GLineDetailID"], item["GLineDetailCode"],
  8425. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8426. mouldID, item["MouldCode"]);
  8427. }
  8428. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8429. if (result > 0)
  8430. {
  8431. actionResult.Status = (int)Constant.PDAResult.Success;
  8432. }
  8433. else
  8434. {
  8435. actionResult.Status = (int)Constant.PDAResult.Fail;
  8436. actionResult.Result = result;
  8437. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8438. return actionResult;
  8439. }
  8440. return actionResult;
  8441. }
  8442. #endregion
  8443. #region 维修
  8444. if (action == "RepairStartGroutingLineDetail")
  8445. {
  8446. if (data == null || !data.ContainsKey("Details"))
  8447. {
  8448. actionResult.Status = (int)Constant.PDAResult.Fail;
  8449. actionResult.Message = "参数错误";
  8450. return actionResult;
  8451. }
  8452. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8453. DataTable gTable = new DataTable();
  8454. gTable.Columns.Add("GroutingLineID", typeof(int));
  8455. gTable.Columns.Add("GroutingLineCode");
  8456. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8457. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8458. gTable.Columns.Add("GroutingMouldCode");
  8459. gTable.Columns.Add("RecordRemarks");
  8460. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8461. gTable.Columns.Add("MouldID", typeof(int));
  8462. gTable.Columns.Add("MouldCode");
  8463. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8464. string groutingLineCode = data["GroutingLineCode"] + "";
  8465. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8466. foreach (Dictionary<string, object> item in details)
  8467. {
  8468. int? mouldID = null;
  8469. if (item.ContainsKey("MouldID"))
  8470. {
  8471. mouldID = Convert.ToInt32(item["MouldID"]);
  8472. if (mouldID == 0)
  8473. {
  8474. mouldID = null;
  8475. }
  8476. }
  8477. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8478. item["GLineDetailID"], item["GLineDetailCode"],
  8479. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8480. mouldID, item["MouldCode"]);
  8481. }
  8482. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8483. if (result > 0)
  8484. {
  8485. actionResult.Status = (int)Constant.PDAResult.Success;
  8486. }
  8487. else
  8488. {
  8489. actionResult.Status = (int)Constant.PDAResult.Fail;
  8490. actionResult.Result = result;
  8491. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8492. return actionResult;
  8493. }
  8494. return actionResult;
  8495. }
  8496. #endregion
  8497. #region 结束维修
  8498. if (action == "RepairEndGroutingLineDetail")
  8499. {
  8500. if (data == null || !data.ContainsKey("Details"))
  8501. {
  8502. actionResult.Status = (int)Constant.PDAResult.Fail;
  8503. actionResult.Message = "参数错误";
  8504. return actionResult;
  8505. }
  8506. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8507. DataTable gTable = new DataTable();
  8508. gTable.Columns.Add("GroutingLineID", typeof(int));
  8509. gTable.Columns.Add("GroutingLineCode");
  8510. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8511. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8512. gTable.Columns.Add("GroutingMouldCode");
  8513. gTable.Columns.Add("RecordRemarks");
  8514. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8515. gTable.Columns.Add("MouldID", typeof(int));
  8516. gTable.Columns.Add("MouldCode");
  8517. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8518. string groutingLineCode = data["GroutingLineCode"] + "";
  8519. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8520. foreach (Dictionary<string, object> item in details)
  8521. {
  8522. int? mouldID = null;
  8523. if (item.ContainsKey("MouldID"))
  8524. {
  8525. mouldID = Convert.ToInt32(item["MouldID"]);
  8526. if (mouldID == 0)
  8527. {
  8528. mouldID = null;
  8529. }
  8530. }
  8531. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8532. item["GLineDetailID"], item["GLineDetailCode"],
  8533. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8534. mouldID, item["MouldCode"]);
  8535. }
  8536. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8537. if (result > 0)
  8538. {
  8539. actionResult.Status = (int)Constant.PDAResult.Success;
  8540. }
  8541. else
  8542. {
  8543. actionResult.Status = (int)Constant.PDAResult.Fail;
  8544. actionResult.Result = result;
  8545. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8546. return actionResult;
  8547. }
  8548. return actionResult;
  8549. }
  8550. #endregion
  8551. #region 换模
  8552. if (action == "ChangeGMouldStartGroutingLineDetail")
  8553. {
  8554. if (data == null || !data.ContainsKey("Details"))
  8555. {
  8556. actionResult.Status = (int)Constant.PDAResult.Fail;
  8557. actionResult.Message = "参数错误";
  8558. return actionResult;
  8559. }
  8560. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8561. DataTable gTable = new DataTable();
  8562. gTable.Columns.Add("GroutingLineID", typeof(int));
  8563. gTable.Columns.Add("GroutingLineCode");
  8564. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8565. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8566. gTable.Columns.Add("GroutingMouldCode");
  8567. gTable.Columns.Add("RecordRemarks");
  8568. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8569. gTable.Columns.Add("MouldID", typeof(int));
  8570. gTable.Columns.Add("MouldCode");
  8571. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8572. gTable.Columns.Add("MouldStatus", typeof(int));
  8573. gTable.Columns.Add("ScrapReason", typeof(int));
  8574. gTable.Columns.Add("ScrapResponsibility");
  8575. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8576. string groutingLineCode = data["GroutingLineCode"] + "";
  8577. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8578. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8579. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8580. string scrapResponsibility = data["ScrapRemarks"] + "";
  8581. foreach (Dictionary<string, object> item in details)
  8582. {
  8583. int? mouldID = null;
  8584. if (item.ContainsKey("MouldID"))
  8585. {
  8586. mouldID = Convert.ToInt32(item["MouldID"]);
  8587. if (mouldID == 0)
  8588. {
  8589. mouldID = null;
  8590. }
  8591. }
  8592. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8593. item["GLineDetailID"], item["GLineDetailCode"],
  8594. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8595. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8596. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8597. }
  8598. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  8599. if (result > 0)
  8600. {
  8601. actionResult.Status = (int)Constant.PDAResult.Success;
  8602. }
  8603. else
  8604. {
  8605. actionResult.Status = (int)Constant.PDAResult.Fail;
  8606. actionResult.Result = result;
  8607. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8608. return actionResult;
  8609. }
  8610. return actionResult;
  8611. }
  8612. #endregion
  8613. #region 变产
  8614. if (action == "UpdateLineStartGroutingLineDetail")
  8615. {
  8616. if (data == null || !data.ContainsKey("Details"))
  8617. {
  8618. actionResult.Status = (int)Constant.PDAResult.Fail;
  8619. actionResult.Message = "参数错误";
  8620. return actionResult;
  8621. }
  8622. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8623. DataTable gTable = new DataTable();
  8624. gTable.Columns.Add("GroutingLineID", typeof(int));
  8625. gTable.Columns.Add("GroutingLineCode");
  8626. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8627. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8628. gTable.Columns.Add("GroutingMouldCode");
  8629. gTable.Columns.Add("RecordRemarks");
  8630. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8631. gTable.Columns.Add("MouldID", typeof(int));
  8632. gTable.Columns.Add("MouldCode");
  8633. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8634. gTable.Columns.Add("MouldStatus", typeof(int));
  8635. gTable.Columns.Add("ScrapReason", typeof(int));
  8636. gTable.Columns.Add("ScrapResponsibility");
  8637. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8638. string groutingLineCode = data["GroutingLineCode"] + "";
  8639. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8640. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8641. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8642. string scrapResponsibility = data["ScrapRemarks"] + "";
  8643. foreach (Dictionary<string, object> item in details)
  8644. {
  8645. int? mouldID = null;
  8646. if (item.ContainsKey("MouldID"))
  8647. {
  8648. mouldID = Convert.ToInt32(item["MouldID"]);
  8649. if (mouldID == 0)
  8650. {
  8651. mouldID = null;
  8652. }
  8653. }
  8654. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8655. item["GLineDetailID"], item["GLineDetailCode"],
  8656. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8657. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8658. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8659. }
  8660. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  8661. if (result > 0)
  8662. {
  8663. actionResult.Status = (int)Constant.PDAResult.Success;
  8664. }
  8665. else
  8666. {
  8667. actionResult.Status = (int)Constant.PDAResult.Fail;
  8668. actionResult.Result = result;
  8669. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8670. return actionResult;
  8671. }
  8672. return actionResult;
  8673. }
  8674. #endregion
  8675. #region 整线变产
  8676. if (action == "UpdateAllLineStartGroutingLineDetail")
  8677. {
  8678. if (data == null || !data.ContainsKey("Details"))
  8679. {
  8680. actionResult.Status = (int)Constant.PDAResult.Fail;
  8681. actionResult.Message = "参数错误";
  8682. return actionResult;
  8683. }
  8684. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8685. DataTable gTable = new DataTable();
  8686. gTable.Columns.Add("GroutingLineID", typeof(int));
  8687. gTable.Columns.Add("GroutingLineCode");
  8688. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8689. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8690. gTable.Columns.Add("GroutingMouldCode");
  8691. gTable.Columns.Add("RecordRemarks");
  8692. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8693. gTable.Columns.Add("MouldID", typeof(int));
  8694. gTable.Columns.Add("MouldCode");
  8695. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8696. gTable.Columns.Add("MouldStatus", typeof(int));
  8697. gTable.Columns.Add("ScrapReason", typeof(int));
  8698. gTable.Columns.Add("ScrapResponsibility");
  8699. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8700. string groutingLineCode = data["GroutingLineCode"] + "";
  8701. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8702. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8703. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8704. string scrapResponsibility = data["ScrapRemarks"] + "";
  8705. foreach (Dictionary<string, object> item in details)
  8706. {
  8707. int? mouldID = null;
  8708. if (item.ContainsKey("MouldID"))
  8709. {
  8710. mouldID = Convert.ToInt32(item["MouldID"]);
  8711. if (mouldID == 0)
  8712. {
  8713. mouldID = null;
  8714. }
  8715. }
  8716. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8717. item["GLineDetailID"], item["GLineDetailCode"],
  8718. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8719. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8720. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8721. }
  8722. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  8723. if (result > 0)
  8724. {
  8725. actionResult.Status = (int)Constant.PDAResult.Success;
  8726. }
  8727. else
  8728. {
  8729. actionResult.Status = (int)Constant.PDAResult.Fail;
  8730. actionResult.Result = result;
  8731. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8732. return actionResult;
  8733. }
  8734. return actionResult;
  8735. }
  8736. #endregion
  8737. #region 卸模
  8738. if (action == "UnloadGroutingLineDetail")
  8739. {
  8740. if (data == null || !data.ContainsKey("Details"))
  8741. {
  8742. actionResult.Status = (int)Constant.PDAResult.Fail;
  8743. actionResult.Message = "参数错误";
  8744. return actionResult;
  8745. }
  8746. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8747. DataTable gTable = new DataTable();
  8748. gTable.Columns.Add("GroutingLineID", typeof(int));
  8749. gTable.Columns.Add("GroutingLineCode");
  8750. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8751. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8752. gTable.Columns.Add("GroutingMouldCode");
  8753. gTable.Columns.Add("RecordRemarks");
  8754. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8755. gTable.Columns.Add("MouldID", typeof(int));
  8756. gTable.Columns.Add("MouldCode");
  8757. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8758. gTable.Columns.Add("MouldStatus", typeof(int));
  8759. gTable.Columns.Add("ScrapReason", typeof(int));
  8760. gTable.Columns.Add("ScrapResponsibility");
  8761. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8762. string groutingLineCode = data["GroutingLineCode"] + "";
  8763. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8764. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8765. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8766. string scrapResponsibility = data["ScrapRemarks"] + "";
  8767. foreach (Dictionary<string, object> item in details)
  8768. {
  8769. int? mouldID = null;
  8770. if (item.ContainsKey("MouldID"))
  8771. {
  8772. mouldID = Convert.ToInt32(item["MouldID"]);
  8773. if (mouldID == 0)
  8774. {
  8775. mouldID = null;
  8776. }
  8777. }
  8778. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8779. item["GLineDetailID"], item["GLineDetailCode"],
  8780. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8781. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8782. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8783. }
  8784. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  8785. if (result > 0)
  8786. {
  8787. actionResult.Status = (int)Constant.PDAResult.Success;
  8788. }
  8789. else
  8790. {
  8791. actionResult.Status = (int)Constant.PDAResult.Fail;
  8792. actionResult.Result = result;
  8793. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8794. return actionResult;
  8795. }
  8796. return actionResult;
  8797. }
  8798. #endregion
  8799. #region 结束换模
  8800. if (action == "ChangeGMouldEndGroutingLineDetail")
  8801. {
  8802. if (data == null || !data.ContainsKey("Details"))
  8803. {
  8804. actionResult.Status = (int)Constant.PDAResult.Fail;
  8805. actionResult.Message = "参数错误";
  8806. return actionResult;
  8807. }
  8808. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8809. DataTable gTable = new DataTable();
  8810. gTable.Columns.Add("GroutingLineID", typeof(int));
  8811. gTable.Columns.Add("GroutingLineCode");
  8812. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8813. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8814. gTable.Columns.Add("GroutingMouldCode");
  8815. gTable.Columns.Add("RreasonRemarks");
  8816. gTable.Columns.Add("RecordRemarks");
  8817. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8818. gTable.Columns.Add("MouldID", typeof(int));
  8819. gTable.Columns.Add("MouldCode");
  8820. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8821. gTable.Columns.Add("GoodsID", typeof(int));
  8822. gTable.Columns.Add("GoodsCode");
  8823. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8824. gTable.Columns.Add("GroutingCount", typeof(int));
  8825. gTable.Columns.Add("MouldSource");
  8826. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8827. string groutingLineCode = data["GroutingLineCode"] + "";
  8828. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8829. foreach (Dictionary<string, object> item in details)
  8830. {
  8831. int? mouldID = null;
  8832. if (item.ContainsKey("MouldID"))
  8833. {
  8834. mouldID = Convert.ToInt32(item["MouldID"]);
  8835. if (mouldID == 0)
  8836. {
  8837. mouldID = null;
  8838. }
  8839. }
  8840. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8841. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8842. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8843. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8844. item["GoodsID"], item["GoodsCode"],
  8845. item["StandardGroutingCount"], item["GroutingCount"],
  8846. (mouldID == null ? "0" : "1"));
  8847. }
  8848. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  8849. if (result.Status == Constant.ServiceResultStatus.Success)
  8850. {
  8851. actionResult.Status = (int)Constant.PDAResult.Success;
  8852. }
  8853. else if (result.OtherStatus == -100)
  8854. {
  8855. actionResult.Status = (int)Constant.PDAResult.Fail;
  8856. actionResult.Result = -100;
  8857. actionResult.Message = result.Message;
  8858. return actionResult;
  8859. }
  8860. else
  8861. {
  8862. actionResult.Status = (int)Constant.PDAResult.Fail;
  8863. actionResult.Result = -500;
  8864. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8865. return actionResult;
  8866. }
  8867. return actionResult;
  8868. }
  8869. #endregion
  8870. #region 结束变产
  8871. if (action == "UpdateLineEndGroutingLineDetail")
  8872. {
  8873. if (data == null || !data.ContainsKey("Details"))
  8874. {
  8875. actionResult.Status = (int)Constant.PDAResult.Fail;
  8876. actionResult.Message = "参数错误";
  8877. return actionResult;
  8878. }
  8879. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8880. DataTable gTable = new DataTable();
  8881. gTable.Columns.Add("GroutingLineID", typeof(int));
  8882. gTable.Columns.Add("GroutingLineCode");
  8883. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8884. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8885. gTable.Columns.Add("GroutingMouldCode");
  8886. gTable.Columns.Add("RreasonRemarks");
  8887. gTable.Columns.Add("RecordRemarks");
  8888. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8889. gTable.Columns.Add("MouldID", typeof(int));
  8890. gTable.Columns.Add("MouldCode");
  8891. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8892. gTable.Columns.Add("GoodsID", typeof(int));
  8893. gTable.Columns.Add("GoodsCode");
  8894. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8895. gTable.Columns.Add("GroutingCount", typeof(int));
  8896. gTable.Columns.Add("MouldSource");
  8897. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8898. string groutingLineCode = data["GroutingLineCode"] + "";
  8899. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8900. foreach (Dictionary<string, object> item in details)
  8901. {
  8902. int? mouldID = null;
  8903. if (item.ContainsKey("MouldID"))
  8904. {
  8905. mouldID = Convert.ToInt32(item["MouldID"]);
  8906. if (mouldID == 0)
  8907. {
  8908. mouldID = null;
  8909. }
  8910. }
  8911. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8912. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8913. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8914. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8915. item["GoodsID"], item["GoodsCode"],
  8916. item["StandardGroutingCount"], item["GroutingCount"],
  8917. (mouldID == null ? "0" : "1"));
  8918. }
  8919. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  8920. if (result.Status == Constant.ServiceResultStatus.Success)
  8921. {
  8922. actionResult.Status = (int)Constant.PDAResult.Success;
  8923. }
  8924. else if (result.OtherStatus == -100)
  8925. {
  8926. actionResult.Status = (int)Constant.PDAResult.Fail;
  8927. actionResult.Result = -100;
  8928. actionResult.Message = result.Message;
  8929. return actionResult;
  8930. }
  8931. else
  8932. {
  8933. actionResult.Status = (int)Constant.PDAResult.Fail;
  8934. actionResult.Result = -500;
  8935. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8936. return actionResult;
  8937. }
  8938. return actionResult;
  8939. }
  8940. #endregion
  8941. #region 结束整线变产
  8942. if (action == "UpdateAllLineEndGroutingLineDetail")
  8943. {
  8944. if (data == null || !data.ContainsKey("Details"))
  8945. {
  8946. actionResult.Status = (int)Constant.PDAResult.Fail;
  8947. actionResult.Message = "参数错误";
  8948. return actionResult;
  8949. }
  8950. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8951. DataTable gTable = new DataTable();
  8952. gTable.Columns.Add("GroutingLineID", typeof(int));
  8953. gTable.Columns.Add("GroutingLineCode");
  8954. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8955. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8956. gTable.Columns.Add("GroutingMouldCode");
  8957. gTable.Columns.Add("Remarks");
  8958. gTable.Columns.Add("RecordRemarks");
  8959. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8960. gTable.Columns.Add("MouldID", typeof(int));
  8961. gTable.Columns.Add("MouldCode");
  8962. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8963. gTable.Columns.Add("GoodsID", typeof(int));
  8964. gTable.Columns.Add("GoodsCode");
  8965. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8966. gTable.Columns.Add("GroutingCount", typeof(int));
  8967. gTable.Columns.Add("MouldSource");
  8968. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8969. string groutingLineCode = data["GroutingLineCode"] + "";
  8970. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8971. foreach (Dictionary<string, object> item in details)
  8972. {
  8973. int? mouldID = null;
  8974. if (item.ContainsKey("MouldID"))
  8975. {
  8976. mouldID = Convert.ToInt32(item["MouldID"]);
  8977. if (mouldID == 0)
  8978. {
  8979. mouldID = null;
  8980. }
  8981. }
  8982. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8983. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8984. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  8985. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8986. item["GoodsID"], item["GoodsCode"],
  8987. item["StandardGroutingCount"], item["GroutingCount"],
  8988. (mouldID == null ? "0" : "1"));
  8989. }
  8990. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  8991. if (result.Status == Constant.ServiceResultStatus.Success)
  8992. {
  8993. actionResult.Status = (int)Constant.PDAResult.Success;
  8994. }
  8995. else if (result.OtherStatus == -100)
  8996. {
  8997. actionResult.Status = (int)Constant.PDAResult.Fail;
  8998. actionResult.Result = -100;
  8999. actionResult.Message = result.Message;
  9000. return actionResult;
  9001. }
  9002. else
  9003. {
  9004. actionResult.Status = (int)Constant.PDAResult.Fail;
  9005. actionResult.Result = -500;
  9006. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9007. return actionResult;
  9008. }
  9009. return actionResult;
  9010. }
  9011. #endregion
  9012. #region 上模
  9013. if (action == "UpdateGroutingLine_AddMould")
  9014. {
  9015. if (data == null || !data.ContainsKey("Details"))
  9016. {
  9017. actionResult.Status = (int)Constant.PDAResult.Fail;
  9018. actionResult.Message = "参数错误";
  9019. return actionResult;
  9020. }
  9021. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9022. DataTable gTable = new DataTable();
  9023. gTable.Columns.Add("GroutingLineID", typeof(int));
  9024. gTable.Columns.Add("GroutingLineCode");
  9025. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9026. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9027. gTable.Columns.Add("GroutingMouldCode");
  9028. gTable.Columns.Add("Remarks");
  9029. gTable.Columns.Add("RecordRemarks");
  9030. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9031. gTable.Columns.Add("MouldID", typeof(int));
  9032. gTable.Columns.Add("MouldCode");
  9033. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9034. gTable.Columns.Add("GoodsID", typeof(int));
  9035. gTable.Columns.Add("GoodsCode");
  9036. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9037. gTable.Columns.Add("GroutingCount", typeof(int));
  9038. gTable.Columns.Add("MouldSource");
  9039. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9040. string groutingLineCode = data["GroutingLineCode"] + "";
  9041. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9042. foreach (Dictionary<string, object> item in details)
  9043. {
  9044. int? mouldID = null;
  9045. if (item.ContainsKey("MouldID"))
  9046. {
  9047. mouldID = Convert.ToInt32(item["MouldID"]);
  9048. if (mouldID == 0)
  9049. {
  9050. mouldID = null;
  9051. }
  9052. }
  9053. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  9054. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9055. gldID, item["GLineDetailCode"],
  9056. item["DetailRemarks"], item["RecordRemarks"],
  9057. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  9058. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9059. item["GoodsID"], item["GoodsCode"],
  9060. item["StandardGroutingCount"], item["GroutingCount"],
  9061. (mouldID == null ? "0" : "1"));
  9062. }
  9063. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  9064. if (result.Status == Constant.ServiceResultStatus.Success)
  9065. {
  9066. actionResult.Status = (int)Constant.PDAResult.Success;
  9067. }
  9068. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  9069. {
  9070. actionResult.Status = (int)Constant.PDAResult.Fail;
  9071. actionResult.Result = result.OtherStatus;
  9072. actionResult.Message = result.Message;
  9073. return actionResult;
  9074. }
  9075. else
  9076. {
  9077. actionResult.Status = (int)Constant.PDAResult.Fail;
  9078. actionResult.Result = -500;
  9079. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9080. return actionResult;
  9081. }
  9082. return actionResult;
  9083. }
  9084. #endregion
  9085. return actionResult;
  9086. }
  9087. #endregion
  9088. #region 包装装板限制
  9089. if (module == "FinishedLoadingCar")
  9090. {
  9091. if (action == "GetSetting")
  9092. {
  9093. ClientRequestEntity cre = new ClientRequestEntity();
  9094. cre.Properties["GoodsID"] = data["GoodsID"];
  9095. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9096. if (sre.Status == Constant.ServiceResultStatus.Success)
  9097. {
  9098. actionResult.Status = (int)Constant.PDAResult.Success;
  9099. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9100. {
  9101. if (item["settingcode"].ToString() == "S_PM_011")
  9102. {
  9103. cre.Properties["S_PM_011"] = item["settingvalue"];
  9104. }
  9105. else if (item["settingcode"].ToString() == "S_PM_012")
  9106. {
  9107. cre.Properties["S_PM_012"] = item["settingvalue"];
  9108. }
  9109. else if (item["settingcode"].ToString() == "S_PM_013")
  9110. {
  9111. cre.Properties["S_PM_013"] = item["settingvalue"];
  9112. }
  9113. }
  9114. cre.Properties["PlatelitNum"] = sre.Result;
  9115. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9116. }
  9117. else
  9118. {
  9119. actionResult.Status = (int)Constant.PDAResult.Fail;
  9120. actionResult.Message = "";
  9121. }
  9122. return actionResult;
  9123. }
  9124. }
  9125. #endregion
  9126. #region 成型报损
  9127. if (module == "GroutingScrapProduct")
  9128. {
  9129. // 查询注浆日报明细表
  9130. if ("GetGroutingDailyDetail" == action)
  9131. {
  9132. ClientRequestEntity cre = new ClientRequestEntity();
  9133. cre.NameSpace = module;
  9134. cre.Name = action;
  9135. if (!string.IsNullOrEmpty(jsonData))
  9136. {
  9137. cre.Properties["BarCode"] = data["BarCode"];
  9138. }
  9139. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9140. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9141. actionResult.Status = (int)Constant.PDAResult.Success;
  9142. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9143. || sre.Data.Tables[0].Rows.Count == 0)
  9144. {
  9145. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9146. actionResult.Status = (int)Constant.PDAResult.Fail;
  9147. }
  9148. else
  9149. {
  9150. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9151. // 判断是否进行了注浆
  9152. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9153. {
  9154. actionResult.Message = "该产品还未进行注浆!";
  9155. actionResult.Status = (int)Constant.PDAResult.Fail;
  9156. }
  9157. // 判断是否进行了交坯
  9158. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9159. {
  9160. actionResult.Message = "该产品已经交坯!";
  9161. actionResult.Status = (int)Constant.PDAResult.Fail;
  9162. }
  9163. // 判断是否已经报损
  9164. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9165. {
  9166. actionResult.Message = "该产品已经报损!";
  9167. actionResult.Status = (int)Constant.PDAResult.Fail;
  9168. }
  9169. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9170. }
  9171. }
  9172. // 获取成型报损原因
  9173. else if ("GetScrapReasonData" == action)
  9174. {
  9175. ClientRequestEntity cre = new ClientRequestEntity();
  9176. cre.NameSpace = module;
  9177. cre.Name = action;
  9178. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo);
  9179. actionResult.Status = (int)Constant.PDAResult.Success;
  9180. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9181. }
  9182. // 保存成型报损
  9183. else if ("SaveGroutingScrapProduct" == action)
  9184. {
  9185. ClientRequestEntity cre = new ClientRequestEntity();
  9186. cre.NameSpace = module;
  9187. cre.Name = action;
  9188. if (!string.IsNullOrEmpty(jsonData))
  9189. {
  9190. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9191. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9192. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9193. if (dt != null && dt.Rows.Count > 0)
  9194. {
  9195. // 总单信息
  9196. DataRow properties = dt.Rows[0];
  9197. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9198. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9199. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9200. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9201. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9202. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9203. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9204. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9205. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9206. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9207. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9208. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9209. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9210. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9211. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9212. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9213. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9214. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9215. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9216. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9217. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9218. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9219. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9220. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9221. // 责任员工
  9222. cre.Data = new DataSet();
  9223. //DataTable returnTable = returnData.Tables[1].Copy();
  9224. cre.Data.Tables.Add(dtResponsible);
  9225. }
  9226. }
  9227. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9228. if (sre.Status == Constant.ServiceResultStatus.Success)
  9229. {
  9230. actionResult.Status = (int)Constant.PDAResult.Success;
  9231. actionResult.Result = sre.Result;
  9232. }
  9233. else
  9234. {
  9235. actionResult.Status = (int)Constant.PDAResult.Fail;
  9236. actionResult.Result = sre.OtherStatus;
  9237. actionResult.Message = sre.Message;
  9238. }
  9239. }
  9240. // 获取成型报损信息 用于撤销使用
  9241. else if ("GetGroutingScrapProduct" == action)
  9242. {
  9243. ClientRequestEntity cre = new ClientRequestEntity();
  9244. cre.NameSpace = module;
  9245. cre.Name = action;
  9246. if (!string.IsNullOrEmpty(jsonData))
  9247. {
  9248. cre.Properties["BarCode"] = data["BarCode"];
  9249. }
  9250. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9251. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9252. actionResult.Status = (int)Constant.PDAResult.Success;
  9253. }
  9254. // 撤销成型报损
  9255. else if ("ReverseGroutingScrapProduct" == action)
  9256. {
  9257. ClientRequestEntity cre = new ClientRequestEntity();
  9258. cre.NameSpace = module;
  9259. cre.Name = action;
  9260. if (!string.IsNullOrEmpty(jsonData))
  9261. {
  9262. cre.Properties["BarCode"] = data["BarCode"];
  9263. }
  9264. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9265. if (sre.Status == Constant.ServiceResultStatus.Success)
  9266. {
  9267. actionResult.Status = (int)Constant.PDAResult.Success;
  9268. actionResult.Result = sre.Result;
  9269. }
  9270. else
  9271. {
  9272. actionResult.Status = (int)Constant.PDAResult.Fail;
  9273. actionResult.Result = sre.OtherStatus;
  9274. actionResult.Message = sre.Message;
  9275. }
  9276. }
  9277. }
  9278. #endregion
  9279. #region 产品挂起
  9280. if (module == "ProductSuspend")
  9281. {
  9282. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9283. if (action == "GetSuspendProcedure")
  9284. {
  9285. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9286. if (sre.Status == Constant.ServiceResultStatus.Success)
  9287. {
  9288. actionResult.Status = (int)Constant.PDAResult.Success;
  9289. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9290. }
  9291. else
  9292. {
  9293. actionResult.Status = (int)Constant.PDAResult.Fail;
  9294. actionResult.Message = sre.Message;
  9295. }
  9296. return actionResult;
  9297. }
  9298. // 验证挂起条码
  9299. if (action == "CheckSuspendBarcode")
  9300. {
  9301. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9302. if (sre.Status == Constant.ServiceResultStatus.Success)
  9303. {
  9304. actionResult.Status = (int)Constant.PDAResult.Success;
  9305. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9306. }
  9307. else
  9308. {
  9309. actionResult.Status = (int)Constant.PDAResult.Fail;
  9310. actionResult.Message = sre.Message;
  9311. }
  9312. return actionResult;
  9313. }
  9314. // 挂起条码
  9315. if (action == "SaveSuspendProduct")
  9316. {
  9317. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9318. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9319. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9320. if (sre.Status == Constant.ServiceResultStatus.Success)
  9321. {
  9322. actionResult.Status = (int)Constant.PDAResult.Success;
  9323. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9324. }
  9325. else
  9326. {
  9327. actionResult.Status = (int)Constant.PDAResult.Fail;
  9328. actionResult.Message = sre.Message;
  9329. }
  9330. return actionResult;
  9331. }
  9332. // 撤销挂起条码
  9333. if (action == "DeleteSuspendProduct")
  9334. {
  9335. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9336. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9337. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9338. if (sre.Status == Constant.ServiceResultStatus.Success)
  9339. {
  9340. actionResult.Status = (int)Constant.PDAResult.Success;
  9341. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9342. }
  9343. else
  9344. {
  9345. actionResult.Status = (int)Constant.PDAResult.Fail;
  9346. actionResult.Message = sre.Message;
  9347. }
  9348. return actionResult;
  9349. }
  9350. // 查询挂起条码
  9351. if (action == "GetSuspendProduct")
  9352. {
  9353. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9354. if (sre.Status == Constant.ServiceResultStatus.Success)
  9355. {
  9356. if (sre.Data.Tables[0].Rows.Count == 0)
  9357. {
  9358. actionResult.Status = (int)Constant.PDAResult.Fail;
  9359. actionResult.Message = "此条码没有可撤销的挂起信息";
  9360. }
  9361. else
  9362. {
  9363. actionResult.Status = (int)Constant.PDAResult.Success;
  9364. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9365. }
  9366. }
  9367. else
  9368. {
  9369. actionResult.Status = (int)Constant.PDAResult.Fail;
  9370. actionResult.Message = sre.Message;
  9371. }
  9372. return actionResult;
  9373. }
  9374. }
  9375. #endregion
  9376. #region 品保抽查
  9377. if (module == "QASpotCheck")
  9378. {
  9379. if (action == "GetAllQASpotCheck")
  9380. {
  9381. ClientRequestEntity cre = new ClientRequestEntity();
  9382. cre.NameSpace = module;
  9383. cre.Name = action;
  9384. if (data != null && data.Count > 0)
  9385. {
  9386. foreach (string item in data.Keys)
  9387. {
  9388. if (item.StartsWith("checktime"))
  9389. {
  9390. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9391. }
  9392. else
  9393. {
  9394. cre.Properties.Add(item, data[item]);
  9395. }
  9396. }
  9397. }
  9398. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9399. if (sre.Status == Constant.ServiceResultStatus.Success)
  9400. {
  9401. actionResult.Status = (int)Constant.PDAResult.Success;
  9402. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9403. }
  9404. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9405. {
  9406. actionResult.Status = (int)Constant.PDAResult.Success;
  9407. }
  9408. else
  9409. {
  9410. actionResult.Status = (int)Constant.PDAResult.Fail;
  9411. actionResult.Message = sre.Message;
  9412. }
  9413. return actionResult;
  9414. }
  9415. if (action == "AutoSaveQASpotCheck")
  9416. {
  9417. string barcode = data["barcode"] + "";
  9418. string remarks = data["remarks"] + "";
  9419. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9420. if (sre.Status == Constant.ServiceResultStatus.Success)
  9421. {
  9422. actionResult.Status = (int)Constant.PDAResult.Success;
  9423. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9424. }
  9425. else
  9426. {
  9427. actionResult.Status = (int)Constant.PDAResult.Fail;
  9428. actionResult.Message = sre.Message;
  9429. }
  9430. return actionResult;
  9431. }
  9432. if (action == "CheckQASpotCheck")
  9433. {
  9434. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9435. if (sre.Status == Constant.ServiceResultStatus.Success)
  9436. {
  9437. actionResult.Status = (int)Constant.PDAResult.Success;
  9438. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9439. }
  9440. else
  9441. {
  9442. actionResult.Status = (int)Constant.PDAResult.Fail;
  9443. actionResult.Message = sre.Message;
  9444. }
  9445. return actionResult;
  9446. }
  9447. if (action == "SaveQASpotCheck")
  9448. {
  9449. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9450. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9451. if (sre.Status == Constant.ServiceResultStatus.Success)
  9452. {
  9453. actionResult.Status = (int)Constant.PDAResult.Success;
  9454. }
  9455. else
  9456. {
  9457. actionResult.Status = (int)Constant.PDAResult.Fail;
  9458. actionResult.Message = sre.Message;
  9459. }
  9460. return actionResult;
  9461. }
  9462. return null;
  9463. }
  9464. #endregion
  9465. #region 产成品交接
  9466. if (module == "FinishedProduct")
  9467. {
  9468. // 设定商标
  9469. if (action == "GetFinishedBarcode")
  9470. {
  9471. string barcode = data["barcode"].ToString();
  9472. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  9473. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9474. if (Convert.ToInt32(resultEntity.Result) < 0)
  9475. {
  9476. actionResult.Status = (int)Constant.PDAResult.Fail;
  9477. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9478. actionResult.Message = resultEntity.Message;
  9479. }
  9480. else
  9481. {
  9482. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9483. actionResult.Status = (int)Constant.PDAResult.Success;
  9484. actionResult.Message = resultEntity.Message;
  9485. }
  9486. return actionResult;
  9487. }
  9488. if (action == "GetHandoveredBarcode")
  9489. {
  9490. string barcode = data["barcode"].ToString();
  9491. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  9492. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9493. if (Convert.ToInt32(resultEntity.Result) < 0)
  9494. {
  9495. actionResult.Status = (int)Constant.PDAResult.Fail;
  9496. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9497. actionResult.Message = resultEntity.Message;
  9498. }
  9499. else
  9500. {
  9501. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9502. actionResult.Status = (int)Constant.PDAResult.Success;
  9503. actionResult.Message = resultEntity.Message;
  9504. }
  9505. return actionResult;
  9506. }
  9507. if (action == "SetFinishedLogo")
  9508. {
  9509. int logoid = Convert.ToInt32(data["logoid"]);
  9510. string[] barcodes = data["barcodes"].ToString().Split(',');
  9511. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo);
  9512. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9513. if (result < 0)
  9514. {
  9515. actionResult.Status = (int)Constant.PDAResult.Fail;
  9516. }
  9517. else
  9518. {
  9519. actionResult.Status = (int)Constant.PDAResult.Success;
  9520. }
  9521. return actionResult;
  9522. }
  9523. if (action == "SetHandoveredOrder")
  9524. {
  9525. int orderID = Convert.ToInt32(data["orderID"]);
  9526. string[] barcodes = data["barcodes"].ToString().Split(',');
  9527. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  9528. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9529. if (result < 0)
  9530. {
  9531. actionResult.Status = (int)Constant.PDAResult.Fail;
  9532. }
  9533. else
  9534. {
  9535. actionResult.Status = (int)Constant.PDAResult.Success;
  9536. }
  9537. return actionResult;
  9538. }
  9539. }
  9540. #endregion
  9541. #region 产成品装车
  9542. /*
  9543. if (module == "FinishedLoading")
  9544. {
  9545. // 设定商标
  9546. if (action == "GetMaxLoadingNo")
  9547. {
  9548. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  9549. actionResult.Status = (int)Constant.PDAResult.Success;
  9550. actionResult.Result = no;
  9551. return actionResult;
  9552. }
  9553. if (action == "CheckFinishedLaodingBarcode")
  9554. {
  9555. string barcode = data["barcode"].ToString();
  9556. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  9557. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  9558. {
  9559. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9560. actionResult.Status = (int)Constant.PDAResult.Success;
  9561. actionResult.Message = resultEntity.Message;
  9562. }
  9563. else
  9564. {
  9565. actionResult.Status = (int)Constant.PDAResult.Fail;
  9566. actionResult.Result = resultEntity.OtherStatus;
  9567. actionResult.Message = resultEntity.Message;
  9568. }
  9569. return actionResult;
  9570. }
  9571. if (action == "SaveFinishedLoading")
  9572. {
  9573. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  9574. string carLicense = data["carLicense"] + "";
  9575. int palletNum = Convert.ToInt32(data["palletNum"]);
  9576. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  9577. string remarks = data["remarks"] + "";
  9578. Dictionary<string, object>[] details =
  9579. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  9580. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  9581. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  9582. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  9583. if (result.Status == Constant.ServiceResultStatus.Success)
  9584. {
  9585. actionResult.Status = (int)Constant.PDAResult.Success;
  9586. actionResult.Message = result.Message;
  9587. }
  9588. else
  9589. {
  9590. actionResult.Status = (int)Constant.PDAResult.Fail;
  9591. actionResult.Result = result.OtherStatus;
  9592. actionResult.Message = result.Message;
  9593. }
  9594. return actionResult;
  9595. }
  9596. }
  9597. */
  9598. #endregion
  9599. #region 产成品质量改判
  9600. if (module == "FinishedProductTamper")
  9601. {
  9602. // 获取产成品信息及缺陷数据
  9603. if (action == "GetDefectData")
  9604. {
  9605. string barcode = data["barcode"].ToString();
  9606. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  9607. if (sre.Status == Constant.ServiceResultStatus.Success)
  9608. {
  9609. actionResult.Status = (int)Constant.PDAResult.Success;
  9610. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9611. actionResult.Message = sre.Message;
  9612. }
  9613. else
  9614. {
  9615. actionResult.Status = (int)Constant.PDAResult.Fail;
  9616. actionResult.Result = sre.OtherStatus;
  9617. actionResult.Message = sre.Message;
  9618. }
  9619. return actionResult;
  9620. }
  9621. // 获取产成品信息及缺陷数据
  9622. if (action == "SaveDefectData")
  9623. {
  9624. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  9625. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  9626. if (sre.Status == Constant.ServiceResultStatus.Success)
  9627. {
  9628. actionResult.Status = (int)Constant.PDAResult.Success;
  9629. actionResult.Message = sre.Message;
  9630. }
  9631. else
  9632. {
  9633. actionResult.Status = (int)Constant.PDAResult.Fail;
  9634. actionResult.Message = sre.Message;
  9635. }
  9636. return actionResult;
  9637. }
  9638. // 通过条码查出责任工序(成品改判用)
  9639. if (action == "GetDutyProcedureByBarCodeForTamper")
  9640. {
  9641. string barcode = data["barcode"] + "";
  9642. int defectid = int.Parse(data["defectid"] + "");
  9643. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  9644. if (sre.Status == Constant.ServiceResultStatus.Success)
  9645. {
  9646. actionResult.Status = (int)Constant.PDAResult.Success;
  9647. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9648. actionResult.Message = sre.Message;
  9649. }
  9650. else
  9651. {
  9652. actionResult.Status = (int)Constant.PDAResult.Fail;
  9653. actionResult.Result = sre.OtherStatus;
  9654. actionResult.Message = sre.Message;
  9655. }
  9656. return actionResult;
  9657. }
  9658. }
  9659. #endregion
  9660. #region PDA独立功能
  9661. #region 水效标识
  9662. if (module == "WaterEffect")
  9663. {
  9664. // 获取产成品信息及水效标识
  9665. if (action == "GetGoodsByBarCode")
  9666. {
  9667. string barcode = data["barcode"].ToString();
  9668. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  9669. if (sre.Status == Constant.ServiceResultStatus.Success)
  9670. {
  9671. actionResult.Status = (int)Constant.PDAResult.Success;
  9672. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9673. actionResult.Message = sre.Message;
  9674. }
  9675. else
  9676. {
  9677. actionResult.Status = (int)Constant.PDAResult.Fail;
  9678. actionResult.Result = sre.OtherStatus;
  9679. actionResult.Message = sre.Message;
  9680. }
  9681. return actionResult;
  9682. }
  9683. }
  9684. #endregion
  9685. #region 盖板型号
  9686. if (module == "SeatCoverType")
  9687. {
  9688. // 获取产成品信息及水效标识
  9689. if (action == "SendGoodsCodeToPLC")
  9690. {
  9691. string barcode = data["barcode"].ToString();
  9692. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  9693. if (sre == 0)
  9694. {
  9695. actionResult.Status = (int)Constant.PDAResult.Success;
  9696. }
  9697. else
  9698. {
  9699. actionResult.Status = (int)Constant.PDAResult.Fail;
  9700. actionResult.Result = sre;
  9701. switch (sre)
  9702. {
  9703. case 1:
  9704. case 2:
  9705. actionResult.Message = "无效条码";
  9706. break;
  9707. case 3:
  9708. actionResult.Message = "此产品型号没有设置盖板标识码";
  9709. break;
  9710. case 4:
  9711. actionResult.Message = "当前用户没有设置PLC参数";
  9712. break;
  9713. case 5:
  9714. actionResult.Message = "PLC参数设置不全";
  9715. break;
  9716. default:
  9717. actionResult.Message = "PLC通信异常";
  9718. break;
  9719. }
  9720. }
  9721. return actionResult;
  9722. }
  9723. }
  9724. #endregion
  9725. #region PDA PLC 相关功能
  9726. if (module == "PDA_FUN_PLC")
  9727. {
  9728. // PDA扫码发送到PLCServer
  9729. if (action == "SendBarcodeToPLCServer")
  9730. {
  9731. string barcode = data["barcode"].ToString();
  9732. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  9733. if (sre == 0)
  9734. {
  9735. actionResult.Status = (int)Constant.PDAResult.Success;
  9736. }
  9737. else
  9738. {
  9739. actionResult.Status = (int)Constant.PDAResult.Fail;
  9740. actionResult.Result = sre;
  9741. switch (sre)
  9742. {
  9743. case 1:
  9744. case 2:
  9745. actionResult.Message = "无效条码";
  9746. break;
  9747. case 3:
  9748. actionResult.Message = "PLC通信异常";
  9749. break;
  9750. case 4:
  9751. actionResult.Message = "当前用户没有设置PLC参数";
  9752. break;
  9753. case 5:
  9754. actionResult.Message = "PLC参数设置不全";
  9755. break;
  9756. default:
  9757. actionResult.Message = "PLC通信异常";
  9758. break;
  9759. }
  9760. }
  9761. return actionResult;
  9762. }
  9763. }
  9764. #endregion
  9765. #endregion
  9766. #region 半检返修
  9767. if (module == "SemiRework")
  9768. {
  9769. // 验证半检返修条码
  9770. if (action == "CheckSemiReworkBarcode")
  9771. {
  9772. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9773. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  9774. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9775. if (Convert.ToInt32(resultEntity.Result) < 0)
  9776. {
  9777. actionResult.Status = (int)Constant.PDAResult.Fail;
  9778. }
  9779. else
  9780. {
  9781. actionResult.Status = (int)Constant.PDAResult.Success;
  9782. }
  9783. actionResult.Message = resultEntity.Message;
  9784. return actionResult;
  9785. }
  9786. // 可以返修的工序
  9787. if (action == "GetSemiReworkProcedure")
  9788. {
  9789. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9790. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  9791. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9792. actionResult.Status = (int)Constant.PDAResult.Success;
  9793. return actionResult;
  9794. }
  9795. // 根据条码获取经过的工序,用于责任工序
  9796. if (action == "GetSemiReworkPassProcedure")
  9797. {
  9798. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9799. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  9800. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9801. actionResult.Status = (int)Constant.PDAResult.Success;
  9802. return actionResult;
  9803. }
  9804. // 根据所选生产工序(生产数据ID)查询责任员工
  9805. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  9806. {
  9807. int productionDataID = Convert.ToInt32(jsonData);
  9808. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9809. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  9810. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9811. actionResult.Status = (int)Constant.PDAResult.Success;
  9812. return actionResult;
  9813. }
  9814. // 根据所选工号,查出缺陷责任员工
  9815. if (action == "GetSemiReworkDefectStaffByUserID")
  9816. {
  9817. int userID = Convert.ToInt32(jsonData);
  9818. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9819. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  9820. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9821. actionResult.Status = (int)Constant.PDAResult.Success;
  9822. return actionResult;
  9823. }
  9824. // 新建半检返修
  9825. if (action == "AddSemiRework")
  9826. {
  9827. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"]+"");
  9828. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9829. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  9830. actionResult.Result = resultEntity.Result;
  9831. actionResult.Message = resultEntity.Message;
  9832. if (Convert.ToInt32(resultEntity.Result) > 0)
  9833. {
  9834. actionResult.Status = (int)Constant.PDAResult.Success;
  9835. }
  9836. else
  9837. {
  9838. actionResult.Status = (int)Constant.PDAResult.Fail;
  9839. }
  9840. return actionResult;
  9841. }
  9842. // 编辑半检返修
  9843. if (action == "EditSemiRework")
  9844. {
  9845. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9846. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9847. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  9848. actionResult.Result = resultEntity.Result;
  9849. actionResult.Message = resultEntity.Message;
  9850. if (Convert.ToInt32(resultEntity.Result) > 0)
  9851. {
  9852. actionResult.Status = (int)Constant.PDAResult.Success;
  9853. }
  9854. else
  9855. {
  9856. actionResult.Status = (int)Constant.PDAResult.Fail;
  9857. }
  9858. return actionResult;
  9859. }
  9860. // 撤销半检返修
  9861. if (action == "CancelSemiRework")
  9862. {
  9863. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9864. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9865. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  9866. actionResult.Result = resultEntity.Result;
  9867. actionResult.Message = resultEntity.Message;
  9868. if (Convert.ToInt32(resultEntity.Result) > 0)
  9869. {
  9870. actionResult.Status = (int)Constant.PDAResult.Success;
  9871. }
  9872. else
  9873. {
  9874. actionResult.Status = (int)Constant.PDAResult.Fail;
  9875. }
  9876. return actionResult;
  9877. }
  9878. // 获取半检返修数据(PDA编辑用)
  9879. if (action == "GetSemiReworkByID")
  9880. {
  9881. int id = Convert.ToInt32(jsonData);
  9882. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9883. PMModuleLogic.GetSemiReworkByID(id,sUserInfo.UserCode);
  9884. DataTable data1 = resultEntity.Data.Tables[0];
  9885. DataTable data2 = resultEntity.Data.Tables[1];
  9886. DataTable data3 = resultEntity.Data.Tables[2];
  9887. if (data1.Rows.Count == 0)
  9888. {
  9889. actionResult.Status = (int)Constant.PDAResult.Fail;
  9890. actionResult.Message = "半检返修信息不存在";
  9891. return actionResult;
  9892. }
  9893. SemiReworkEntity srEntity = new SemiReworkEntity();
  9894. srEntity.SemiReworkID = id;
  9895. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  9896. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  9897. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  9898. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  9899. foreach (DataRow row2 in data2.Rows)
  9900. {
  9901. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  9902. srEntity.SemiReworkDefects.Add(defectEntity);
  9903. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  9904. defectEntity.SemiReworkID = id;
  9905. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  9906. defectEntity.DefectCode = row2["DefectCode"] + "";
  9907. defectEntity.DefectName = row2["DefectName"] + "";
  9908. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  9909. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  9910. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  9911. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  9912. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  9913. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  9914. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  9915. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  9916. defectEntity.Remarks = row2["Remarks"] + "";
  9917. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  9918. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  9919. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  9920. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  9921. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  9922. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  9923. if (row3s.Length == 0)
  9924. {
  9925. continue;
  9926. }
  9927. foreach (DataRow row3 in row3s)
  9928. {
  9929. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  9930. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  9931. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  9932. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  9933. semiReworkRPS.StaffName = row3["StaffName"] + "";
  9934. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  9935. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  9936. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  9937. semiReworkRPS.UserCode = row3["UserCode"] + "";
  9938. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  9939. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  9940. }
  9941. }
  9942. //xuwei note 总单用于显示,信息较全
  9943. actionResult.Message = JsonHelper.ToJson(data1);
  9944. //xuwei note 总单信息不全,但有明细,用于回传保存
  9945. actionResult.Result = JsonHelper.ToJson(srEntity);
  9946. actionResult.Status = (int)Constant.PDAResult.Success;
  9947. }
  9948. }
  9949. #endregion
  9950. #region 窑车漏扫补件
  9951. if (module == "F_PM_0504")
  9952. {
  9953. // 验证窑车编码是否存在
  9954. if (action == "CheckKilnCar")
  9955. {
  9956. ClientRequestEntity cre = new ClientRequestEntity();
  9957. cre.Properties["kilncarcode"] = data["KilnCarCode"];
  9958. cre.Properties["procedureID"] = data["ProcedureID"];
  9959. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo);
  9960. if (sre.Status == Constant.ServiceResultStatus.Success)
  9961. {
  9962. actionResult.Status = (int)Constant.PDAResult.Success;
  9963. actionResult.Result = sre.Result;
  9964. }
  9965. else
  9966. {
  9967. actionResult.Status = (int)Constant.PDAResult.Fail;
  9968. actionResult.Message = sre.Message;
  9969. }
  9970. return actionResult;
  9971. }
  9972. // 验证窑车烧成批次号是否存在 和 是否能补漏扫
  9973. if (action == "CheckKilnCarBatchNo")
  9974. {
  9975. ClientRequestEntity cre = new ClientRequestEntity();
  9976. cre.Properties["KilnID"] = data["KilnID"];
  9977. cre.Properties["KilnCarID"] = data["KilnCarID"];
  9978. cre.Properties["ProcedureID"] = data["ProcedureID"];
  9979. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  9980. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo);
  9981. if (sre.Status == Constant.ServiceResultStatus.Success)
  9982. {
  9983. actionResult.Status = (int)Constant.PDAResult.Success;
  9984. }
  9985. else
  9986. {
  9987. actionResult.Status = (int)Constant.PDAResult.Fail;
  9988. actionResult.Message = sre.Message;
  9989. }
  9990. return actionResult;
  9991. }
  9992. // 窑车漏扫补件
  9993. if (action == "SetKilnCarMissing")
  9994. {
  9995. ClientRequestEntity cre = new ClientRequestEntity();
  9996. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  9997. string carData = data["CarData"] + "";
  9998. DataTable dataTable = JsonHelper.FromJson<DataTable>(carData);
  9999. cre.Data = new DataSet();
  10000. cre.Data.Tables.Add(dataTable);
  10001. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo);
  10002. if (sre.Status == Constant.ServiceResultStatus.Success)
  10003. {
  10004. actionResult.Status = (int)Constant.PDAResult.Success;
  10005. }
  10006. else
  10007. {
  10008. actionResult.Status = (int)Constant.PDAResult.Fail;
  10009. actionResult.Message = sre.Message;
  10010. }
  10011. return actionResult;
  10012. }
  10013. }
  10014. #endregion
  10015. return actionResult;
  10016. }
  10017. catch (Exception ex)
  10018. {
  10019. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  10020. OutputLog.TraceLog(LogPriority.Error,
  10021. this.ToString(),
  10022. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  10023. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  10024. " module:" + module + " action:" + action + " json:" + jsonData,
  10025. ex.ToString(),
  10026. LocalPath.LogExePath);
  10027. actionResult.Status = (int)Constant.PDAResult.Exception;
  10028. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  10029. }
  10030. return actionResult;
  10031. }
  10032. #endregion
  10033. }
  10034. }