PDAModuleService.cs 379 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769
  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 GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5718. {
  5719. ActionResult actionResult = new ActionResult();
  5720. try
  5721. {
  5722. // 验证请求头信息
  5723. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5724. // 验证失败
  5725. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5726. {
  5727. return actionResult;
  5728. }
  5729. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5730. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  5731. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5732. {
  5733. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5734. actionResult.Status = (int)Constant.PDAResult.Success;
  5735. }
  5736. }
  5737. catch (Exception ex)
  5738. {
  5739. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5740. OutputLog.TraceLog(LogPriority.Error,
  5741. this.ToString(),
  5742. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5743. ex.ToString(),
  5744. LocalPath.LogExePath);
  5745. actionResult.Status = (int)Constant.PDAResult.Exception;
  5746. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5747. }
  5748. return actionResult;
  5749. }
  5750. /// <summary>
  5751. /// 半检时,入窑前检验获取此条码是否报损为废品
  5752. /// </summary>
  5753. /// <param name="accountCode"></param>
  5754. /// <param name="userCode"></param>
  5755. /// <param name="userPassword"></param>
  5756. /// <param name="sessionKey"></param>
  5757. /// <param name="barcode">产品条码</param>
  5758. /// <returns></returns>
  5759. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5760. {
  5761. ActionResult actionResult = new ActionResult();
  5762. try
  5763. {
  5764. // 验证请求头信息
  5765. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5766. // 验证失败
  5767. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5768. {
  5769. return actionResult;
  5770. }
  5771. int returnValue = ServiceInvoker.Invoke<int>(this,
  5772. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  5773. if (returnValue != -100)
  5774. {
  5775. actionResult.Result = JsonHelper.ToJson(returnValue);
  5776. actionResult.Status = (int)Constant.PDAResult.Success;
  5777. }
  5778. else
  5779. {
  5780. actionResult.Status = (int)Constant.PDAResult.Fail;
  5781. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  5782. }
  5783. }
  5784. catch (Exception ex)
  5785. {
  5786. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5787. OutputLog.TraceLog(LogPriority.Error,
  5788. this.ToString(),
  5789. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5790. ex.ToString(),
  5791. LocalPath.LogExePath);
  5792. actionResult.Status = (int)Constant.PDAResult.Exception;
  5793. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5794. }
  5795. return actionResult;
  5796. }
  5797. /// <summary>
  5798. /// 获取登陆帐户有无入窑前检验数据编辑权限
  5799. /// </summary>
  5800. /// <param name="accountCode"></param>
  5801. /// <param name="userCode"></param>
  5802. /// <param name="userPassword"></param>
  5803. /// <param name="sessionKey"></param>
  5804. /// <param name="usercode">工号编码</param>
  5805. /// <returns></returns>
  5806. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5807. {
  5808. ActionResult actionResult = new ActionResult();
  5809. try
  5810. {
  5811. // 验证请求头信息
  5812. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5813. // 验证失败
  5814. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5815. {
  5816. return actionResult;
  5817. }
  5818. int returnValue = ServiceInvoker.Invoke<int>(this,
  5819. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  5820. actionResult.Result = JsonHelper.ToJson(returnValue);
  5821. actionResult.Status = (int)Constant.PDAResult.Success;
  5822. }
  5823. catch (Exception ex)
  5824. {
  5825. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5826. OutputLog.TraceLog(LogPriority.Error,
  5827. this.ToString(),
  5828. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5829. ex.ToString(),
  5830. LocalPath.LogExePath);
  5831. actionResult.Status = (int)Constant.PDAResult.Exception;
  5832. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5833. }
  5834. return actionResult;
  5835. }
  5836. /// <summary>
  5837. /// 获取登陆帐户有无半检验数据编辑权限
  5838. /// </summary>
  5839. /// <param name="accountCode"></param>
  5840. /// <param name="userCode"></param>
  5841. /// <param name="userPassword"></param>
  5842. /// <param name="sessionKey"></param>
  5843. /// <param name="usercode">工号编码</param>
  5844. /// <returns></returns>
  5845. public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5846. {
  5847. ActionResult actionResult = new ActionResult();
  5848. try
  5849. {
  5850. // 验证请求头信息
  5851. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5852. // 验证失败
  5853. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5854. {
  5855. return actionResult;
  5856. }
  5857. int returnValue = ServiceInvoker.Invoke<int>(this,
  5858. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  5859. actionResult.Result = JsonHelper.ToJson(returnValue);
  5860. actionResult.Status = (int)Constant.PDAResult.Success;
  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. /// <returns></returns>
  5883. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  5884. {
  5885. ActionResult actionResult = new ActionResult();
  5886. try
  5887. {
  5888. // 验证请求头信息
  5889. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5890. // 验证失败
  5891. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5892. {
  5893. return actionResult;
  5894. }
  5895. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5896. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  5897. if (ds != null && ds.Tables[0].Rows.Count > 0)
  5898. {
  5899. DataView dv = ds.Tables[0].DefaultView;
  5900. dv.RowFilter = "valueflag=1";
  5901. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5902. actionResult.Status = (int)Constant.PDAResult.Success;
  5903. }
  5904. else
  5905. {
  5906. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  5907. actionResult.Status = (int)Constant.PDAResult.Success;
  5908. }
  5909. }
  5910. catch (Exception ex)
  5911. {
  5912. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5913. OutputLog.TraceLog(LogPriority.Error,
  5914. this.ToString(),
  5915. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5916. ex.ToString(),
  5917. LocalPath.LogExePath);
  5918. actionResult.Status = (int)Constant.PDAResult.Exception;
  5919. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5920. }
  5921. return actionResult;
  5922. }
  5923. /// <summary>
  5924. /// 获取缺陷扣除数管理的全部数据
  5925. /// </summary>
  5926. /// <param name="accountCode"></param>
  5927. /// <param name="userCode"></param>
  5928. /// <param name="userPassword"></param>
  5929. /// <param name="sessionKey"></param>
  5930. /// <returns></returns>
  5931. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  5932. {
  5933. ActionResult actionResult = new ActionResult();
  5934. try
  5935. {
  5936. // 验证请求头信息
  5937. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5938. // 验证失败
  5939. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5940. {
  5941. return actionResult;
  5942. }
  5943. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5944. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  5945. if (ds != null && ds.Tables[0].Rows.Count > 0)
  5946. {
  5947. DataView dv = ds.Tables[0].DefaultView;
  5948. dv.RowFilter = "valueflag=1";
  5949. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5950. actionResult.Status = (int)Constant.PDAResult.Success;
  5951. }
  5952. else
  5953. {
  5954. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  5955. actionResult.Status = (int)Constant.PDAResult.Success;
  5956. }
  5957. }
  5958. catch (Exception ex)
  5959. {
  5960. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5961. OutputLog.TraceLog(LogPriority.Error,
  5962. this.ToString(),
  5963. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5964. ex.ToString(),
  5965. LocalPath.LogExePath);
  5966. actionResult.Status = (int)Constant.PDAResult.Exception;
  5967. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5968. }
  5969. return actionResult;
  5970. }
  5971. /// <summary>
  5972. /// 获取缺陷扣罚关系管理的全部数据
  5973. /// </summary>
  5974. /// <param name="accountCode"></param>
  5975. /// <param name="userCode"></param>
  5976. /// <param name="userPassword"></param>
  5977. /// <param name="sessionKey"></param>
  5978. /// <returns></returns>
  5979. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  5980. {
  5981. ActionResult actionResult = new ActionResult();
  5982. try
  5983. {
  5984. // 验证请求头信息
  5985. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5986. // 验证失败
  5987. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5988. {
  5989. return actionResult;
  5990. }
  5991. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5992. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  5993. DataTable dt = new DataTable();
  5994. dt.Columns.Add("DefectID");
  5995. dt.Columns.Add("DefectFineID");
  5996. DataView dv = ds.Tables[0].DefaultView;
  5997. DataTable dtFor = dv.ToTable("defectid", true);
  5998. for (int i = 0; i < dtFor.Rows.Count; i++)
  5999. {
  6000. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6001. string substring = "";
  6002. foreach (DataRow r1 in r)
  6003. {
  6004. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  6005. }
  6006. if (substring != "")
  6007. {
  6008. DataRow drnew = dt.NewRow();
  6009. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6010. drnew["DefectFineID"] = substring.TrimEnd(',');
  6011. dt.Rows.Add(drnew);
  6012. }
  6013. }
  6014. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6015. actionResult.Status = (int)Constant.PDAResult.Success;
  6016. }
  6017. catch (Exception ex)
  6018. {
  6019. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6020. OutputLog.TraceLog(LogPriority.Error,
  6021. this.ToString(),
  6022. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6023. ex.ToString(),
  6024. LocalPath.LogExePath);
  6025. actionResult.Status = (int)Constant.PDAResult.Exception;
  6026. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6027. }
  6028. return actionResult;
  6029. }
  6030. /// <summary>
  6031. /// 获取缺陷扣除数关系管理的全部数据
  6032. /// </summary>
  6033. /// <param name="accountCode"></param>
  6034. /// <param name="userCode"></param>
  6035. /// <param name="userPassword"></param>
  6036. /// <param name="sessionKey"></param>
  6037. /// <returns></returns>
  6038. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6039. {
  6040. ActionResult actionResult = new ActionResult();
  6041. try
  6042. {
  6043. // 验证请求头信息
  6044. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6045. // 验证失败
  6046. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6047. {
  6048. return actionResult;
  6049. }
  6050. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6051. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6052. DataTable dt = new DataTable();
  6053. dt.Columns.Add("DefectID");
  6054. dt.Columns.Add("DefectDeductionNum");
  6055. DataView dv = ds.Tables[0].DefaultView;
  6056. DataTable dtFor = dv.ToTable("defectid", true);
  6057. for (int i = 0; i < dtFor.Rows.Count; i++)
  6058. {
  6059. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6060. string substring = "";
  6061. foreach (DataRow r1 in r)
  6062. {
  6063. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6064. }
  6065. if (substring != "")
  6066. {
  6067. DataRow drnew = dt.NewRow();
  6068. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6069. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6070. dt.Rows.Add(drnew);
  6071. }
  6072. }
  6073. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6074. actionResult.Status = (int)Constant.PDAResult.Success;
  6075. }
  6076. catch (Exception ex)
  6077. {
  6078. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6079. OutputLog.TraceLog(LogPriority.Error,
  6080. this.ToString(),
  6081. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6082. ex.ToString(),
  6083. LocalPath.LogExePath);
  6084. actionResult.Status = (int)Constant.PDAResult.Exception;
  6085. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6086. }
  6087. return actionResult;
  6088. }
  6089. /// <summary>
  6090. /// 获取盘点单明细
  6091. /// </summary>
  6092. /// <param name="sUserInfo"></param>
  6093. /// <returns></returns>
  6094. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6095. {
  6096. ActionResult actionResult = new ActionResult();
  6097. try
  6098. {
  6099. // 验证请求头信息
  6100. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6101. // 验证失败
  6102. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6103. {
  6104. return actionResult;
  6105. }
  6106. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6107. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6108. actionResult.Result = JsonHelper.ToJson(ds);
  6109. actionResult.Status = (int)Constant.PDAResult.Success;
  6110. }
  6111. catch (Exception ex)
  6112. {
  6113. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6114. OutputLog.TraceLog(LogPriority.Error,
  6115. this.ToString(),
  6116. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6117. ex.ToString(),
  6118. LocalPath.LogExePath);
  6119. actionResult.Status = (int)Constant.PDAResult.Exception;
  6120. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6121. }
  6122. return actionResult;
  6123. }
  6124. /// <summary>
  6125. /// 半检检验条码
  6126. /// </summary>
  6127. /// <param name="sUserInfo"></param>
  6128. /// <returns></returns>
  6129. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6130. {
  6131. ActionResult actionResult = new ActionResult();
  6132. try
  6133. {
  6134. // 验证请求头信息
  6135. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6136. // 验证失败
  6137. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6138. {
  6139. return actionResult;
  6140. }
  6141. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6142. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6143. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6144. if (Convert.ToInt32(resultEntity.Result) < 0)
  6145. {
  6146. actionResult.Status = (int)Constant.PDAResult.Fail;
  6147. }
  6148. else
  6149. {
  6150. actionResult.Status = (int)Constant.PDAResult.Success;
  6151. }
  6152. actionResult.Message = resultEntity.Message;
  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 GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  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 resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6185. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6186. actionResult.Result = JsonHelper.ToJson(resultEntity);
  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 GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  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. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6220. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6221. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6222. actionResult.Status = (int)Constant.PDAResult.Success;
  6223. }
  6224. catch (Exception ex)
  6225. {
  6226. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6227. OutputLog.TraceLog(LogPriority.Error,
  6228. this.ToString(),
  6229. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6230. ex.ToString(),
  6231. LocalPath.LogExePath);
  6232. actionResult.Status = (int)Constant.PDAResult.Exception;
  6233. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6234. }
  6235. return actionResult;
  6236. }
  6237. /// <summary>
  6238. /// 复检状态数据源
  6239. /// </summary>
  6240. /// <param name="sUserInfo"></param>
  6241. /// <returns></returns>
  6242. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6243. {
  6244. ActionResult actionResult = new ActionResult();
  6245. try
  6246. {
  6247. // 验证请求头信息
  6248. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6249. // 验证失败
  6250. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6251. {
  6252. return actionResult;
  6253. }
  6254. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6255. () => SystemModuleLogic.GetSemiCheckType());
  6256. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6257. actionResult.Status = (int)Constant.PDAResult.Success;
  6258. }
  6259. catch (Exception ex)
  6260. {
  6261. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6262. OutputLog.TraceLog(LogPriority.Error,
  6263. this.ToString(),
  6264. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6265. ex.ToString(),
  6266. LocalPath.LogExePath);
  6267. actionResult.Status = (int)Constant.PDAResult.Exception;
  6268. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6269. }
  6270. return actionResult;
  6271. }
  6272. /// <summary>
  6273. /// 根据半成品检验数据ID,显示半成品数据信息
  6274. /// </summary>
  6275. /// <param name="sUserInfo"></param>
  6276. /// <returns></returns>
  6277. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6278. {
  6279. ActionResult actionResult = new ActionResult();
  6280. try
  6281. {
  6282. // 验证请求头信息
  6283. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6284. // 验证失败
  6285. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6286. {
  6287. return actionResult;
  6288. }
  6289. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6290. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6291. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6292. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6293. {
  6294. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6295. {
  6296. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6297. {
  6298. SemiCheckEntity productionData = new SemiCheckEntity();
  6299. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6300. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6301. {
  6302. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6303. }
  6304. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6305. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6306. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6307. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6308. productionData.ReFine = 0;
  6309. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6310. {
  6311. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6312. }
  6313. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6314. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6315. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6316. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6317. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6318. {
  6319. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6320. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6321. }
  6322. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6323. {
  6324. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6325. }
  6326. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6327. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6328. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6329. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6330. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6331. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6332. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6333. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6334. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6335. {
  6336. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6337. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6338. }
  6339. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6340. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6341. {
  6342. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6343. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6344. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6345. }
  6346. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6347. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6348. {
  6349. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6350. }
  6351. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6352. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6353. DataTable dtDefect = dvDefect.ToTable();
  6354. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6355. {
  6356. // 产品缺陷
  6357. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6358. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6359. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6360. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6361. //{
  6362. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6363. //}
  6364. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6365. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6366. {
  6367. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6368. }
  6369. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6370. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6371. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6372. {
  6373. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6374. }
  6375. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6376. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6377. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6378. {
  6379. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6380. }
  6381. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6382. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6383. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6384. {
  6385. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6386. }
  6387. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6388. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6389. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6390. //{
  6391. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6392. //}
  6393. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6394. //{
  6395. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6396. //}
  6397. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6398. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6399. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6400. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6401. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6402. {
  6403. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6404. }
  6405. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6406. {
  6407. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6408. }
  6409. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6410. //{
  6411. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6412. //}
  6413. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6414. //--------责任员工-------------------
  6415. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6416. if (drRow.Length > Constant.INT_IS_ZERO)
  6417. {
  6418. if (defect.DefectResponsibles == null)
  6419. {
  6420. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6421. }
  6422. foreach (DataRow r in drRow)
  6423. {
  6424. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6425. if (r["SemiCheckDefectID"].ToString() != "")
  6426. {
  6427. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6428. }
  6429. if (r["StaffID"].ToString() != "")
  6430. {
  6431. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6432. }
  6433. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6434. defectResponsible.StaffName = r["StaffName"].ToString();
  6435. if (r["StaffStatus"].ToString() != "")
  6436. {
  6437. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6438. }
  6439. if (r["UJobsID"].ToString() != "")
  6440. {
  6441. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6442. }
  6443. if (r["SJobsID"].ToString() != "")
  6444. {
  6445. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6446. }
  6447. defect.DefectResponsibles.Add(defectResponsible);
  6448. }
  6449. }
  6450. //------------------------------
  6451. if (productionData.SemiCheckDefects == null)
  6452. {
  6453. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6454. }
  6455. productionData.SemiCheckDefects.Add(defect);
  6456. }
  6457. //if (productionDatas.PDAProductionData == null)
  6458. //{
  6459. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6460. //}
  6461. productionDatas[0] = productionData;
  6462. //---------------------------------------------------------------------------------
  6463. }
  6464. }
  6465. }
  6466. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6467. actionResult.Status = (int)Constant.PDAResult.Success;
  6468. }
  6469. catch (Exception ex)
  6470. {
  6471. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6472. OutputLog.TraceLog(LogPriority.Error,
  6473. this.ToString(),
  6474. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6475. ex.ToString(),
  6476. LocalPath.LogExePath);
  6477. actionResult.Status = (int)Constant.PDAResult.Exception;
  6478. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6479. }
  6480. return actionResult;
  6481. }
  6482. /// <summary>
  6483. /// 保存半检登记
  6484. /// </summary>
  6485. /// <param name="accountCode">帐套code</param>
  6486. /// <param name="userCode">用户code</param>
  6487. /// <param name="userPassword">用户密码</param>
  6488. /// <param name="sessionKey">本次登陆密钥</param>
  6489. /// <param name="entity">半检实体类</param>
  6490. /// <param name="sUserInfo">用户基本信息</param>
  6491. /// <returns></returns>
  6492. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6493. {
  6494. ActionResult actionResult = new ActionResult();
  6495. try
  6496. {
  6497. // 验证请求头信息
  6498. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6499. // 验证失败
  6500. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6501. {
  6502. return actionResult;
  6503. }
  6504. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6505. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6506. string err = string.Empty;
  6507. err = resultEntity.Message;
  6508. if (err == null)
  6509. {
  6510. err = "";
  6511. }
  6512. SemiCheckEntity entity = entityobj[0];
  6513. if (entity.SemiCheckCategory == 1) // 半检登记
  6514. {
  6515. }
  6516. else if (entity.SemiCheckCategory == 2)// 复检登记
  6517. {
  6518. err = JsonHelper.ToJson(err);
  6519. }
  6520. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6521. {
  6522. err = JsonHelper.ToJson(err);
  6523. }
  6524. //actionResult.Result = JsonHelper.ToJson(err);
  6525. actionResult.Result = err;//JsonHelper.ToJson(err);
  6526. actionResult.Status = (int)Constant.PDAResult.Success;
  6527. }
  6528. catch (Exception ex)
  6529. {
  6530. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6531. OutputLog.TraceLog(LogPriority.Error,
  6532. this.ToString(),
  6533. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6534. ex.ToString(),
  6535. LocalPath.LogExePath);
  6536. actionResult.Status = (int)Constant.PDAResult.Exception;
  6537. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6538. }
  6539. return actionResult;
  6540. }
  6541. /// <summary>
  6542. /// 根据所选工号,查出缺陷责任员工
  6543. /// </summary>
  6544. /// <param name="sUserInfo"></param>
  6545. /// <returns></returns>
  6546. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6547. {
  6548. ActionResult actionResult = new ActionResult();
  6549. try
  6550. {
  6551. // 验证请求头信息
  6552. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6553. // 验证失败
  6554. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6555. {
  6556. return actionResult;
  6557. }
  6558. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6559. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  6560. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6561. actionResult.Status = (int)Constant.PDAResult.Success;
  6562. }
  6563. catch (Exception ex)
  6564. {
  6565. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6566. OutputLog.TraceLog(LogPriority.Error,
  6567. this.ToString(),
  6568. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6569. ex.ToString(),
  6570. LocalPath.LogExePath);
  6571. actionResult.Status = (int)Constant.PDAResult.Exception;
  6572. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6573. }
  6574. return actionResult;
  6575. }
  6576. /// <summary>
  6577. /// 获取半成品缺陷管理的全部数据
  6578. /// </summary>
  6579. /// <param name="sUserInfo"></param>
  6580. /// <returns></returns>
  6581. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  6582. {
  6583. ActionResult actionResult = new ActionResult();
  6584. try
  6585. {
  6586. // 验证请求头信息
  6587. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6588. // 验证失败
  6589. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6590. {
  6591. return actionResult;
  6592. }
  6593. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6594. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  6595. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6596. actionResult.Status = (int)Constant.PDAResult.Success;
  6597. }
  6598. catch (Exception ex)
  6599. {
  6600. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6601. OutputLog.TraceLog(LogPriority.Error,
  6602. this.ToString(),
  6603. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6604. ex.ToString(),
  6605. LocalPath.LogExePath);
  6606. actionResult.Status = (int)Constant.PDAResult.Exception;
  6607. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6608. }
  6609. return actionResult;
  6610. }
  6611. /// <summary>
  6612. /// 获取半成品缺陷位置管理的全部数据
  6613. /// </summary>
  6614. /// <param name="sUserInfo"></param>
  6615. /// <returns></returns>
  6616. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  6617. {
  6618. ActionResult actionResult = new ActionResult();
  6619. try
  6620. {
  6621. // 验证请求头信息
  6622. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6623. // 验证失败
  6624. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6625. {
  6626. return actionResult;
  6627. }
  6628. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6629. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  6630. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6631. actionResult.Status = (int)Constant.PDAResult.Success;
  6632. }
  6633. catch (Exception ex)
  6634. {
  6635. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6636. OutputLog.TraceLog(LogPriority.Error,
  6637. this.ToString(),
  6638. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6639. ex.ToString(),
  6640. LocalPath.LogExePath);
  6641. actionResult.Status = (int)Constant.PDAResult.Exception;
  6642. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6643. }
  6644. return actionResult;
  6645. }
  6646. /// <summary>
  6647. /// 复检验条码
  6648. /// </summary>
  6649. /// <param name="sUserInfo"></param>
  6650. /// <returns></returns>
  6651. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6652. {
  6653. ActionResult actionResult = new ActionResult();
  6654. try
  6655. {
  6656. // 验证请求头信息
  6657. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6658. // 验证失败
  6659. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6660. {
  6661. return actionResult;
  6662. }
  6663. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6664. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  6665. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6666. if (Convert.ToInt32(resultEntity.Result) < 0)
  6667. {
  6668. actionResult.Status = (int)Constant.PDAResult.Fail;
  6669. }
  6670. else
  6671. {
  6672. actionResult.Status = (int)Constant.PDAResult.Success;
  6673. }
  6674. actionResult.Message = resultEntity.Message;
  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 CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  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. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6707. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  6708. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6709. if (Convert.ToInt32(resultEntity.Result) < 0)
  6710. {
  6711. actionResult.Status = (int)Constant.PDAResult.Fail;
  6712. }
  6713. else
  6714. {
  6715. actionResult.Status = (int)Constant.PDAResult.Success;
  6716. }
  6717. actionResult.Message = resultEntity.Message;
  6718. }
  6719. catch (Exception ex)
  6720. {
  6721. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6722. OutputLog.TraceLog(LogPriority.Error,
  6723. this.ToString(),
  6724. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6725. ex.ToString(),
  6726. LocalPath.LogExePath);
  6727. actionResult.Status = (int)Constant.PDAResult.Exception;
  6728. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6729. }
  6730. return actionResult;
  6731. }
  6732. /// <summary>
  6733. /// 恢复数据
  6734. /// </summary>
  6735. /// <param name="sUserInfo"></param>
  6736. /// <returns></returns>
  6737. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6738. {
  6739. ActionResult actionResult = new ActionResult();
  6740. try
  6741. {
  6742. // 验证请求头信息
  6743. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6744. // 验证失败
  6745. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6746. {
  6747. return actionResult;
  6748. }
  6749. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6750. () => PMModuleLogicDAL.ResetBarCode(barcode));
  6751. if (resultEntity > 0)
  6752. {
  6753. actionResult.Status = (int)Constant.PDAResult.Success;
  6754. actionResult.Message = "恢复数据成功";
  6755. }
  6756. else
  6757. {
  6758. actionResult.Status = (int)Constant.PDAResult.Fail;
  6759. if (resultEntity == -1)
  6760. {
  6761. actionResult.Message = "此条码没有清除,不能恢复";
  6762. }
  6763. else if (resultEntity == 0)
  6764. {
  6765. actionResult.Message = "没有可恢复的数据";
  6766. }
  6767. }
  6768. }
  6769. catch (Exception ex)
  6770. {
  6771. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6772. OutputLog.TraceLog(LogPriority.Error,
  6773. this.ToString(),
  6774. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6775. ex.ToString(),
  6776. LocalPath.LogExePath);
  6777. actionResult.Status = (int)Constant.PDAResult.Exception;
  6778. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6779. }
  6780. return actionResult;
  6781. }
  6782. /// <summary>
  6783. /// 通过SettingCode获取系统参数管理的数据
  6784. /// </summary>
  6785. /// <param name="accountCode"></param>
  6786. /// <param name="userCode"></param>
  6787. /// <param name="userPassword"></param>
  6788. /// <param name="sessionKey"></param>
  6789. /// <param name="settingcode">设置编码</param>
  6790. /// <returns></returns>
  6791. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  6792. {
  6793. ActionResult actionResult = new ActionResult();
  6794. try
  6795. {
  6796. // 验证请求头信息
  6797. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6798. // 验证失败
  6799. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6800. {
  6801. return actionResult;
  6802. }
  6803. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6804. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  6805. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6806. actionResult.Status = (int)Constant.PDAResult.Success;
  6807. }
  6808. catch (Exception ex)
  6809. {
  6810. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6811. OutputLog.TraceLog(LogPriority.Error,
  6812. this.ToString(),
  6813. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6814. ex.ToString(),
  6815. LocalPath.LogExePath);
  6816. actionResult.Status = (int)Constant.PDAResult.Exception;
  6817. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6818. }
  6819. return actionResult;
  6820. }
  6821. /// <summary>
  6822. /// 校验条码是否允许撤销,如果不允许提示错误消息
  6823. /// </summary>
  6824. /// <param name="accountCode"></param>
  6825. /// <param name="userCode"></param>
  6826. /// <param name="userPassword"></param>
  6827. /// <param name="sessionKey"></param>
  6828. /// <param name="orgTime">原时间</param>
  6829. /// <param name="days">允许撤销天数</param>
  6830. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  6831. /// <returns></returns>
  6832. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  6833. {
  6834. ActionResult actionResult = new ActionResult();
  6835. try
  6836. {
  6837. // 验证请求头信息
  6838. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6839. // 验证失败
  6840. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6841. {
  6842. return actionResult;
  6843. }
  6844. string[] subOrgTime = orgTime.Split('-');
  6845. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  6846. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6847. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  6848. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6849. if (Convert.ToInt32(resultEntity.Result) < 0)
  6850. {
  6851. actionResult.Status = (int)Constant.PDAResult.Fail;
  6852. }
  6853. else
  6854. {
  6855. actionResult.Status = (int)Constant.PDAResult.Success;
  6856. }
  6857. actionResult.Message = resultEntity.Message;
  6858. }
  6859. catch (Exception ex)
  6860. {
  6861. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6862. OutputLog.TraceLog(LogPriority.Error,
  6863. this.ToString(),
  6864. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6865. ex.ToString(),
  6866. LocalPath.LogExePath);
  6867. actionResult.Status = (int)Constant.PDAResult.Exception;
  6868. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6869. }
  6870. return actionResult;
  6871. }
  6872. /// <summary>
  6873. /// 获取生产订单管理的全部数据
  6874. /// </summary>
  6875. /// <param name="sUserInfo"></param>
  6876. /// <returns></returns>
  6877. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  6878. {
  6879. ActionResult actionResult = new ActionResult();
  6880. try
  6881. {
  6882. // 验证请求头信息
  6883. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6884. // 验证失败
  6885. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6886. {
  6887. return actionResult;
  6888. }
  6889. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6890. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  6891. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6892. actionResult.Status = (int)Constant.PDAResult.Success;
  6893. }
  6894. catch (Exception ex)
  6895. {
  6896. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6897. OutputLog.TraceLog(LogPriority.Error,
  6898. this.ToString(),
  6899. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6900. ex.ToString(),
  6901. LocalPath.LogExePath);
  6902. actionResult.Status = (int)Constant.PDAResult.Exception;
  6903. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6904. }
  6905. return actionResult;
  6906. }
  6907. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6908. {
  6909. ActionResult actionResult = new ActionResult();
  6910. try
  6911. {
  6912. // 验证请求头信息
  6913. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6914. // 验证失败
  6915. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6916. {
  6917. return actionResult;
  6918. }
  6919. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6920. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  6921. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6922. if (Convert.ToInt32(resultEntity.Result) < 0)
  6923. {
  6924. actionResult.Status = (int)Constant.PDAResult.Fail;
  6925. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  6926. }
  6927. else
  6928. {
  6929. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  6930. actionResult.Status = (int)Constant.PDAResult.Success;
  6931. }
  6932. actionResult.Message = resultEntity.Message;
  6933. }
  6934. catch (Exception ex)
  6935. {
  6936. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6937. OutputLog.TraceLog(LogPriority.Error,
  6938. this.ToString(),
  6939. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6940. ex.ToString(),
  6941. LocalPath.LogExePath);
  6942. actionResult.Status = (int)Constant.PDAResult.Exception;
  6943. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6944. }
  6945. return actionResult;
  6946. }
  6947. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  6948. {
  6949. ActionResult actionResult = new ActionResult();
  6950. try
  6951. {
  6952. // 验证请求头信息
  6953. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6954. // 验证失败
  6955. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6956. {
  6957. return actionResult;
  6958. }
  6959. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6960. () => SystemModuleLogic.GetSystemData(sUserInfo));
  6961. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6962. actionResult.Status = (int)Constant.PDAResult.Success;
  6963. }
  6964. catch (Exception ex)
  6965. {
  6966. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6967. OutputLog.TraceLog(LogPriority.Error,
  6968. this.ToString(),
  6969. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6970. ex.ToString(),
  6971. LocalPath.LogExePath);
  6972. actionResult.Status = (int)Constant.PDAResult.Exception;
  6973. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6974. }
  6975. return actionResult;
  6976. }
  6977. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  6978. {
  6979. ActionResult actionResult = new ActionResult();
  6980. try
  6981. {
  6982. // 验证请求头信息
  6983. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6984. // 验证失败
  6985. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6986. {
  6987. return actionResult;
  6988. }
  6989. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  6990. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6991. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  6992. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6993. if (Convert.ToInt32(resultEntity.Result) < 0)
  6994. {
  6995. actionResult.Status = (int)Constant.PDAResult.Fail;
  6996. }
  6997. else
  6998. {
  6999. actionResult.Status = (int)Constant.PDAResult.Success;
  7000. }
  7001. actionResult.Message = resultEntity.Message;
  7002. }
  7003. catch (Exception ex)
  7004. {
  7005. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7006. OutputLog.TraceLog(LogPriority.Error,
  7007. this.ToString(),
  7008. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7009. ex.ToString(),
  7010. LocalPath.LogExePath);
  7011. actionResult.Status = (int)Constant.PDAResult.Exception;
  7012. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7013. }
  7014. return actionResult;
  7015. }
  7016. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7017. {
  7018. ActionResult actionResult = new ActionResult();
  7019. try
  7020. {
  7021. // 验证请求头信息
  7022. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7023. // 验证失败
  7024. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7025. {
  7026. return actionResult;
  7027. }
  7028. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7029. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7030. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7031. if (Convert.ToInt32(resultEntity.Result) < 0)
  7032. {
  7033. actionResult.Status = (int)Constant.PDAResult.Fail;
  7034. }
  7035. else
  7036. {
  7037. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7038. actionResult.Status = (int)Constant.PDAResult.Success;
  7039. }
  7040. actionResult.Message = resultEntity.Message;
  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 SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  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. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7068. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7069. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7070. if (Convert.ToInt32(resultEntity.Result) < 0)
  7071. {
  7072. actionResult.Status = (int)Constant.PDAResult.Fail;
  7073. }
  7074. else
  7075. {
  7076. actionResult.Status = (int)Constant.PDAResult.Success;
  7077. }
  7078. actionResult.Message = resultEntity.Message;
  7079. }
  7080. catch (Exception ex)
  7081. {
  7082. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7083. OutputLog.TraceLog(LogPriority.Error,
  7084. this.ToString(),
  7085. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7086. ex.ToString(),
  7087. LocalPath.LogExePath);
  7088. actionResult.Status = (int)Constant.PDAResult.Exception;
  7089. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7090. }
  7091. return actionResult;
  7092. }
  7093. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7094. {
  7095. ActionResult actionResult = new ActionResult();
  7096. try
  7097. {
  7098. // 验证请求头信息
  7099. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7100. // 验证失败
  7101. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7102. {
  7103. return actionResult;
  7104. }
  7105. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7106. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7107. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7108. if (Convert.ToInt32(resultEntity.Result) < 0)
  7109. {
  7110. actionResult.Status = (int)Constant.PDAResult.Fail;
  7111. }
  7112. else
  7113. {
  7114. actionResult.Status = (int)Constant.PDAResult.Success;
  7115. }
  7116. actionResult.Message = resultEntity.Message;
  7117. }
  7118. catch (Exception ex)
  7119. {
  7120. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7121. OutputLog.TraceLog(LogPriority.Error,
  7122. this.ToString(),
  7123. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7124. ex.ToString(),
  7125. LocalPath.LogExePath);
  7126. actionResult.Status = (int)Constant.PDAResult.Exception;
  7127. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7128. }
  7129. return actionResult;
  7130. }
  7131. #region PDA条码打印
  7132. /// <summary>
  7133. /// 获取条码打印机
  7134. /// </summary>
  7135. /// <param name="accountCode"></param>
  7136. /// <param name="userCode"></param>
  7137. /// <param name="userPassword"></param>
  7138. /// <param name="sessionKey"></param>
  7139. /// <returns></returns>
  7140. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printType=0)
  7141. {
  7142. ActionResult actionResult = new ActionResult();
  7143. try
  7144. {
  7145. // 验证请求头信息
  7146. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7147. // 验证失败
  7148. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7149. {
  7150. return actionResult;
  7151. }
  7152. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType);
  7153. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7154. actionResult.Status = (int)Constant.PDAResult.Success;
  7155. }
  7156. catch (Exception ex)
  7157. {
  7158. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7159. OutputLog.TraceLog(LogPriority.Error,
  7160. this.ToString(),
  7161. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7162. ex.ToString(),
  7163. LocalPath.LogExePath);
  7164. actionResult.Status = (int)Constant.PDAResult.Exception;
  7165. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7166. }
  7167. return actionResult;
  7168. }
  7169. /// <summary>
  7170. /// 打印条码样式(补打)
  7171. /// </summary>
  7172. /// <param name="accountCode"></param>
  7173. /// <param name="userCode"></param>
  7174. /// <param name="userPassword"></param>
  7175. /// <param name="sessionKey"></param>
  7176. /// <returns></returns>
  7177. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey,
  7178. string barcode, int copies, int printerID, int printWay=2)
  7179. {
  7180. ActionResult actionResult = new ActionResult();
  7181. try
  7182. {
  7183. // 验证请求头信息
  7184. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7185. // 验证失败
  7186. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7187. {
  7188. return actionResult;
  7189. }
  7190. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7191. // copies, printerID, sUserInfo);
  7192. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(barcode,
  7193. copies, printerID, sUserInfo, printWay);
  7194. if (sre.Status != Constant.ServiceResultStatus.Success)
  7195. {
  7196. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7197. actionResult.Message = sre.Message;
  7198. return actionResult;
  7199. }
  7200. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7201. actionResult.Status = (int)Constant.PDAResult.Success;
  7202. }
  7203. catch (Exception ex)
  7204. {
  7205. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7206. OutputLog.TraceLog(LogPriority.Error,
  7207. this.ToString(),
  7208. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7209. ex.ToString(),
  7210. LocalPath.LogExePath);
  7211. actionResult.Status = (int)Constant.PDAResult.Exception;
  7212. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7213. }
  7214. return actionResult;
  7215. }
  7216. #endregion PDA条码打印
  7217. #region 统计报表
  7218. /// <summary>
  7219. /// 成型结算报表
  7220. /// </summary>
  7221. /// <param name="accountCode"></param>
  7222. /// <param name="userCode"></param>
  7223. /// <param name="userPassword"></param>
  7224. /// <param name="sessionKey"></param>
  7225. /// <returns></returns>
  7226. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7227. int currentMonth)
  7228. {
  7229. ActionResult actionResult = new ActionResult();
  7230. try
  7231. {
  7232. // 验证请求头信息
  7233. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7234. // 验证失败
  7235. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7236. {
  7237. return actionResult;
  7238. }
  7239. DateTime date = DateTime.Now;
  7240. if (currentMonth != 1)
  7241. {
  7242. date = date.AddMonths(-1);
  7243. }
  7244. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7245. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7246. if (resultEntity == null || resultEntity.Data == null)
  7247. {
  7248. actionResult.Status = (int)Constant.PDAResult.Fail;
  7249. actionResult.Message = "查询失败";
  7250. return actionResult;
  7251. }
  7252. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7253. {
  7254. actionResult.Status = (int)Constant.PDAResult.Fail;
  7255. actionResult.Message = resultEntity.Message;
  7256. return actionResult;
  7257. }
  7258. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7259. actionResult.Status = (int)Constant.PDAResult.Success;
  7260. }
  7261. catch (Exception ex)
  7262. {
  7263. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7264. OutputLog.TraceLog(LogPriority.Error,
  7265. this.ToString(),
  7266. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7267. ex.ToString(),
  7268. LocalPath.LogExePath);
  7269. actionResult.Status = (int)Constant.PDAResult.Exception;
  7270. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7271. }
  7272. return actionResult;
  7273. }
  7274. #endregion
  7275. #region 设置当期用户默认打印机配置
  7276. /// <summary>
  7277. /// 设置当期用户默认打印机配置
  7278. /// </summary>
  7279. /// <param name="accountCode"></param>
  7280. /// <param name="userCode"></param>
  7281. /// <param name="userPassword"></param>
  7282. /// <param name="sessionKey"></param>
  7283. /// <param name="printerID"></param>
  7284. /// <returns></returns>
  7285. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7286. int printerID)
  7287. {
  7288. ActionResult actionResult = new ActionResult();
  7289. try
  7290. {
  7291. // 验证请求头信息
  7292. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7293. // 验证失败
  7294. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7295. {
  7296. return actionResult;
  7297. }
  7298. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7299. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7300. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7301. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7302. {
  7303. actionResult.Status = (int)Constant.PDAResult.Fail;
  7304. }
  7305. else
  7306. {
  7307. actionResult.Status = (int)Constant.PDAResult.Success;
  7308. }
  7309. actionResult.Message = resultEntity.Message;
  7310. }
  7311. catch (Exception ex)
  7312. {
  7313. OutputLog.TraceLog(LogPriority.Error,
  7314. this.ToString(),
  7315. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7316. ex.ToString(),
  7317. LocalPath.LogExePath);
  7318. actionResult.Status = (int)Constant.PDAResult.Exception;
  7319. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7320. }
  7321. return actionResult;
  7322. }
  7323. /// <summary>
  7324. /// 校验产品条码是否可以进行回收
  7325. /// </summary>
  7326. /// <param name="accountCode">帐套code</param>
  7327. /// <param name="userCode">用户code</param>
  7328. /// <param name="userPassword">用户密码</param>
  7329. /// <param name="sessionKey">本次登陆密钥</param>
  7330. /// <param name="procedureID">工序ID</param>
  7331. /// <param name="barcode">条码</param>
  7332. /// <returns></returns>
  7333. /// <remarks>
  7334. /// 王鑫 2017.7.21 新建
  7335. /// </remarks>
  7336. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7337. {
  7338. ActionResult actionResult = new ActionResult();
  7339. try
  7340. {
  7341. // 验证请求头信息
  7342. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7343. // 验证失败
  7344. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7345. {
  7346. return actionResult;
  7347. }
  7348. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7349. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7350. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7351. {
  7352. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7353. actionResult.Status = (int)Constant.PDAResult.Success;
  7354. }
  7355. else
  7356. {
  7357. actionResult.Status = (int)Constant.PDAResult.Fail;
  7358. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7359. }
  7360. }
  7361. catch (Exception ex)
  7362. {
  7363. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7364. OutputLog.TraceLog(LogPriority.Error,
  7365. this.ToString(),
  7366. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7367. ex.ToString(),
  7368. LocalPath.LogExePath);
  7369. actionResult.Status = (int)Constant.PDAResult.Exception;
  7370. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7371. }
  7372. return actionResult;
  7373. }
  7374. /// <summary>
  7375. /// 获取回收标识
  7376. /// </summary>
  7377. /// <param name="accountCode"></param>
  7378. /// <param name="userCode"></param>
  7379. /// <param name="userPassword"></param>
  7380. /// <param name="sessionKey"></param>
  7381. /// <param name="usercode">工号编码</param>
  7382. /// <returns></returns>
  7383. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7384. {
  7385. ActionResult actionResult = new ActionResult();
  7386. try
  7387. {
  7388. // 验证请求头信息
  7389. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7390. // 验证失败
  7391. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7392. {
  7393. return actionResult;
  7394. }
  7395. int returnValue = ServiceInvoker.Invoke<int>(this,
  7396. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7397. actionResult.Result = JsonHelper.ToJson(returnValue);
  7398. actionResult.Status = (int)Constant.PDAResult.Success;
  7399. }
  7400. catch (Exception ex)
  7401. {
  7402. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7403. OutputLog.TraceLog(LogPriority.Error,
  7404. this.ToString(),
  7405. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7406. ex.ToString(),
  7407. LocalPath.LogExePath);
  7408. actionResult.Status = (int)Constant.PDAResult.Exception;
  7409. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7410. }
  7411. return actionResult;
  7412. }
  7413. #endregion
  7414. #region 注浆盘点
  7415. /// <summary>
  7416. /// 获取注浆盘点单列表
  7417. /// </summary>
  7418. /// <param name="sUserInfo"></param>
  7419. /// <returns></returns>
  7420. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7421. {
  7422. ActionResult actionResult = new ActionResult();
  7423. try
  7424. {
  7425. // 验证请求头信息
  7426. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7427. // 验证失败
  7428. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7429. {
  7430. return actionResult;
  7431. }
  7432. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7433. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7434. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7435. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7436. actionResult.Result = JsonHelper.ToJson(ds);
  7437. actionResult.Status = (int)Constant.PDAResult.Success;
  7438. }
  7439. catch (Exception ex)
  7440. {
  7441. string json = JsonHelper.ToJson(entity);
  7442. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7443. OutputLog.TraceLog(LogPriority.Error,
  7444. this.ToString(),
  7445. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7446. ex.ToString(),
  7447. LocalPath.LogExePath);
  7448. actionResult.Status = (int)Constant.PDAResult.Exception;
  7449. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7450. }
  7451. return actionResult;
  7452. }
  7453. /// <summary>
  7454. /// 进行盘点操作
  7455. /// </summary>
  7456. /// <param name="accountCode"></param>
  7457. /// <param name="userCode"></param>
  7458. /// <param name="userPassword"></param>
  7459. /// <param name="sessionKey"></param>
  7460. /// <param name="InCheckedID">盘点单ID</param>
  7461. /// <param name="BarCode">产品条码</param>
  7462. /// <returns></returns>
  7463. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7464. {
  7465. ActionResult actionResult = new ActionResult();
  7466. try
  7467. {
  7468. // 验证请求头信息
  7469. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7470. // 验证失败
  7471. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7472. {
  7473. return actionResult;
  7474. }
  7475. ClientRequestEntity cre = new ClientRequestEntity();
  7476. cre.Properties["CheckedID"] = CheckedID;
  7477. cre.Properties["Barcode"] = BarCode;
  7478. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7479. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7480. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7481. {
  7482. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7483. actionResult.Status = (int)Constant.PDAResult.Success;
  7484. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7485. }
  7486. else
  7487. {
  7488. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7489. actionResult.Status = (int)Constant.PDAResult.Fail;
  7490. actionResult.Message = returnValue.Message;
  7491. }
  7492. }
  7493. catch (Exception ex)
  7494. {
  7495. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7496. OutputLog.TraceLog(LogPriority.Error,
  7497. this.ToString(),
  7498. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7499. ex.ToString(),
  7500. LocalPath.LogExePath);
  7501. actionResult.Status = (int)Constant.PDAResult.Exception;
  7502. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7503. }
  7504. return actionResult;
  7505. }
  7506. /// <summary>
  7507. /// 获取盘点单明细
  7508. /// </summary>
  7509. /// <param name="sUserInfo"></param>
  7510. /// <returns></returns>
  7511. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7512. {
  7513. ActionResult actionResult = new ActionResult();
  7514. try
  7515. {
  7516. // 验证请求头信息
  7517. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7518. // 验证失败
  7519. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7520. {
  7521. return actionResult;
  7522. }
  7523. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7524. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  7525. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  7526. actionResult.Result = JsonHelper.ToJson(ds);
  7527. actionResult.Status = (int)Constant.PDAResult.Success;
  7528. }
  7529. catch (Exception ex)
  7530. {
  7531. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7532. OutputLog.TraceLog(LogPriority.Error,
  7533. this.ToString(),
  7534. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7535. ex.ToString(),
  7536. LocalPath.LogExePath);
  7537. actionResult.Status = (int)Constant.PDAResult.Exception;
  7538. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7539. }
  7540. return actionResult;
  7541. }
  7542. #endregion
  7543. #region 模具盘点
  7544. /// <summary>
  7545. /// 获取模具盘点单列表
  7546. /// </summary>
  7547. /// <param name="sUserInfo"></param>
  7548. /// <returns></returns>
  7549. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7550. {
  7551. ActionResult actionResult = new ActionResult();
  7552. try
  7553. {
  7554. // 验证请求头信息
  7555. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7556. // 验证失败
  7557. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7558. {
  7559. return actionResult;
  7560. }
  7561. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7562. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7563. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7564. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  7565. actionResult.Result = JsonHelper.ToJson(ds);
  7566. actionResult.Status = (int)Constant.PDAResult.Success;
  7567. }
  7568. catch (Exception ex)
  7569. {
  7570. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7571. OutputLog.TraceLog(LogPriority.Error,
  7572. this.ToString(),
  7573. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7574. ex.ToString(),
  7575. LocalPath.LogExePath);
  7576. actionResult.Status = (int)Constant.PDAResult.Exception;
  7577. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7578. }
  7579. return actionResult;
  7580. }
  7581. /// <summary>
  7582. /// 进行盘点操作
  7583. /// </summary>
  7584. /// <param name="accountCode"></param>
  7585. /// <param name="userCode"></param>
  7586. /// <param name="userPassword"></param>
  7587. /// <param name="sessionKey"></param>
  7588. /// <param name="InCheckedID">盘点单ID</param>
  7589. /// <param name="BarCode">产品条码</param>
  7590. /// <returns></returns>
  7591. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7592. {
  7593. ActionResult actionResult = new ActionResult();
  7594. try
  7595. {
  7596. // 验证请求头信息
  7597. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7598. // 验证失败
  7599. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7600. {
  7601. return actionResult;
  7602. }
  7603. ClientRequestEntity cre = new ClientRequestEntity();
  7604. cre.Properties["CheckedID"] = CheckedID;
  7605. cre.Properties["Barcode"] = BarCode;
  7606. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7607. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  7608. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7609. {
  7610. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7611. actionResult.Status = (int)Constant.PDAResult.Success;
  7612. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7613. }
  7614. else
  7615. {
  7616. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7617. actionResult.Status = (int)Constant.PDAResult.Fail;
  7618. actionResult.Message = returnValue.Message;
  7619. }
  7620. }
  7621. catch (Exception ex)
  7622. {
  7623. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7624. OutputLog.TraceLog(LogPriority.Error,
  7625. this.ToString(),
  7626. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7627. ex.ToString(),
  7628. LocalPath.LogExePath);
  7629. actionResult.Status = (int)Constant.PDAResult.Exception;
  7630. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7631. }
  7632. return actionResult;
  7633. }
  7634. /// <summary>
  7635. /// 获取盘点单明细
  7636. /// </summary>
  7637. /// <param name="sUserInfo"></param>
  7638. /// <returns></returns>
  7639. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7640. {
  7641. ActionResult actionResult = new ActionResult();
  7642. try
  7643. {
  7644. // 验证请求头信息
  7645. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7646. // 验证失败
  7647. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7648. {
  7649. return actionResult;
  7650. }
  7651. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7652. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  7653. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  7654. actionResult.Result = JsonHelper.ToJson(ds);
  7655. actionResult.Status = (int)Constant.PDAResult.Success;
  7656. }
  7657. catch (Exception ex)
  7658. {
  7659. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7660. OutputLog.TraceLog(LogPriority.Error,
  7661. this.ToString(),
  7662. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7663. ex.ToString(),
  7664. LocalPath.LogExePath);
  7665. actionResult.Status = (int)Constant.PDAResult.Exception;
  7666. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7667. }
  7668. return actionResult;
  7669. }
  7670. #endregion
  7671. #region 通用接口
  7672. /// <summary>
  7673. /// PDA调用通用接口
  7674. /// </summary>
  7675. /// <param name="accountCode"></param>
  7676. /// <param name="userCode"></param>
  7677. /// <param name="userPassword"></param>
  7678. /// <param name="sessionKey"></param>
  7679. /// <param name="module"></param>
  7680. /// <param name="action"></param>
  7681. /// <param name="data"></param>
  7682. /// <returns></returns>
  7683. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  7684. string module, string action, string jsonData)
  7685. {
  7686. ActionResult actionResult = null;
  7687. try
  7688. {
  7689. // 验证请求头信息
  7690. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7691. // 验证失败
  7692. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7693. {
  7694. return actionResult;
  7695. }
  7696. actionResult.Status = (int)Constant.PDAResult.Fail;
  7697. Dictionary<string, object> data = null;
  7698. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  7699. {
  7700. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  7701. }
  7702. #region PDA报表
  7703. if (module == "Report")
  7704. {
  7705. // 成型月度结算
  7706. if (action == "GetGroutingSettlementInfo")
  7707. {
  7708. DateTime month = DateTime.Now;
  7709. month = new DateTime(month.Year, month.Month, 1);
  7710. //month = new DateTime(2017, 6, 1);
  7711. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7712. if (currentMonth != 1)
  7713. {
  7714. month = month.AddMonths(-1);
  7715. }
  7716. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  7717. if (sre.Status == Constant.ServiceResultStatus.Success)
  7718. {
  7719. actionResult.Status = (int)Constant.PDAResult.Success;
  7720. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7721. }
  7722. else
  7723. {
  7724. actionResult.Status = (int)Constant.PDAResult.Fail;
  7725. actionResult.Message = sre.Message;
  7726. }
  7727. return actionResult;
  7728. }
  7729. // 成型月度结算-明细
  7730. if (action == "GetGroutingSettlementDetail")
  7731. {
  7732. DateTime month = DateTime.Now;
  7733. month = new DateTime(month.Year, month.Month, 1);
  7734. //month = new DateTime(2017, 6, 1);
  7735. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7736. if (currentMonth != 1)
  7737. {
  7738. month = month.AddMonths(-1);
  7739. }
  7740. string goodsCode = data["GoodsCode"].ToString();
  7741. string detailDate = data["DetailDate"].ToString();
  7742. DateTime? date = null;
  7743. if (detailDate != "合计")
  7744. {
  7745. date = DateTime.Parse(detailDate);
  7746. }
  7747. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  7748. if (sre.Status == Constant.ServiceResultStatus.Success)
  7749. {
  7750. actionResult.Status = (int)Constant.PDAResult.Success;
  7751. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7752. }
  7753. else
  7754. {
  7755. actionResult.Status = (int)Constant.PDAResult.Fail;
  7756. actionResult.Message = sre.Message;
  7757. }
  7758. return actionResult;
  7759. }
  7760. // 产成品交接汇总
  7761. if (action == "GetFinishedProductHandoverSum")
  7762. {
  7763. DateTime date = DateTime.Parse(data["date"].ToString());
  7764. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  7765. data["goodscode"] as string, sUserInfo);
  7766. if (sre.Status == Constant.ServiceResultStatus.Success)
  7767. {
  7768. actionResult.Status = (int)Constant.PDAResult.Success;
  7769. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7770. }
  7771. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  7772. {
  7773. actionResult.Status = (int)Constant.PDAResult.Success;
  7774. }
  7775. else
  7776. {
  7777. actionResult.Status = (int)Constant.PDAResult.Fail;
  7778. actionResult.Message = sre.Message;
  7779. }
  7780. return actionResult;
  7781. }
  7782. //xuwei add 2019-10-21
  7783. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  7784. if (action == "GetSemiReworkDayCount")
  7785. {
  7786. //不指定参数查询当天
  7787. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  7788. //dateStr = "2019-10-17";
  7789. //指定参数查询特定日期
  7790. if(data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  7791. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  7792. if (sre.Status == Constant.ServiceResultStatus.Success)
  7793. {
  7794. actionResult.Status = (int)Constant.PDAResult.Success;
  7795. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7796. }
  7797. else
  7798. {
  7799. actionResult.Status = (int)Constant.PDAResult.Fail;
  7800. actionResult.Message = sre.Message;
  7801. }
  7802. return actionResult;
  7803. }
  7804. //xuwe end
  7805. return actionResult;
  7806. }
  7807. #endregion
  7808. #region 模具管理
  7809. if (module == "PC_Mould")
  7810. {
  7811. #region 模具新建画面数据初始化
  7812. if (action == "GetMouldAddInit")
  7813. {
  7814. ClientRequestEntity cre = new ClientRequestEntity();
  7815. cre.Properties["MouldID"] = 0;
  7816. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  7817. if (sre.Status == Constant.ServiceResultStatus.Success)
  7818. {
  7819. actionResult.Status = (int)Constant.PDAResult.Success;
  7820. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7821. }
  7822. else
  7823. {
  7824. actionResult.Status = (int)Constant.PDAResult.Fail;
  7825. actionResult.Message = sre.Message;
  7826. }
  7827. return actionResult;
  7828. }
  7829. #endregion
  7830. #region 验证模具产品型号
  7831. if (action == "CheckGoodsCodeOnMould")
  7832. {
  7833. ClientRequestEntity cre = new ClientRequestEntity();
  7834. cre.Properties["GoodsCode"] = data["GoodsCode"];
  7835. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  7836. if (sre.Status == Constant.ServiceResultStatus.Success &&
  7837. sre.Data.Tables[0].Rows.Count > 0)
  7838. {
  7839. actionResult.Status = (int)Constant.PDAResult.Success;
  7840. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7841. }
  7842. else
  7843. {
  7844. actionResult.Status = (int)Constant.PDAResult.Fail;
  7845. actionResult.Message = "无效产品型号";
  7846. }
  7847. return actionResult;
  7848. }
  7849. #endregion
  7850. #region 验证模具生产工号
  7851. if (action == "CheckUserCodeOnMould")
  7852. {
  7853. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  7854. if (sre != null && sre.Rows.Count > 0)
  7855. {
  7856. actionResult.Status = (int)Constant.PDAResult.Success;
  7857. actionResult.Result = JsonHelper.ToJson(sre);
  7858. }
  7859. else
  7860. {
  7861. actionResult.Status = (int)Constant.PDAResult.Fail;
  7862. actionResult.Message = "无效生产工号";
  7863. }
  7864. return actionResult;
  7865. }
  7866. #endregion
  7867. #region 新建保存
  7868. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  7869. {
  7870. ClientRequestEntity cre = new ClientRequestEntity();
  7871. foreach (string item in data.Keys)
  7872. {
  7873. if (item == "ProductionDate")
  7874. {
  7875. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  7876. }
  7877. else
  7878. {
  7879. cre.Properties.Add(item, data[item]);
  7880. }
  7881. }
  7882. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  7883. if (sre.Status == Constant.ServiceResultStatus.Success)
  7884. {
  7885. actionResult.Status = (int)Constant.PDAResult.Success;
  7886. }
  7887. else
  7888. {
  7889. actionResult.Status = (int)Constant.PDAResult.Fail;
  7890. actionResult.Result = sre.OtherStatus;
  7891. actionResult.Message = sre.Message;
  7892. }
  7893. return actionResult;
  7894. }
  7895. #endregion
  7896. #region 模具编辑画面数据初始化
  7897. if (action == "GetMouldEditInfo")
  7898. {
  7899. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  7900. if (sre != null && sre.Rows.Count > 0)
  7901. {
  7902. actionResult.Status = (int)Constant.PDAResult.Success;
  7903. actionResult.Result = JsonHelper.ToJson(sre);
  7904. }
  7905. else
  7906. {
  7907. actionResult.Status = (int)Constant.PDAResult.Fail;
  7908. actionResult.Message = "无效模具条码";
  7909. }
  7910. return actionResult;
  7911. }
  7912. #endregion
  7913. #region 模具操作-画面初始化
  7914. if (action == "GetMouldOperationInit")
  7915. {
  7916. ClientRequestEntity cre = new ClientRequestEntity();
  7917. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  7918. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  7919. if (sre.Status == Constant.ServiceResultStatus.Success)
  7920. {
  7921. actionResult.Status = (int)Constant.PDAResult.Success;
  7922. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7923. }
  7924. else
  7925. {
  7926. actionResult.Status = (int)Constant.PDAResult.Fail;
  7927. actionResult.Result = sre.OtherStatus;
  7928. actionResult.Message = sre.Message;
  7929. }
  7930. return actionResult;
  7931. }
  7932. #endregion
  7933. #region 模具操作-验证模具条码
  7934. if (action == "CheckMouldBarcode")
  7935. {
  7936. ClientRequestEntity cre = new ClientRequestEntity();
  7937. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  7938. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  7939. if (sre.Status == Constant.ServiceResultStatus.Success)
  7940. {
  7941. if (sre.Data.Tables[0].Rows.Count == 0)
  7942. {
  7943. actionResult.Status = (int)Constant.PDAResult.Fail;
  7944. actionResult.Result = -1;
  7945. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  7946. return actionResult;
  7947. }
  7948. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  7949. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  7950. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  7951. #region 报损
  7952. if (mouldOperationType == 2)
  7953. {
  7954. if (mouldStatusID == 1 || mouldStatusID == 3)
  7955. {
  7956. actionResult.Status = (int)Constant.PDAResult.Success;
  7957. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7958. }
  7959. else
  7960. {
  7961. actionResult.Status = (int)Constant.PDAResult.Fail;
  7962. actionResult.Result = -2;
  7963. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  7964. }
  7965. return actionResult;
  7966. }
  7967. #endregion
  7968. #region 撤销
  7969. if (mouldOperationType == 3)
  7970. {
  7971. if (mouldStatusID == 4)
  7972. {
  7973. actionResult.Status = (int)Constant.PDAResult.Success;
  7974. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7975. }
  7976. else
  7977. {
  7978. actionResult.Status = (int)Constant.PDAResult.Fail;
  7979. actionResult.Result = -2;
  7980. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  7981. }
  7982. return actionResult;
  7983. }
  7984. #endregion
  7985. #region 领用
  7986. if (mouldOperationType == 4)
  7987. {
  7988. if (mouldStatusID == 1)
  7989. {
  7990. actionResult.Status = (int)Constant.PDAResult.Success;
  7991. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7992. }
  7993. else
  7994. {
  7995. actionResult.Status = (int)Constant.PDAResult.Fail;
  7996. actionResult.Result = -2;
  7997. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  7998. }
  7999. return actionResult;
  8000. }
  8001. #endregion
  8002. #region 回收
  8003. if (mouldOperationType == 5)
  8004. {
  8005. if (mouldStatusID == 3)
  8006. {
  8007. actionResult.Status = (int)Constant.PDAResult.Success;
  8008. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8009. }
  8010. else
  8011. {
  8012. actionResult.Status = (int)Constant.PDAResult.Fail;
  8013. actionResult.Result = -2;
  8014. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  8015. }
  8016. return actionResult;
  8017. }
  8018. #endregion
  8019. #region 变更型号
  8020. if (mouldOperationType == -1)
  8021. {
  8022. if (mouldStatusID != 4)
  8023. {
  8024. actionResult.Status = (int)Constant.PDAResult.Success;
  8025. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8026. }
  8027. else
  8028. {
  8029. actionResult.Status = (int)Constant.PDAResult.Fail;
  8030. actionResult.Result = -2;
  8031. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  8032. }
  8033. return actionResult;
  8034. }
  8035. #endregion
  8036. #region 替换条码
  8037. if (mouldOperationType == -2)
  8038. {
  8039. actionResult.Status = (int)Constant.PDAResult.Success;
  8040. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8041. return actionResult;
  8042. }
  8043. #endregion
  8044. return actionResult;
  8045. }
  8046. }
  8047. #endregion
  8048. #region 模具操作-保存
  8049. if (action == "SetMouldOperation")
  8050. {
  8051. ClientRequestEntity cre = new ClientRequestEntity();
  8052. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8053. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8054. cre.Properties["Remarks"] = data["Remarks"];
  8055. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8056. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8057. {
  8058. cre.Properties["GoodsID"] = data["GoodsID"];
  8059. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8060. }
  8061. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8062. {
  8063. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8064. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8065. }
  8066. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8067. if (sre.Status == Constant.ServiceResultStatus.Success)
  8068. {
  8069. actionResult.Status = (int)Constant.PDAResult.Success;
  8070. }
  8071. else
  8072. {
  8073. actionResult.Status = (int)Constant.PDAResult.Fail;
  8074. }
  8075. return actionResult;
  8076. }
  8077. #endregion
  8078. #region 模具操作-替换条码
  8079. if (action == "ChangedMouldBarcode")
  8080. {
  8081. ClientRequestEntity cre = new ClientRequestEntity();
  8082. cre.Properties["MouldID"] = data["MouldID"];
  8083. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8084. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8085. cre.Properties["Remarks"] = data["Remarks"];
  8086. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8087. if (sre.Status == Constant.ServiceResultStatus.Success)
  8088. {
  8089. actionResult.Status = (int)Constant.PDAResult.Success;
  8090. }
  8091. else
  8092. {
  8093. actionResult.Status = (int)Constant.PDAResult.Fail;
  8094. actionResult.Result = sre.OtherStatus;
  8095. actionResult.Message = sre.Message;
  8096. }
  8097. return actionResult;
  8098. }
  8099. #endregion
  8100. #region 模具跟踪表
  8101. if (action == "GetMoldTracking")
  8102. {
  8103. ClientRequestEntity cre = new ClientRequestEntity();
  8104. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8105. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8106. if (sre.Status == Constant.ServiceResultStatus.Success)
  8107. {
  8108. actionResult.Status = (int)Constant.PDAResult.Success;
  8109. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8110. }
  8111. else
  8112. {
  8113. actionResult.Status = (int)Constant.PDAResult.Fail;
  8114. actionResult.Message = "此模具条码不存在";
  8115. }
  8116. return actionResult;
  8117. }
  8118. #endregion
  8119. return actionResult;
  8120. }
  8121. #endregion
  8122. #region 成型线模具管理
  8123. if (module == "PC_GroutingLineMould")
  8124. {
  8125. #region 获取当前用户成型线模具管理权限
  8126. if (action == "GetGMouldStatusRight")
  8127. {
  8128. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8129. actionResult.Status = (int)Constant.PDAResult.Success;
  8130. if (right != null && right.Rows.Count > 0)
  8131. {
  8132. actionResult.Result = JsonHelper.ToJson(right);
  8133. }
  8134. return actionResult;
  8135. }
  8136. #endregion
  8137. #region 获取成型线状态等信息,和成型模具信息
  8138. if (action == "GetGroutingLineMould")
  8139. {
  8140. int? groutingLineID = null;
  8141. string groutingLineCode = null;
  8142. if (data.ContainsKey("GroutingLineID"))
  8143. {
  8144. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8145. }
  8146. else
  8147. {
  8148. groutingLineCode = data["GroutingLineCode"] + "";
  8149. }
  8150. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8151. if (lineInfo == null)
  8152. {
  8153. actionResult.Status = (int)Constant.PDAResult.Fail;
  8154. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8155. }
  8156. else
  8157. {
  8158. actionResult.Status = (int)Constant.PDAResult.Success;
  8159. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8160. }
  8161. return actionResult;
  8162. }
  8163. #endregion
  8164. #region 模具操作-画面初始化
  8165. if (action == "GetMouldOperationInit")
  8166. {
  8167. ClientRequestEntity cre = new ClientRequestEntity();
  8168. cre.Properties["MouldOperationType"] = 2;
  8169. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8170. if (sre.Status == Constant.ServiceResultStatus.Success)
  8171. {
  8172. actionResult.Status = (int)Constant.PDAResult.Success;
  8173. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8174. }
  8175. else
  8176. {
  8177. actionResult.Status = (int)Constant.PDAResult.Fail;
  8178. actionResult.Result = sre.OtherStatus;
  8179. actionResult.Message = sre.Message;
  8180. }
  8181. return actionResult;
  8182. }
  8183. #endregion
  8184. #region 成型模具操作-画面初始化
  8185. if (action == "GetGroutingMouldOperationInit")
  8186. {
  8187. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8188. if (initData != null && initData.Rows.Count > 0)
  8189. {
  8190. actionResult.Status = (int)Constant.PDAResult.Success;
  8191. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8192. foreach (DataRow item in initData.Rows)
  8193. {
  8194. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8195. }
  8196. actionResult.Result = JsonHelper.ToJson(syssetting);
  8197. }
  8198. else
  8199. {
  8200. actionResult.Status = (int)Constant.PDAResult.Fail;
  8201. }
  8202. return actionResult;
  8203. }
  8204. #endregion
  8205. #region 模具操作-验证模具条码
  8206. if (action == "CheckMouldBarcode")
  8207. {
  8208. ClientRequestEntity cre = new ClientRequestEntity();
  8209. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8210. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8211. if (sre.Status == Constant.ServiceResultStatus.Success)
  8212. {
  8213. if (sre.Data.Tables[0].Rows.Count == 0)
  8214. {
  8215. actionResult.Status = (int)Constant.PDAResult.Fail;
  8216. actionResult.Result = -1;
  8217. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8218. return actionResult;
  8219. }
  8220. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8221. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8222. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8223. #region 上线
  8224. if (mouldOperationType == 6)
  8225. {
  8226. if (mouldStatusID == 1 || mouldStatusID == 3)
  8227. {
  8228. if (data.ContainsKey("GoodsID"))
  8229. {
  8230. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8231. {
  8232. actionResult.Status = (int)Constant.PDAResult.Fail;
  8233. actionResult.Result = -3;
  8234. actionResult.Message =
  8235. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8236. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8237. "】与当前不一致";
  8238. return actionResult;
  8239. }
  8240. }
  8241. actionResult.Status = (int)Constant.PDAResult.Success;
  8242. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8243. }
  8244. else
  8245. {
  8246. actionResult.Status = (int)Constant.PDAResult.Fail;
  8247. actionResult.Result = -2;
  8248. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8249. }
  8250. return actionResult;
  8251. }
  8252. #endregion
  8253. return actionResult;
  8254. }
  8255. }
  8256. #endregion
  8257. #region 停用
  8258. if (action == "StopGroutingLineDetail")
  8259. {
  8260. if (data == null || !data.ContainsKey("Details"))
  8261. {
  8262. actionResult.Status = (int)Constant.PDAResult.Fail;
  8263. actionResult.Message = "参数错误";
  8264. return actionResult;
  8265. }
  8266. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8267. DataTable gTable = new DataTable();
  8268. gTable.Columns.Add("GroutingLineID", typeof(int));
  8269. gTable.Columns.Add("GroutingLineCode");
  8270. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8271. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8272. gTable.Columns.Add("GroutingMouldCode");
  8273. gTable.Columns.Add("RecordRemarks");
  8274. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8275. gTable.Columns.Add("MouldID", typeof(int));
  8276. gTable.Columns.Add("MouldCode");
  8277. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8278. string groutingLineCode = data["GroutingLineCode"] + "";
  8279. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8280. foreach (Dictionary<string, object> item in details)
  8281. {
  8282. int? mouldID = null;
  8283. if (item.ContainsKey("MouldID"))
  8284. {
  8285. mouldID = Convert.ToInt32(item["MouldID"]);
  8286. if (mouldID == 0)
  8287. {
  8288. mouldID = null;
  8289. }
  8290. }
  8291. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8292. item["GLineDetailID"], item["GLineDetailCode"],
  8293. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8294. mouldID, item["MouldCode"]);
  8295. }
  8296. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8297. if (result > 0)
  8298. {
  8299. actionResult.Status = (int)Constant.PDAResult.Success;
  8300. }
  8301. else
  8302. {
  8303. actionResult.Status = (int)Constant.PDAResult.Fail;
  8304. actionResult.Result = result;
  8305. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8306. return actionResult;
  8307. }
  8308. return actionResult;
  8309. }
  8310. #endregion
  8311. #region 启用
  8312. if (action == "StartGroutingLineDetail")
  8313. {
  8314. if (data == null || !data.ContainsKey("Details"))
  8315. {
  8316. actionResult.Status = (int)Constant.PDAResult.Fail;
  8317. actionResult.Message = "参数错误";
  8318. return actionResult;
  8319. }
  8320. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8321. DataTable gTable = new DataTable();
  8322. gTable.Columns.Add("GroutingLineID", typeof(int));
  8323. gTable.Columns.Add("GroutingLineCode");
  8324. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8325. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8326. gTable.Columns.Add("GroutingMouldCode");
  8327. gTable.Columns.Add("RecordRemarks");
  8328. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8329. gTable.Columns.Add("MouldID", typeof(int));
  8330. gTable.Columns.Add("MouldCode");
  8331. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8332. string groutingLineCode = data["GroutingLineCode"] + "";
  8333. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8334. foreach (Dictionary<string, object> item in details)
  8335. {
  8336. int? mouldID = null;
  8337. if (item.ContainsKey("MouldID"))
  8338. {
  8339. mouldID = Convert.ToInt32(item["MouldID"]);
  8340. if (mouldID == 0)
  8341. {
  8342. mouldID = null;
  8343. }
  8344. }
  8345. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8346. item["GLineDetailID"], item["GLineDetailCode"],
  8347. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8348. mouldID, item["MouldCode"]);
  8349. }
  8350. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8351. if (result > 0)
  8352. {
  8353. actionResult.Status = (int)Constant.PDAResult.Success;
  8354. }
  8355. else
  8356. {
  8357. actionResult.Status = (int)Constant.PDAResult.Fail;
  8358. actionResult.Result = result;
  8359. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8360. return actionResult;
  8361. }
  8362. return actionResult;
  8363. }
  8364. #endregion
  8365. #region 维修
  8366. if (action == "RepairStartGroutingLineDetail")
  8367. {
  8368. if (data == null || !data.ContainsKey("Details"))
  8369. {
  8370. actionResult.Status = (int)Constant.PDAResult.Fail;
  8371. actionResult.Message = "参数错误";
  8372. return actionResult;
  8373. }
  8374. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8375. DataTable gTable = new DataTable();
  8376. gTable.Columns.Add("GroutingLineID", typeof(int));
  8377. gTable.Columns.Add("GroutingLineCode");
  8378. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8379. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8380. gTable.Columns.Add("GroutingMouldCode");
  8381. gTable.Columns.Add("RecordRemarks");
  8382. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8383. gTable.Columns.Add("MouldID", typeof(int));
  8384. gTable.Columns.Add("MouldCode");
  8385. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8386. string groutingLineCode = data["GroutingLineCode"] + "";
  8387. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8388. foreach (Dictionary<string, object> item in details)
  8389. {
  8390. int? mouldID = null;
  8391. if (item.ContainsKey("MouldID"))
  8392. {
  8393. mouldID = Convert.ToInt32(item["MouldID"]);
  8394. if (mouldID == 0)
  8395. {
  8396. mouldID = null;
  8397. }
  8398. }
  8399. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8400. item["GLineDetailID"], item["GLineDetailCode"],
  8401. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8402. mouldID, item["MouldCode"]);
  8403. }
  8404. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8405. if (result > 0)
  8406. {
  8407. actionResult.Status = (int)Constant.PDAResult.Success;
  8408. }
  8409. else
  8410. {
  8411. actionResult.Status = (int)Constant.PDAResult.Fail;
  8412. actionResult.Result = result;
  8413. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8414. return actionResult;
  8415. }
  8416. return actionResult;
  8417. }
  8418. #endregion
  8419. #region 结束维修
  8420. if (action == "RepairEndGroutingLineDetail")
  8421. {
  8422. if (data == null || !data.ContainsKey("Details"))
  8423. {
  8424. actionResult.Status = (int)Constant.PDAResult.Fail;
  8425. actionResult.Message = "参数错误";
  8426. return actionResult;
  8427. }
  8428. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8429. DataTable gTable = new DataTable();
  8430. gTable.Columns.Add("GroutingLineID", typeof(int));
  8431. gTable.Columns.Add("GroutingLineCode");
  8432. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8433. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8434. gTable.Columns.Add("GroutingMouldCode");
  8435. gTable.Columns.Add("RecordRemarks");
  8436. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8437. gTable.Columns.Add("MouldID", typeof(int));
  8438. gTable.Columns.Add("MouldCode");
  8439. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8440. string groutingLineCode = data["GroutingLineCode"] + "";
  8441. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8442. foreach (Dictionary<string, object> item in details)
  8443. {
  8444. int? mouldID = null;
  8445. if (item.ContainsKey("MouldID"))
  8446. {
  8447. mouldID = Convert.ToInt32(item["MouldID"]);
  8448. if (mouldID == 0)
  8449. {
  8450. mouldID = null;
  8451. }
  8452. }
  8453. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8454. item["GLineDetailID"], item["GLineDetailCode"],
  8455. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8456. mouldID, item["MouldCode"]);
  8457. }
  8458. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8459. if (result > 0)
  8460. {
  8461. actionResult.Status = (int)Constant.PDAResult.Success;
  8462. }
  8463. else
  8464. {
  8465. actionResult.Status = (int)Constant.PDAResult.Fail;
  8466. actionResult.Result = result;
  8467. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8468. return actionResult;
  8469. }
  8470. return actionResult;
  8471. }
  8472. #endregion
  8473. #region 换模
  8474. if (action == "ChangeGMouldStartGroutingLineDetail")
  8475. {
  8476. if (data == null || !data.ContainsKey("Details"))
  8477. {
  8478. actionResult.Status = (int)Constant.PDAResult.Fail;
  8479. actionResult.Message = "参数错误";
  8480. return actionResult;
  8481. }
  8482. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8483. DataTable gTable = new DataTable();
  8484. gTable.Columns.Add("GroutingLineID", typeof(int));
  8485. gTable.Columns.Add("GroutingLineCode");
  8486. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8487. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8488. gTable.Columns.Add("GroutingMouldCode");
  8489. gTable.Columns.Add("RecordRemarks");
  8490. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8491. gTable.Columns.Add("MouldID", typeof(int));
  8492. gTable.Columns.Add("MouldCode");
  8493. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8494. gTable.Columns.Add("MouldStatus", typeof(int));
  8495. gTable.Columns.Add("ScrapReason", typeof(int));
  8496. gTable.Columns.Add("ScrapResponsibility");
  8497. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8498. string groutingLineCode = data["GroutingLineCode"] + "";
  8499. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8500. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8501. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8502. string scrapResponsibility = data["ScrapRemarks"] + "";
  8503. foreach (Dictionary<string, object> item in details)
  8504. {
  8505. int? mouldID = null;
  8506. if (item.ContainsKey("MouldID"))
  8507. {
  8508. mouldID = Convert.ToInt32(item["MouldID"]);
  8509. if (mouldID == 0)
  8510. {
  8511. mouldID = null;
  8512. }
  8513. }
  8514. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8515. item["GLineDetailID"], item["GLineDetailCode"],
  8516. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8517. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8518. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8519. }
  8520. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  8521. if (result > 0)
  8522. {
  8523. actionResult.Status = (int)Constant.PDAResult.Success;
  8524. }
  8525. else
  8526. {
  8527. actionResult.Status = (int)Constant.PDAResult.Fail;
  8528. actionResult.Result = result;
  8529. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8530. return actionResult;
  8531. }
  8532. return actionResult;
  8533. }
  8534. #endregion
  8535. #region 变产
  8536. if (action == "UpdateLineStartGroutingLineDetail")
  8537. {
  8538. if (data == null || !data.ContainsKey("Details"))
  8539. {
  8540. actionResult.Status = (int)Constant.PDAResult.Fail;
  8541. actionResult.Message = "参数错误";
  8542. return actionResult;
  8543. }
  8544. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8545. DataTable gTable = new DataTable();
  8546. gTable.Columns.Add("GroutingLineID", typeof(int));
  8547. gTable.Columns.Add("GroutingLineCode");
  8548. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8549. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8550. gTable.Columns.Add("GroutingMouldCode");
  8551. gTable.Columns.Add("RecordRemarks");
  8552. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8553. gTable.Columns.Add("MouldID", typeof(int));
  8554. gTable.Columns.Add("MouldCode");
  8555. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8556. gTable.Columns.Add("MouldStatus", typeof(int));
  8557. gTable.Columns.Add("ScrapReason", typeof(int));
  8558. gTable.Columns.Add("ScrapResponsibility");
  8559. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8560. string groutingLineCode = data["GroutingLineCode"] + "";
  8561. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8562. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8563. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8564. string scrapResponsibility = data["ScrapRemarks"] + "";
  8565. foreach (Dictionary<string, object> item in details)
  8566. {
  8567. int? mouldID = null;
  8568. if (item.ContainsKey("MouldID"))
  8569. {
  8570. mouldID = Convert.ToInt32(item["MouldID"]);
  8571. if (mouldID == 0)
  8572. {
  8573. mouldID = null;
  8574. }
  8575. }
  8576. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8577. item["GLineDetailID"], item["GLineDetailCode"],
  8578. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8579. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8580. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8581. }
  8582. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  8583. if (result > 0)
  8584. {
  8585. actionResult.Status = (int)Constant.PDAResult.Success;
  8586. }
  8587. else
  8588. {
  8589. actionResult.Status = (int)Constant.PDAResult.Fail;
  8590. actionResult.Result = result;
  8591. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8592. return actionResult;
  8593. }
  8594. return actionResult;
  8595. }
  8596. #endregion
  8597. #region 整线变产
  8598. if (action == "UpdateAllLineStartGroutingLineDetail")
  8599. {
  8600. if (data == null || !data.ContainsKey("Details"))
  8601. {
  8602. actionResult.Status = (int)Constant.PDAResult.Fail;
  8603. actionResult.Message = "参数错误";
  8604. return actionResult;
  8605. }
  8606. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8607. DataTable gTable = new DataTable();
  8608. gTable.Columns.Add("GroutingLineID", typeof(int));
  8609. gTable.Columns.Add("GroutingLineCode");
  8610. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8611. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8612. gTable.Columns.Add("GroutingMouldCode");
  8613. gTable.Columns.Add("RecordRemarks");
  8614. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8615. gTable.Columns.Add("MouldID", typeof(int));
  8616. gTable.Columns.Add("MouldCode");
  8617. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8618. gTable.Columns.Add("MouldStatus", typeof(int));
  8619. gTable.Columns.Add("ScrapReason", typeof(int));
  8620. gTable.Columns.Add("ScrapResponsibility");
  8621. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8622. string groutingLineCode = data["GroutingLineCode"] + "";
  8623. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8624. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8625. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8626. string scrapResponsibility = data["ScrapRemarks"] + "";
  8627. foreach (Dictionary<string, object> item in details)
  8628. {
  8629. int? mouldID = null;
  8630. if (item.ContainsKey("MouldID"))
  8631. {
  8632. mouldID = Convert.ToInt32(item["MouldID"]);
  8633. if (mouldID == 0)
  8634. {
  8635. mouldID = null;
  8636. }
  8637. }
  8638. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8639. item["GLineDetailID"], item["GLineDetailCode"],
  8640. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8641. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8642. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8643. }
  8644. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  8645. if (result > 0)
  8646. {
  8647. actionResult.Status = (int)Constant.PDAResult.Success;
  8648. }
  8649. else
  8650. {
  8651. actionResult.Status = (int)Constant.PDAResult.Fail;
  8652. actionResult.Result = result;
  8653. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8654. return actionResult;
  8655. }
  8656. return actionResult;
  8657. }
  8658. #endregion
  8659. #region 卸模
  8660. if (action == "UnloadGroutingLineDetail")
  8661. {
  8662. if (data == null || !data.ContainsKey("Details"))
  8663. {
  8664. actionResult.Status = (int)Constant.PDAResult.Fail;
  8665. actionResult.Message = "参数错误";
  8666. return actionResult;
  8667. }
  8668. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8669. DataTable gTable = new DataTable();
  8670. gTable.Columns.Add("GroutingLineID", typeof(int));
  8671. gTable.Columns.Add("GroutingLineCode");
  8672. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8673. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8674. gTable.Columns.Add("GroutingMouldCode");
  8675. gTable.Columns.Add("RecordRemarks");
  8676. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8677. gTable.Columns.Add("MouldID", typeof(int));
  8678. gTable.Columns.Add("MouldCode");
  8679. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8680. gTable.Columns.Add("MouldStatus", typeof(int));
  8681. gTable.Columns.Add("ScrapReason", typeof(int));
  8682. gTable.Columns.Add("ScrapResponsibility");
  8683. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8684. string groutingLineCode = data["GroutingLineCode"] + "";
  8685. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8686. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8687. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8688. string scrapResponsibility = data["ScrapRemarks"] + "";
  8689. foreach (Dictionary<string, object> item in details)
  8690. {
  8691. int? mouldID = null;
  8692. if (item.ContainsKey("MouldID"))
  8693. {
  8694. mouldID = Convert.ToInt32(item["MouldID"]);
  8695. if (mouldID == 0)
  8696. {
  8697. mouldID = null;
  8698. }
  8699. }
  8700. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8701. item["GLineDetailID"], item["GLineDetailCode"],
  8702. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8703. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8704. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8705. }
  8706. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  8707. if (result > 0)
  8708. {
  8709. actionResult.Status = (int)Constant.PDAResult.Success;
  8710. }
  8711. else
  8712. {
  8713. actionResult.Status = (int)Constant.PDAResult.Fail;
  8714. actionResult.Result = result;
  8715. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8716. return actionResult;
  8717. }
  8718. return actionResult;
  8719. }
  8720. #endregion
  8721. #region 结束换模
  8722. if (action == "ChangeGMouldEndGroutingLineDetail")
  8723. {
  8724. if (data == null || !data.ContainsKey("Details"))
  8725. {
  8726. actionResult.Status = (int)Constant.PDAResult.Fail;
  8727. actionResult.Message = "参数错误";
  8728. return actionResult;
  8729. }
  8730. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8731. DataTable gTable = new DataTable();
  8732. gTable.Columns.Add("GroutingLineID", typeof(int));
  8733. gTable.Columns.Add("GroutingLineCode");
  8734. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8735. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8736. gTable.Columns.Add("GroutingMouldCode");
  8737. gTable.Columns.Add("RreasonRemarks");
  8738. gTable.Columns.Add("RecordRemarks");
  8739. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8740. gTable.Columns.Add("MouldID", typeof(int));
  8741. gTable.Columns.Add("MouldCode");
  8742. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8743. gTable.Columns.Add("GoodsID", typeof(int));
  8744. gTable.Columns.Add("GoodsCode");
  8745. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8746. gTable.Columns.Add("GroutingCount", typeof(int));
  8747. gTable.Columns.Add("MouldSource");
  8748. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8749. string groutingLineCode = data["GroutingLineCode"] + "";
  8750. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8751. foreach (Dictionary<string, object> item in details)
  8752. {
  8753. int? mouldID = null;
  8754. if (item.ContainsKey("MouldID"))
  8755. {
  8756. mouldID = Convert.ToInt32(item["MouldID"]);
  8757. if (mouldID == 0)
  8758. {
  8759. mouldID = null;
  8760. }
  8761. }
  8762. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8763. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8764. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8765. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8766. item["GoodsID"], item["GoodsCode"],
  8767. item["StandardGroutingCount"], item["GroutingCount"],
  8768. (mouldID == null ? "0" : "1"));
  8769. }
  8770. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  8771. if (result.Status == Constant.ServiceResultStatus.Success)
  8772. {
  8773. actionResult.Status = (int)Constant.PDAResult.Success;
  8774. }
  8775. else if (result.OtherStatus == -100)
  8776. {
  8777. actionResult.Status = (int)Constant.PDAResult.Fail;
  8778. actionResult.Result = -100;
  8779. actionResult.Message = result.Message;
  8780. return actionResult;
  8781. }
  8782. else
  8783. {
  8784. actionResult.Status = (int)Constant.PDAResult.Fail;
  8785. actionResult.Result = -500;
  8786. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8787. return actionResult;
  8788. }
  8789. return actionResult;
  8790. }
  8791. #endregion
  8792. #region 结束变产
  8793. if (action == "UpdateLineEndGroutingLineDetail")
  8794. {
  8795. if (data == null || !data.ContainsKey("Details"))
  8796. {
  8797. actionResult.Status = (int)Constant.PDAResult.Fail;
  8798. actionResult.Message = "参数错误";
  8799. return actionResult;
  8800. }
  8801. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8802. DataTable gTable = new DataTable();
  8803. gTable.Columns.Add("GroutingLineID", typeof(int));
  8804. gTable.Columns.Add("GroutingLineCode");
  8805. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8806. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8807. gTable.Columns.Add("GroutingMouldCode");
  8808. gTable.Columns.Add("RreasonRemarks");
  8809. gTable.Columns.Add("RecordRemarks");
  8810. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8811. gTable.Columns.Add("MouldID", typeof(int));
  8812. gTable.Columns.Add("MouldCode");
  8813. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8814. gTable.Columns.Add("GoodsID", typeof(int));
  8815. gTable.Columns.Add("GoodsCode");
  8816. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8817. gTable.Columns.Add("GroutingCount", typeof(int));
  8818. gTable.Columns.Add("MouldSource");
  8819. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8820. string groutingLineCode = data["GroutingLineCode"] + "";
  8821. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8822. foreach (Dictionary<string, object> item in details)
  8823. {
  8824. int? mouldID = null;
  8825. if (item.ContainsKey("MouldID"))
  8826. {
  8827. mouldID = Convert.ToInt32(item["MouldID"]);
  8828. if (mouldID == 0)
  8829. {
  8830. mouldID = null;
  8831. }
  8832. }
  8833. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8834. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8835. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8836. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8837. item["GoodsID"], item["GoodsCode"],
  8838. item["StandardGroutingCount"], item["GroutingCount"],
  8839. (mouldID == null ? "0" : "1"));
  8840. }
  8841. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  8842. if (result.Status == Constant.ServiceResultStatus.Success)
  8843. {
  8844. actionResult.Status = (int)Constant.PDAResult.Success;
  8845. }
  8846. else if (result.OtherStatus == -100)
  8847. {
  8848. actionResult.Status = (int)Constant.PDAResult.Fail;
  8849. actionResult.Result = -100;
  8850. actionResult.Message = result.Message;
  8851. return actionResult;
  8852. }
  8853. else
  8854. {
  8855. actionResult.Status = (int)Constant.PDAResult.Fail;
  8856. actionResult.Result = -500;
  8857. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8858. return actionResult;
  8859. }
  8860. return actionResult;
  8861. }
  8862. #endregion
  8863. #region 结束整线变产
  8864. if (action == "UpdateAllLineEndGroutingLineDetail")
  8865. {
  8866. if (data == null || !data.ContainsKey("Details"))
  8867. {
  8868. actionResult.Status = (int)Constant.PDAResult.Fail;
  8869. actionResult.Message = "参数错误";
  8870. return actionResult;
  8871. }
  8872. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8873. DataTable gTable = new DataTable();
  8874. gTable.Columns.Add("GroutingLineID", typeof(int));
  8875. gTable.Columns.Add("GroutingLineCode");
  8876. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8877. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8878. gTable.Columns.Add("GroutingMouldCode");
  8879. gTable.Columns.Add("Remarks");
  8880. gTable.Columns.Add("RecordRemarks");
  8881. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8882. gTable.Columns.Add("MouldID", typeof(int));
  8883. gTable.Columns.Add("MouldCode");
  8884. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8885. gTable.Columns.Add("GoodsID", typeof(int));
  8886. gTable.Columns.Add("GoodsCode");
  8887. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8888. gTable.Columns.Add("GroutingCount", typeof(int));
  8889. gTable.Columns.Add("MouldSource");
  8890. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8891. string groutingLineCode = data["GroutingLineCode"] + "";
  8892. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8893. foreach (Dictionary<string, object> item in details)
  8894. {
  8895. int? mouldID = null;
  8896. if (item.ContainsKey("MouldID"))
  8897. {
  8898. mouldID = Convert.ToInt32(item["MouldID"]);
  8899. if (mouldID == 0)
  8900. {
  8901. mouldID = null;
  8902. }
  8903. }
  8904. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8905. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8906. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  8907. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8908. item["GoodsID"], item["GoodsCode"],
  8909. item["StandardGroutingCount"], item["GroutingCount"],
  8910. (mouldID == null ? "0" : "1"));
  8911. }
  8912. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  8913. if (result.Status == Constant.ServiceResultStatus.Success)
  8914. {
  8915. actionResult.Status = (int)Constant.PDAResult.Success;
  8916. }
  8917. else if (result.OtherStatus == -100)
  8918. {
  8919. actionResult.Status = (int)Constant.PDAResult.Fail;
  8920. actionResult.Result = -100;
  8921. actionResult.Message = result.Message;
  8922. return actionResult;
  8923. }
  8924. else
  8925. {
  8926. actionResult.Status = (int)Constant.PDAResult.Fail;
  8927. actionResult.Result = -500;
  8928. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8929. return actionResult;
  8930. }
  8931. return actionResult;
  8932. }
  8933. #endregion
  8934. #region 上模
  8935. if (action == "UpdateGroutingLine_AddMould")
  8936. {
  8937. if (data == null || !data.ContainsKey("Details"))
  8938. {
  8939. actionResult.Status = (int)Constant.PDAResult.Fail;
  8940. actionResult.Message = "参数错误";
  8941. return actionResult;
  8942. }
  8943. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8944. DataTable gTable = new DataTable();
  8945. gTable.Columns.Add("GroutingLineID", typeof(int));
  8946. gTable.Columns.Add("GroutingLineCode");
  8947. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8948. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8949. gTable.Columns.Add("GroutingMouldCode");
  8950. gTable.Columns.Add("Remarks");
  8951. gTable.Columns.Add("RecordRemarks");
  8952. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8953. gTable.Columns.Add("MouldID", typeof(int));
  8954. gTable.Columns.Add("MouldCode");
  8955. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8956. gTable.Columns.Add("GoodsID", typeof(int));
  8957. gTable.Columns.Add("GoodsCode");
  8958. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8959. gTable.Columns.Add("GroutingCount", typeof(int));
  8960. gTable.Columns.Add("MouldSource");
  8961. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8962. string groutingLineCode = data["GroutingLineCode"] + "";
  8963. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8964. foreach (Dictionary<string, object> item in details)
  8965. {
  8966. int? mouldID = null;
  8967. if (item.ContainsKey("MouldID"))
  8968. {
  8969. mouldID = Convert.ToInt32(item["MouldID"]);
  8970. if (mouldID == 0)
  8971. {
  8972. mouldID = null;
  8973. }
  8974. }
  8975. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  8976. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8977. gldID, item["GLineDetailCode"],
  8978. item["DetailRemarks"], item["RecordRemarks"],
  8979. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  8980. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8981. item["GoodsID"], item["GoodsCode"],
  8982. item["StandardGroutingCount"], item["GroutingCount"],
  8983. (mouldID == null ? "0" : "1"));
  8984. }
  8985. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  8986. if (result.Status == Constant.ServiceResultStatus.Success)
  8987. {
  8988. actionResult.Status = (int)Constant.PDAResult.Success;
  8989. }
  8990. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  8991. {
  8992. actionResult.Status = (int)Constant.PDAResult.Fail;
  8993. actionResult.Result = result.OtherStatus;
  8994. actionResult.Message = result.Message;
  8995. return actionResult;
  8996. }
  8997. else
  8998. {
  8999. actionResult.Status = (int)Constant.PDAResult.Fail;
  9000. actionResult.Result = -500;
  9001. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9002. return actionResult;
  9003. }
  9004. return actionResult;
  9005. }
  9006. #endregion
  9007. return actionResult;
  9008. }
  9009. #endregion
  9010. #region 包装装板限制
  9011. if (module == "FinishedLoadingCar")
  9012. {
  9013. if (action == "GetSetting")
  9014. {
  9015. ClientRequestEntity cre = new ClientRequestEntity();
  9016. cre.Properties["GoodsID"] = data["GoodsID"];
  9017. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9018. if (sre.Status == Constant.ServiceResultStatus.Success)
  9019. {
  9020. actionResult.Status = (int)Constant.PDAResult.Success;
  9021. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9022. {
  9023. if (item["settingcode"].ToString() == "S_PM_011")
  9024. {
  9025. cre.Properties["S_PM_011"] = item["settingvalue"];
  9026. }
  9027. else if (item["settingcode"].ToString() == "S_PM_012")
  9028. {
  9029. cre.Properties["S_PM_012"] = item["settingvalue"];
  9030. }
  9031. else if (item["settingcode"].ToString() == "S_PM_013")
  9032. {
  9033. cre.Properties["S_PM_013"] = item["settingvalue"];
  9034. }
  9035. }
  9036. cre.Properties["PlatelitNum"] = sre.Result;
  9037. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9038. }
  9039. else
  9040. {
  9041. actionResult.Status = (int)Constant.PDAResult.Fail;
  9042. actionResult.Message = "";
  9043. }
  9044. return actionResult;
  9045. }
  9046. }
  9047. #endregion
  9048. #region 成型报损
  9049. if (module == "GroutingScrapProduct")
  9050. {
  9051. // 查询注浆日报明细表
  9052. if ("GetGroutingDailyDetail" == action)
  9053. {
  9054. ClientRequestEntity cre = new ClientRequestEntity();
  9055. cre.NameSpace = module;
  9056. cre.Name = action;
  9057. if (!string.IsNullOrEmpty(jsonData))
  9058. {
  9059. cre.Properties["BarCode"] = data["BarCode"];
  9060. }
  9061. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9062. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9063. actionResult.Status = (int)Constant.PDAResult.Success;
  9064. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9065. || sre.Data.Tables[0].Rows.Count == 0)
  9066. {
  9067. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9068. actionResult.Status = (int)Constant.PDAResult.Fail;
  9069. }
  9070. else
  9071. {
  9072. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9073. // 判断是否进行了注浆
  9074. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9075. {
  9076. actionResult.Message = "该产品还未进行注浆!";
  9077. actionResult.Status = (int)Constant.PDAResult.Fail;
  9078. }
  9079. // 判断是否进行了交坯
  9080. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9081. {
  9082. actionResult.Message = "该产品已经交坯!";
  9083. actionResult.Status = (int)Constant.PDAResult.Fail;
  9084. }
  9085. // 判断是否已经报损
  9086. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9087. {
  9088. actionResult.Message = "该产品已经报损!";
  9089. actionResult.Status = (int)Constant.PDAResult.Fail;
  9090. }
  9091. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9092. }
  9093. }
  9094. // 获取成型报损原因
  9095. else if ("GetScrapReasonData" == action)
  9096. {
  9097. ClientRequestEntity cre = new ClientRequestEntity();
  9098. cre.NameSpace = module;
  9099. cre.Name = action;
  9100. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo);
  9101. actionResult.Status = (int)Constant.PDAResult.Success;
  9102. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9103. }
  9104. // 保存成型报损
  9105. else if ("SaveGroutingScrapProduct" == action)
  9106. {
  9107. ClientRequestEntity cre = new ClientRequestEntity();
  9108. cre.NameSpace = module;
  9109. cre.Name = action;
  9110. if (!string.IsNullOrEmpty(jsonData))
  9111. {
  9112. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9113. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9114. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9115. if (dt != null && dt.Rows.Count > 0)
  9116. {
  9117. // 总单信息
  9118. DataRow properties = dt.Rows[0];
  9119. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9120. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9121. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9122. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9123. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9124. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9125. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9126. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9127. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9128. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9129. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9130. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9131. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9132. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9133. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9134. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9135. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9136. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9137. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9138. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9139. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9140. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9141. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9142. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9143. // 责任员工
  9144. cre.Data = new DataSet();
  9145. //DataTable returnTable = returnData.Tables[1].Copy();
  9146. cre.Data.Tables.Add(dtResponsible);
  9147. }
  9148. }
  9149. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9150. if (sre.Status == Constant.ServiceResultStatus.Success)
  9151. {
  9152. actionResult.Status = (int)Constant.PDAResult.Success;
  9153. actionResult.Result = sre.Result;
  9154. }
  9155. else
  9156. {
  9157. actionResult.Status = (int)Constant.PDAResult.Fail;
  9158. actionResult.Result = sre.OtherStatus;
  9159. actionResult.Message = sre.Message;
  9160. }
  9161. }
  9162. // 获取成型报损信息 用于撤销使用
  9163. else if ("GetGroutingScrapProduct" == action)
  9164. {
  9165. ClientRequestEntity cre = new ClientRequestEntity();
  9166. cre.NameSpace = module;
  9167. cre.Name = action;
  9168. if (!string.IsNullOrEmpty(jsonData))
  9169. {
  9170. cre.Properties["BarCode"] = data["BarCode"];
  9171. }
  9172. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9173. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9174. actionResult.Status = (int)Constant.PDAResult.Success;
  9175. }
  9176. // 撤销成型报损
  9177. else if ("ReverseGroutingScrapProduct" == action)
  9178. {
  9179. ClientRequestEntity cre = new ClientRequestEntity();
  9180. cre.NameSpace = module;
  9181. cre.Name = action;
  9182. if (!string.IsNullOrEmpty(jsonData))
  9183. {
  9184. cre.Properties["BarCode"] = data["BarCode"];
  9185. }
  9186. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9187. if (sre.Status == Constant.ServiceResultStatus.Success)
  9188. {
  9189. actionResult.Status = (int)Constant.PDAResult.Success;
  9190. actionResult.Result = sre.Result;
  9191. }
  9192. else
  9193. {
  9194. actionResult.Status = (int)Constant.PDAResult.Fail;
  9195. actionResult.Result = sre.OtherStatus;
  9196. actionResult.Message = sre.Message;
  9197. }
  9198. }
  9199. }
  9200. #endregion
  9201. #region 产品挂起
  9202. if (module == "ProductSuspend")
  9203. {
  9204. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9205. if (action == "GetSuspendProcedure")
  9206. {
  9207. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9208. if (sre.Status == Constant.ServiceResultStatus.Success)
  9209. {
  9210. actionResult.Status = (int)Constant.PDAResult.Success;
  9211. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9212. }
  9213. else
  9214. {
  9215. actionResult.Status = (int)Constant.PDAResult.Fail;
  9216. actionResult.Message = sre.Message;
  9217. }
  9218. return actionResult;
  9219. }
  9220. // 验证挂起条码
  9221. if (action == "CheckSuspendBarcode")
  9222. {
  9223. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9224. if (sre.Status == Constant.ServiceResultStatus.Success)
  9225. {
  9226. actionResult.Status = (int)Constant.PDAResult.Success;
  9227. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9228. }
  9229. else
  9230. {
  9231. actionResult.Status = (int)Constant.PDAResult.Fail;
  9232. actionResult.Message = sre.Message;
  9233. }
  9234. return actionResult;
  9235. }
  9236. // 挂起条码
  9237. if (action == "SaveSuspendProduct")
  9238. {
  9239. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9240. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9241. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9242. if (sre.Status == Constant.ServiceResultStatus.Success)
  9243. {
  9244. actionResult.Status = (int)Constant.PDAResult.Success;
  9245. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9246. }
  9247. else
  9248. {
  9249. actionResult.Status = (int)Constant.PDAResult.Fail;
  9250. actionResult.Message = sre.Message;
  9251. }
  9252. return actionResult;
  9253. }
  9254. // 撤销挂起条码
  9255. if (action == "DeleteSuspendProduct")
  9256. {
  9257. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9258. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9259. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9260. if (sre.Status == Constant.ServiceResultStatus.Success)
  9261. {
  9262. actionResult.Status = (int)Constant.PDAResult.Success;
  9263. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9264. }
  9265. else
  9266. {
  9267. actionResult.Status = (int)Constant.PDAResult.Fail;
  9268. actionResult.Message = sre.Message;
  9269. }
  9270. return actionResult;
  9271. }
  9272. // 查询挂起条码
  9273. if (action == "GetSuspendProduct")
  9274. {
  9275. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9276. if (sre.Status == Constant.ServiceResultStatus.Success)
  9277. {
  9278. if (sre.Data.Tables[0].Rows.Count == 0)
  9279. {
  9280. actionResult.Status = (int)Constant.PDAResult.Fail;
  9281. actionResult.Message = "此条码没有可撤销的挂起信息";
  9282. }
  9283. else
  9284. {
  9285. actionResult.Status = (int)Constant.PDAResult.Success;
  9286. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9287. }
  9288. }
  9289. else
  9290. {
  9291. actionResult.Status = (int)Constant.PDAResult.Fail;
  9292. actionResult.Message = sre.Message;
  9293. }
  9294. return actionResult;
  9295. }
  9296. }
  9297. #endregion
  9298. #region 品保抽查
  9299. if (module == "QASpotCheck")
  9300. {
  9301. if (action == "GetAllQASpotCheck")
  9302. {
  9303. ClientRequestEntity cre = new ClientRequestEntity();
  9304. cre.NameSpace = module;
  9305. cre.Name = action;
  9306. if (data != null && data.Count > 0)
  9307. {
  9308. foreach (string item in data.Keys)
  9309. {
  9310. if (item.StartsWith("checktime"))
  9311. {
  9312. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9313. }
  9314. else
  9315. {
  9316. cre.Properties.Add(item, data[item]);
  9317. }
  9318. }
  9319. }
  9320. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9321. if (sre.Status == Constant.ServiceResultStatus.Success)
  9322. {
  9323. actionResult.Status = (int)Constant.PDAResult.Success;
  9324. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9325. }
  9326. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9327. {
  9328. actionResult.Status = (int)Constant.PDAResult.Success;
  9329. }
  9330. else
  9331. {
  9332. actionResult.Status = (int)Constant.PDAResult.Fail;
  9333. actionResult.Message = sre.Message;
  9334. }
  9335. return actionResult;
  9336. }
  9337. if (action == "AutoSaveQASpotCheck")
  9338. {
  9339. string barcode = data["barcode"] + "";
  9340. string remarks = data["remarks"] + "";
  9341. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9342. if (sre.Status == Constant.ServiceResultStatus.Success)
  9343. {
  9344. actionResult.Status = (int)Constant.PDAResult.Success;
  9345. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9346. }
  9347. else
  9348. {
  9349. actionResult.Status = (int)Constant.PDAResult.Fail;
  9350. actionResult.Message = sre.Message;
  9351. }
  9352. return actionResult;
  9353. }
  9354. if (action == "CheckQASpotCheck")
  9355. {
  9356. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9357. if (sre.Status == Constant.ServiceResultStatus.Success)
  9358. {
  9359. actionResult.Status = (int)Constant.PDAResult.Success;
  9360. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9361. }
  9362. else
  9363. {
  9364. actionResult.Status = (int)Constant.PDAResult.Fail;
  9365. actionResult.Message = sre.Message;
  9366. }
  9367. return actionResult;
  9368. }
  9369. if (action == "SaveQASpotCheck")
  9370. {
  9371. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9372. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9373. if (sre.Status == Constant.ServiceResultStatus.Success)
  9374. {
  9375. actionResult.Status = (int)Constant.PDAResult.Success;
  9376. }
  9377. else
  9378. {
  9379. actionResult.Status = (int)Constant.PDAResult.Fail;
  9380. actionResult.Message = sre.Message;
  9381. }
  9382. return actionResult;
  9383. }
  9384. return null;
  9385. }
  9386. #endregion
  9387. #region 产成品交接
  9388. if (module == "FinishedProduct")
  9389. {
  9390. // 设定商标
  9391. if (action == "GetFinishedBarcode")
  9392. {
  9393. string barcode = data["barcode"].ToString();
  9394. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  9395. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9396. if (Convert.ToInt32(resultEntity.Result) < 0)
  9397. {
  9398. actionResult.Status = (int)Constant.PDAResult.Fail;
  9399. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9400. actionResult.Message = resultEntity.Message;
  9401. }
  9402. else
  9403. {
  9404. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9405. actionResult.Status = (int)Constant.PDAResult.Success;
  9406. actionResult.Message = resultEntity.Message;
  9407. }
  9408. return actionResult;
  9409. }
  9410. if (action == "GetHandoveredBarcode")
  9411. {
  9412. string barcode = data["barcode"].ToString();
  9413. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  9414. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9415. if (Convert.ToInt32(resultEntity.Result) < 0)
  9416. {
  9417. actionResult.Status = (int)Constant.PDAResult.Fail;
  9418. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9419. actionResult.Message = resultEntity.Message;
  9420. }
  9421. else
  9422. {
  9423. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9424. actionResult.Status = (int)Constant.PDAResult.Success;
  9425. actionResult.Message = resultEntity.Message;
  9426. }
  9427. return actionResult;
  9428. }
  9429. if (action == "SetFinishedLogo")
  9430. {
  9431. int logoid = Convert.ToInt32(data["logoid"]);
  9432. string[] barcodes = data["barcodes"].ToString().Split(',');
  9433. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo);
  9434. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9435. if (result < 0)
  9436. {
  9437. actionResult.Status = (int)Constant.PDAResult.Fail;
  9438. }
  9439. else
  9440. {
  9441. actionResult.Status = (int)Constant.PDAResult.Success;
  9442. }
  9443. return actionResult;
  9444. }
  9445. if (action == "SetHandoveredOrder")
  9446. {
  9447. int orderID = Convert.ToInt32(data["orderID"]);
  9448. string[] barcodes = data["barcodes"].ToString().Split(',');
  9449. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  9450. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9451. if (result < 0)
  9452. {
  9453. actionResult.Status = (int)Constant.PDAResult.Fail;
  9454. }
  9455. else
  9456. {
  9457. actionResult.Status = (int)Constant.PDAResult.Success;
  9458. }
  9459. return actionResult;
  9460. }
  9461. }
  9462. #endregion
  9463. #region 产成品装车
  9464. /*
  9465. if (module == "FinishedLoading")
  9466. {
  9467. // 设定商标
  9468. if (action == "GetMaxLoadingNo")
  9469. {
  9470. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  9471. actionResult.Status = (int)Constant.PDAResult.Success;
  9472. actionResult.Result = no;
  9473. return actionResult;
  9474. }
  9475. if (action == "CheckFinishedLaodingBarcode")
  9476. {
  9477. string barcode = data["barcode"].ToString();
  9478. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  9479. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  9480. {
  9481. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9482. actionResult.Status = (int)Constant.PDAResult.Success;
  9483. actionResult.Message = resultEntity.Message;
  9484. }
  9485. else
  9486. {
  9487. actionResult.Status = (int)Constant.PDAResult.Fail;
  9488. actionResult.Result = resultEntity.OtherStatus;
  9489. actionResult.Message = resultEntity.Message;
  9490. }
  9491. return actionResult;
  9492. }
  9493. if (action == "SaveFinishedLoading")
  9494. {
  9495. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  9496. string carLicense = data["carLicense"] + "";
  9497. int palletNum = Convert.ToInt32(data["palletNum"]);
  9498. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  9499. string remarks = data["remarks"] + "";
  9500. Dictionary<string, object>[] details =
  9501. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  9502. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  9503. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  9504. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  9505. if (result.Status == Constant.ServiceResultStatus.Success)
  9506. {
  9507. actionResult.Status = (int)Constant.PDAResult.Success;
  9508. actionResult.Message = result.Message;
  9509. }
  9510. else
  9511. {
  9512. actionResult.Status = (int)Constant.PDAResult.Fail;
  9513. actionResult.Result = result.OtherStatus;
  9514. actionResult.Message = result.Message;
  9515. }
  9516. return actionResult;
  9517. }
  9518. }
  9519. */
  9520. #endregion
  9521. #region 产成品质量改判
  9522. if (module == "FinishedProductTamper")
  9523. {
  9524. // 获取产成品信息及缺陷数据
  9525. if (action == "GetDefectData")
  9526. {
  9527. string barcode = data["barcode"].ToString();
  9528. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  9529. if (sre.Status == Constant.ServiceResultStatus.Success)
  9530. {
  9531. actionResult.Status = (int)Constant.PDAResult.Success;
  9532. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9533. actionResult.Message = sre.Message;
  9534. }
  9535. else
  9536. {
  9537. actionResult.Status = (int)Constant.PDAResult.Fail;
  9538. actionResult.Result = sre.OtherStatus;
  9539. actionResult.Message = sre.Message;
  9540. }
  9541. return actionResult;
  9542. }
  9543. // 获取产成品信息及缺陷数据
  9544. if (action == "SaveDefectData")
  9545. {
  9546. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  9547. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  9548. if (sre.Status == Constant.ServiceResultStatus.Success)
  9549. {
  9550. actionResult.Status = (int)Constant.PDAResult.Success;
  9551. actionResult.Message = sre.Message;
  9552. }
  9553. else
  9554. {
  9555. actionResult.Status = (int)Constant.PDAResult.Fail;
  9556. actionResult.Message = sre.Message;
  9557. }
  9558. return actionResult;
  9559. }
  9560. // 通过条码查出责任工序(成品改判用)
  9561. if (action == "GetDutyProcedureByBarCodeForTamper")
  9562. {
  9563. string barcode = data["barcode"] + "";
  9564. int defectid = int.Parse(data["defectid"] + "");
  9565. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  9566. if (sre.Status == Constant.ServiceResultStatus.Success)
  9567. {
  9568. actionResult.Status = (int)Constant.PDAResult.Success;
  9569. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9570. actionResult.Message = sre.Message;
  9571. }
  9572. else
  9573. {
  9574. actionResult.Status = (int)Constant.PDAResult.Fail;
  9575. actionResult.Result = sre.OtherStatus;
  9576. actionResult.Message = sre.Message;
  9577. }
  9578. return actionResult;
  9579. }
  9580. }
  9581. #endregion
  9582. #region PDA独立功能
  9583. #region 水效标识
  9584. if (module == "WaterEffect")
  9585. {
  9586. // 获取产成品信息及水效标识
  9587. if (action == "GetGoodsByBarCode")
  9588. {
  9589. string barcode = data["barcode"].ToString();
  9590. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  9591. if (sre.Status == Constant.ServiceResultStatus.Success)
  9592. {
  9593. actionResult.Status = (int)Constant.PDAResult.Success;
  9594. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9595. actionResult.Message = sre.Message;
  9596. }
  9597. else
  9598. {
  9599. actionResult.Status = (int)Constant.PDAResult.Fail;
  9600. actionResult.Result = sre.OtherStatus;
  9601. actionResult.Message = sre.Message;
  9602. }
  9603. return actionResult;
  9604. }
  9605. }
  9606. #endregion
  9607. #region 盖板型号
  9608. if (module == "SeatCoverType")
  9609. {
  9610. // 获取产成品信息及水效标识
  9611. if (action == "SendGoodsCodeToPLC")
  9612. {
  9613. string barcode = data["barcode"].ToString();
  9614. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  9615. if (sre == 0)
  9616. {
  9617. actionResult.Status = (int)Constant.PDAResult.Success;
  9618. }
  9619. else
  9620. {
  9621. actionResult.Status = (int)Constant.PDAResult.Fail;
  9622. actionResult.Result = sre;
  9623. switch (sre)
  9624. {
  9625. case 1:
  9626. case 2:
  9627. actionResult.Message = "无效条码";
  9628. break;
  9629. case 3:
  9630. actionResult.Message = "此产品型号没有设置盖板标识码";
  9631. break;
  9632. case 4:
  9633. actionResult.Message = "当前用户没有设置PLC参数";
  9634. break;
  9635. case 5:
  9636. actionResult.Message = "PLC参数设置不全";
  9637. break;
  9638. default:
  9639. actionResult.Message = "PLC通信异常";
  9640. break;
  9641. }
  9642. }
  9643. return actionResult;
  9644. }
  9645. }
  9646. #endregion
  9647. #region PDA PLC 相关功能
  9648. if (module == "PDA_FUN_PLC")
  9649. {
  9650. // PDA扫码发送到PLCServer
  9651. if (action == "SendBarcodeToPLCServer")
  9652. {
  9653. string barcode = data["barcode"].ToString();
  9654. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  9655. if (sre == 0)
  9656. {
  9657. actionResult.Status = (int)Constant.PDAResult.Success;
  9658. }
  9659. else
  9660. {
  9661. actionResult.Status = (int)Constant.PDAResult.Fail;
  9662. actionResult.Result = sre;
  9663. switch (sre)
  9664. {
  9665. case 1:
  9666. case 2:
  9667. actionResult.Message = "无效条码";
  9668. break;
  9669. case 3:
  9670. actionResult.Message = "PLC通信异常";
  9671. break;
  9672. case 4:
  9673. actionResult.Message = "当前用户没有设置PLC参数";
  9674. break;
  9675. case 5:
  9676. actionResult.Message = "PLC参数设置不全";
  9677. break;
  9678. default:
  9679. actionResult.Message = "PLC通信异常";
  9680. break;
  9681. }
  9682. }
  9683. return actionResult;
  9684. }
  9685. }
  9686. #endregion
  9687. #endregion
  9688. #region 半检返修
  9689. if (module == "SemiRework")
  9690. {
  9691. // 验证半检返修条码
  9692. if (action == "CheckSemiReworkBarcode")
  9693. {
  9694. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9695. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  9696. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9697. if (Convert.ToInt32(resultEntity.Result) < 0)
  9698. {
  9699. actionResult.Status = (int)Constant.PDAResult.Fail;
  9700. }
  9701. else
  9702. {
  9703. actionResult.Status = (int)Constant.PDAResult.Success;
  9704. }
  9705. actionResult.Message = resultEntity.Message;
  9706. return actionResult;
  9707. }
  9708. // 可以返修的工序
  9709. if (action == "GetSemiReworkProcedure")
  9710. {
  9711. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9712. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  9713. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9714. actionResult.Status = (int)Constant.PDAResult.Success;
  9715. return actionResult;
  9716. }
  9717. // 根据条码获取经过的工序,用于责任工序
  9718. if (action == "GetSemiReworkPassProcedure")
  9719. {
  9720. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9721. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  9722. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9723. actionResult.Status = (int)Constant.PDAResult.Success;
  9724. return actionResult;
  9725. }
  9726. // 根据所选生产工序(生产数据ID)查询责任员工
  9727. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  9728. {
  9729. int productionDataID = Convert.ToInt32(jsonData);
  9730. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9731. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  9732. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9733. actionResult.Status = (int)Constant.PDAResult.Success;
  9734. return actionResult;
  9735. }
  9736. // 根据所选工号,查出缺陷责任员工
  9737. if (action == "GetSemiReworkDefectStaffByUserID")
  9738. {
  9739. int userID = Convert.ToInt32(jsonData);
  9740. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9741. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  9742. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9743. actionResult.Status = (int)Constant.PDAResult.Success;
  9744. return actionResult;
  9745. }
  9746. // 新建半检返修
  9747. if (action == "AddSemiRework")
  9748. {
  9749. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"]+"");
  9750. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9751. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  9752. actionResult.Result = resultEntity.Result;
  9753. actionResult.Message = resultEntity.Message;
  9754. if (Convert.ToInt32(resultEntity.Result) > 0)
  9755. {
  9756. actionResult.Status = (int)Constant.PDAResult.Success;
  9757. }
  9758. else
  9759. {
  9760. actionResult.Status = (int)Constant.PDAResult.Fail;
  9761. }
  9762. return actionResult;
  9763. }
  9764. // 编辑半检返修
  9765. if (action == "EditSemiRework")
  9766. {
  9767. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9768. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9769. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  9770. actionResult.Result = resultEntity.Result;
  9771. actionResult.Message = resultEntity.Message;
  9772. if (Convert.ToInt32(resultEntity.Result) > 0)
  9773. {
  9774. actionResult.Status = (int)Constant.PDAResult.Success;
  9775. }
  9776. else
  9777. {
  9778. actionResult.Status = (int)Constant.PDAResult.Fail;
  9779. }
  9780. return actionResult;
  9781. }
  9782. // 撤销半检返修
  9783. if (action == "CancelSemiRework")
  9784. {
  9785. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9786. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9787. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  9788. actionResult.Result = resultEntity.Result;
  9789. actionResult.Message = resultEntity.Message;
  9790. if (Convert.ToInt32(resultEntity.Result) > 0)
  9791. {
  9792. actionResult.Status = (int)Constant.PDAResult.Success;
  9793. }
  9794. else
  9795. {
  9796. actionResult.Status = (int)Constant.PDAResult.Fail;
  9797. }
  9798. return actionResult;
  9799. }
  9800. // 获取半检返修数据(PDA编辑用)
  9801. if (action == "GetSemiReworkByID")
  9802. {
  9803. int id = Convert.ToInt32(jsonData);
  9804. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9805. PMModuleLogic.GetSemiReworkByID(id,sUserInfo.UserCode);
  9806. DataTable data1 = resultEntity.Data.Tables[0];
  9807. DataTable data2 = resultEntity.Data.Tables[1];
  9808. DataTable data3 = resultEntity.Data.Tables[2];
  9809. if (data1.Rows.Count == 0)
  9810. {
  9811. actionResult.Status = (int)Constant.PDAResult.Fail;
  9812. actionResult.Message = "半检返修信息不存在";
  9813. return actionResult;
  9814. }
  9815. SemiReworkEntity srEntity = new SemiReworkEntity();
  9816. srEntity.SemiReworkID = id;
  9817. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  9818. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  9819. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  9820. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  9821. foreach (DataRow row2 in data2.Rows)
  9822. {
  9823. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  9824. srEntity.SemiReworkDefects.Add(defectEntity);
  9825. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  9826. defectEntity.SemiReworkID = id;
  9827. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  9828. defectEntity.DefectCode = row2["DefectCode"] + "";
  9829. defectEntity.DefectName = row2["DefectName"] + "";
  9830. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  9831. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  9832. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  9833. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  9834. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  9835. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  9836. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  9837. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  9838. defectEntity.Remarks = row2["Remarks"] + "";
  9839. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  9840. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  9841. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  9842. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  9843. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  9844. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  9845. if (row3s.Length == 0)
  9846. {
  9847. continue;
  9848. }
  9849. foreach (DataRow row3 in row3s)
  9850. {
  9851. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  9852. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  9853. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  9854. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  9855. semiReworkRPS.StaffName = row3["StaffName"] + "";
  9856. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  9857. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  9858. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  9859. semiReworkRPS.UserCode = row3["UserCode"] + "";
  9860. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  9861. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  9862. }
  9863. }
  9864. //xuwei note 总单用于显示,信息较全
  9865. actionResult.Message = JsonHelper.ToJson(data1);
  9866. //xuwei note 总单信息不全,但有明细,用于回传保存
  9867. actionResult.Result = JsonHelper.ToJson(srEntity);
  9868. actionResult.Status = (int)Constant.PDAResult.Success;
  9869. }
  9870. }
  9871. #endregion
  9872. #region 窑车漏扫补件
  9873. if (module == "F_PM_0504")
  9874. {
  9875. // 验证窑车编码是否存在
  9876. if (action == "CheckKilnCar")
  9877. {
  9878. ClientRequestEntity cre = new ClientRequestEntity();
  9879. cre.Properties["kilncarcode"] = data["KilnCarCode"];
  9880. cre.Properties["procedureID"] = data["ProcedureID"];
  9881. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo);
  9882. if (sre.Status == Constant.ServiceResultStatus.Success)
  9883. {
  9884. actionResult.Status = (int)Constant.PDAResult.Success;
  9885. }
  9886. else
  9887. {
  9888. actionResult.Status = (int)Constant.PDAResult.Fail;
  9889. actionResult.Message = sre.Message;
  9890. }
  9891. return actionResult;
  9892. }
  9893. // 验证窑车烧成批次号是否存在 和 是否能补漏扫
  9894. if (action == "CheckKilnCarBatchNo")
  9895. {
  9896. ClientRequestEntity cre = new ClientRequestEntity();
  9897. cre.Properties["KilnID"] = data["KilnID"];
  9898. cre.Properties["KilnCarID"] = data["KilnCarID"];
  9899. cre.Properties["ProcedureID"] = data["ProcedureID"];
  9900. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  9901. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo);
  9902. if (sre.Status == Constant.ServiceResultStatus.Success)
  9903. {
  9904. actionResult.Status = (int)Constant.PDAResult.Success;
  9905. }
  9906. else
  9907. {
  9908. actionResult.Status = (int)Constant.PDAResult.Fail;
  9909. actionResult.Message = sre.Message;
  9910. }
  9911. return actionResult;
  9912. }
  9913. // 窑车漏扫补件
  9914. if (action == "SetKilnCarMissing")
  9915. {
  9916. ClientRequestEntity cre = new ClientRequestEntity();
  9917. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  9918. string carData = data["CarData"] + "";
  9919. DataTable dataTable = JsonHelper.FromJson<DataTable>(carData);
  9920. cre.Data = new DataSet();
  9921. cre.Data.Tables.Add(dataTable);
  9922. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo);
  9923. if (sre.Status == Constant.ServiceResultStatus.Success)
  9924. {
  9925. actionResult.Status = (int)Constant.PDAResult.Success;
  9926. }
  9927. else
  9928. {
  9929. actionResult.Status = (int)Constant.PDAResult.Fail;
  9930. actionResult.Message = sre.Message;
  9931. }
  9932. return actionResult;
  9933. }
  9934. }
  9935. #endregion
  9936. return actionResult;
  9937. }
  9938. catch (Exception ex)
  9939. {
  9940. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  9941. OutputLog.TraceLog(LogPriority.Error,
  9942. this.ToString(),
  9943. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  9944. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  9945. " module:" + module + " action:" + action + " json:" + jsonData,
  9946. ex.ToString(),
  9947. LocalPath.LogExePath);
  9948. actionResult.Status = (int)Constant.PDAResult.Exception;
  9949. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  9950. }
  9951. return actionResult;
  9952. }
  9953. #endregion
  9954. }
  9955. }