PDAModuleService.cs 388 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985
  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. //xuwei add 2020-01-02
  300. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  301. //pdaFunctionChild.IsGlazeChange = 0;
  302. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  303. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  304. pdaFunctionChild.ProcedureID = intProcedureID;
  305. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  306. pdaFunctionChild.ModelType = intModelType;
  307. pdaFunction.PDAFunctions.Add(pdaFunctionChild);
  308. #endregion
  309. InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild);
  310. }
  311. //actionResult.Result = JsonHelper.ToJson(dtPLM);
  312. actionResult.Result = JsonHelper.ToJson(pdaFunction);
  313. actionResult.Status = (int)Constant.PDAResult.Success;
  314. }
  315. catch (Exception ex)
  316. {
  317. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  318. OutputLog.TraceLog(LogPriority.Error,
  319. this.ToString(),
  320. System.Reflection.MethodBase.GetCurrentMethod().Name,
  321. ex.ToString(),
  322. LocalPath.LogExePath);
  323. actionResult.Status = (int)Constant.PDAResult.Exception;
  324. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  325. }
  326. return actionResult;
  327. }
  328. /// <summary>
  329. /// 初始化树形控件
  330. /// </summary>
  331. /// <param name="treeTable">菜单数据表</param>
  332. /// <param name="rows">待处理的菜单集合</param>
  333. /// <param name="node">当前树节点</param>
  334. private void InitTreeView(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions)
  335. {
  336. string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = "
  337. + (pFuncCode.Length + Constant.INT_IS_TWO);
  338. DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC");
  339. //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC");
  340. foreach (DataRow newRow in subRows)
  341. {
  342. #region 插入子节点数据
  343. int? intProcedureID = null;
  344. int? intModelType = null;
  345. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  346. {
  347. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  348. }
  349. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  350. {
  351. intModelType = Convert.ToInt32(newRow["ModelType"]);
  352. }
  353. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  354. //xuwei add 2020-01-02
  355. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  356. //pdaFunctionChild.IsGlazeChange = 0;
  357. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  358. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  359. pdaFunctionChild.ProcedureID = intProcedureID;
  360. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  361. pdaFunctionChild.ModelType = intModelType;
  362. pFunctions.PDAFunctions.Add(pdaFunctionChild);
  363. #endregion
  364. // 递归方法
  365. InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild);
  366. }
  367. }
  368. #endregion
  369. #region 获得工序信息
  370. /// <summary>
  371. /// 获得工序信息
  372. /// </summary>
  373. /// <param name="accountCode">帐套code</param>
  374. /// <param name="userCode">用户code</param>
  375. /// <param name="userPassword">用户密码</param>
  376. /// <param name="sessionKey">本次登陆密钥</param>
  377. /// <param name="procedureID">工序ID</param>
  378. /// <returns></returns>
  379. /// <remarks>
  380. /// 陈冰 2014.09.18 新建
  381. /// </remarks>
  382. public ActionResult GetProcedureByID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  383. {
  384. ActionResult actionResult = new ActionResult();
  385. try
  386. {
  387. // 验证请求头信息
  388. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  389. // 验证失败
  390. if (actionResult.Status != (int)Constant.PDAResult.Success)
  391. {
  392. return actionResult;
  393. }
  394. ProcedureEntity procedureEntity = ServiceInvoker.Invoke<ProcedureEntity>(this,
  395. () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo));
  396. actionResult.Result = JsonHelper.ToJson(procedureEntity);
  397. actionResult.Status = (int)Constant.PDAResult.Success;
  398. }
  399. catch (Exception ex)
  400. {
  401. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  402. OutputLog.TraceLog(LogPriority.Error,
  403. this.ToString(),
  404. System.Reflection.MethodBase.GetCurrentMethod().Name,
  405. ex.ToString(),
  406. LocalPath.LogExePath);
  407. actionResult.Status = (int)Constant.PDAResult.Exception;
  408. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  409. }
  410. return actionResult;
  411. }
  412. #endregion
  413. #region 校验
  414. /// <summary>
  415. /// 校验产品条码是否可以走到该工序
  416. /// </summary>
  417. /// <param name="accountCode">帐套code</param>
  418. /// <param name="userCode">用户code</param>
  419. /// <param name="userPassword">用户密码</param>
  420. /// <param name="sessionKey">本次登陆密钥</param>
  421. /// <param name="procedureID">工序ID</param>
  422. /// <param name="barcode">条码</param>
  423. /// <returns></returns>
  424. /// <remarks>
  425. /// 陈冰 2014.09.18 新建
  426. /// </remarks>
  427. public ActionResult CheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  428. {
  429. ActionResult actionResult = new ActionResult();
  430. try
  431. {
  432. // 验证请求头信息
  433. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  434. // 验证失败
  435. if (actionResult.Status != (int)Constant.PDAResult.Success)
  436. {
  437. return actionResult;
  438. }
  439. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  440. () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo));
  441. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  442. {
  443. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  444. actionResult.Status = (int)Constant.PDAResult.Success;
  445. }
  446. else
  447. {
  448. actionResult.Status = (int)Constant.PDAResult.Fail;
  449. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  450. }
  451. }
  452. catch (Exception ex)
  453. {
  454. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  455. OutputLog.TraceLog(LogPriority.Error,
  456. this.ToString(),
  457. System.Reflection.MethodBase.GetCurrentMethod().Name,
  458. ex.ToString(),
  459. LocalPath.LogExePath);
  460. actionResult.Status = (int)Constant.PDAResult.Exception;
  461. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  462. }
  463. return actionResult;
  464. }
  465. /// <summary>
  466. /// 校验产品条码是否可以进行干补
  467. /// </summary>
  468. /// <param name="accountCode">帐套code</param>
  469. /// <param name="userCode">用户code</param>
  470. /// <param name="userPassword">用户密码</param>
  471. /// <param name="sessionKey">本次登陆密钥</param>
  472. /// <param name="procedureID">工序ID</param>
  473. /// <param name="barcode">条码</param>
  474. /// <returns></returns>
  475. /// <remarks>
  476. /// 袁新成 2015.4.1 新建
  477. /// </remarks>
  478. public ActionResult CheckDryRepairBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  479. {
  480. ActionResult actionResult = new ActionResult();
  481. try
  482. {
  483. // 验证请求头信息
  484. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  485. // 验证失败
  486. if (actionResult.Status != (int)Constant.PDAResult.Success)
  487. {
  488. return actionResult;
  489. }
  490. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  491. () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
  492. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  493. {
  494. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  495. actionResult.Status = (int)Constant.PDAResult.Success;
  496. }
  497. else
  498. {
  499. actionResult.Status = (int)Constant.PDAResult.Fail;
  500. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  501. }
  502. }
  503. catch (Exception ex)
  504. {
  505. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  506. OutputLog.TraceLog(LogPriority.Error,
  507. this.ToString(),
  508. System.Reflection.MethodBase.GetCurrentMethod().Name,
  509. ex.ToString(),
  510. LocalPath.LogExePath);
  511. actionResult.Status = (int)Constant.PDAResult.Exception;
  512. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  513. }
  514. return actionResult;
  515. }
  516. /// <summary>
  517. /// 检验生产工号
  518. /// </summary>
  519. /// <param name="accountCode">帐套code</param>
  520. /// <param name="userCode">用户code</param>
  521. /// <param name="userPassword">用户密码</param>
  522. /// <param name="sessionKey">本次登陆密钥</param>
  523. /// <param name="procedureID">工序ID</param>
  524. /// <param name="procedureUserCode">生产工号</param>
  525. /// <remarks>
  526. /// 陈冰 2014.09.18 新建
  527. /// </remarks>
  528. public ActionResult CheckProcedureUser(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
  529. {
  530. ActionResult actionResult = new ActionResult();
  531. try
  532. {
  533. // 验证请求头信息
  534. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  535. // 验证失败
  536. if (actionResult.Status != (int)Constant.PDAResult.Success)
  537. {
  538. return actionResult;
  539. }
  540. CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
  541. () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
  542. actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
  543. actionResult.Status = (int)Constant.PDAResult.Success;
  544. }
  545. catch (Exception ex)
  546. {
  547. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  548. OutputLog.TraceLog(LogPriority.Error,
  549. this.ToString(),
  550. System.Reflection.MethodBase.GetCurrentMethod().Name,
  551. ex.ToString(),
  552. LocalPath.LogExePath);
  553. actionResult.Status = (int)Constant.PDAResult.Exception;
  554. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  555. }
  556. return actionResult;
  557. }
  558. /// <summary>
  559. /// 校验窑车是否可装车并返回窑车信息
  560. /// </summary>
  561. /// <param name="accountCode">帐套code</param>
  562. /// <param name="userCode">用户code</param>
  563. /// <param name="userPassword">用户密码</param>
  564. /// <param name="sessionKey">本次登陆密钥</param>
  565. /// <param name="kilnCarCode">窑车号</param>
  566. /// <param name="modelType">工序类别</param>
  567. /// <returns></returns>
  568. /// <remarks>
  569. /// 陈冰 2014.10.04 新建
  570. /// </remarks>
  571. public ActionResult CheckKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
  572. {
  573. ActionResult actionResult = new ActionResult();
  574. try
  575. {
  576. // 验证请求头信息
  577. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  578. // 验证失败
  579. if (actionResult.Status != (int)Constant.PDAResult.Success)
  580. {
  581. return actionResult;
  582. }
  583. CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
  584. () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
  585. actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
  586. actionResult.Status = (int)Constant.PDAResult.Success;
  587. }
  588. catch (Exception ex)
  589. {
  590. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  591. OutputLog.TraceLog(LogPriority.Error,
  592. this.ToString(),
  593. System.Reflection.MethodBase.GetCurrentMethod().Name,
  594. ex.ToString(),
  595. LocalPath.LogExePath);
  596. actionResult.Status = (int)Constant.PDAResult.Exception;
  597. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  598. }
  599. return actionResult;
  600. }
  601. #endregion
  602. #region 保存条码信息
  603. /// <summary>
  604. /// 保存条码信息
  605. /// </summary>
  606. /// <param name="accountCode">帐套code</param>
  607. /// <param name="userCode">用户code</param>
  608. /// <param name="userPassword">用户密码</param>
  609. /// <param name="sessionKey">本次登陆密钥</param>
  610. /// <param name="procedureID">工序ID</param>
  611. /// <param name="productionDataEntitys">条码信息</param>
  612. public ActionResult AddWorkPiece(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  613. {
  614. ActionResult actionResult = new ActionResult();
  615. try
  616. {
  617. // 验证请求头信息
  618. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  619. // 验证失败
  620. if (actionResult.Status != (int)Constant.PDAResult.Success)
  621. {
  622. return actionResult;
  623. }
  624. DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
  625. if (!dtProductionData.Columns.Contains("IsPDA"))
  626. {
  627. dtProductionData.Columns.Add("IsPDA");
  628. }
  629. ProcedureEntity procedureInfo = null;
  630. DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
  631. () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
  632. actionResult.Result = JsonHelper.ToJson(resultDT);
  633. actionResult.Status = (int)Constant.PDAResult.Success;
  634. if (resultDT != null)
  635. {
  636. DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
  637. if (drs != null && drs.Length > 0)
  638. {
  639. return actionResult;
  640. }
  641. }
  642. #region PDA条码打印
  643. if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
  644. procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
  645. {
  646. try
  647. {
  648. if (procedureInfo.CollectType == 1)
  649. {
  650. //foreach (DataRow item in dtProductionData.Rows)
  651. //{
  652. // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
  653. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  654. // if (sre.Status != Constant.ServiceResultStatus.Success)
  655. // {
  656. // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  657. // actionResult.Message = sre.Message;
  658. // return actionResult;
  659. // }
  660. //}
  661. }
  662. else
  663. {
  664. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
  665. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  666. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(dtProductionData.Rows[0]["barcode"].ToString(),
  667. procedureInfo.BarCodePrintCopies, null, sUserInfo, 0);
  668. if (sre.Status != Constant.ServiceResultStatus.Success)
  669. {
  670. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  671. actionResult.Message = sre.Message;
  672. return actionResult;
  673. }
  674. }
  675. }
  676. catch (Exception ex)
  677. {
  678. OutputLog.TraceLog(LogPriority.Error,
  679. this.ToString(),
  680. System.Reflection.MethodBase.GetCurrentMethod().Name,
  681. ex.ToString(),
  682. LocalPath.LogExePath);
  683. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  684. actionResult.Message = "条码打印异常";
  685. return actionResult;
  686. }
  687. }
  688. #endregion PDA条码打印
  689. }
  690. catch (Exception ex)
  691. {
  692. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  693. OutputLog.TraceLog(LogPriority.Error,
  694. this.ToString(),
  695. System.Reflection.MethodBase.GetCurrentMethod().Name,
  696. ex.ToString(),
  697. LocalPath.LogExePath);
  698. try
  699. {
  700. string ss = JsonHelper.ToJson(productionDataEntitys);
  701. OutputLog.TraceLog(LogPriority.Error,
  702. this.ToString(),
  703. System.Reflection.MethodBase.GetCurrentMethod().Name,
  704. $" userCode:{userCode} procedureID:{procedureID} " + ss,
  705. LocalPath.LogExePath);
  706. }
  707. catch
  708. {
  709. }
  710. actionResult.Status = (int)Constant.PDAResult.Exception;
  711. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  712. }
  713. return actionResult;
  714. }
  715. #endregion
  716. #region 获得系统/基数数据
  717. /// <summary>
  718. /// 获得数据字典
  719. /// </summary>
  720. /// <param name="accountCode">帐套code</param>
  721. /// <param name="userCode">用户code</param>
  722. /// <param name="userPassword">用户密码</param>
  723. /// <param name="sessionKey">本次登陆密钥</param>
  724. /// <param name="dicType">字典类型</param>
  725. /// <returns></returns>
  726. public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  727. {
  728. ActionResult actionResult = new ActionResult();
  729. try
  730. {
  731. // 验证请求头信息
  732. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  733. // 验证失败
  734. if (actionResult.Status != (int)Constant.PDAResult.Success)
  735. {
  736. return actionResult;
  737. }
  738. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  739. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  740. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  741. actionResult.Status = (int)Constant.PDAResult.Success;
  742. }
  743. catch (Exception ex)
  744. {
  745. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  746. OutputLog.TraceLog(LogPriority.Error,
  747. this.ToString(),
  748. System.Reflection.MethodBase.GetCurrentMethod().Name,
  749. ex.ToString(),
  750. LocalPath.LogExePath);
  751. actionResult.Status = (int)Constant.PDAResult.Exception;
  752. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  753. }
  754. return actionResult;
  755. }
  756. #endregion
  757. #region 检验工序接口
  758. /// <summary>
  759. /// 获得检验标识
  760. /// </summary>
  761. /// <param name="accountCode">帐套code</param>
  762. /// <param name="userCode">用户code</param>
  763. /// <param name="userPassword">用户密码</param>
  764. /// <param name="sessionKey">本次登陆密钥</param>
  765. /// <returns></returns>
  766. /// <remarks>
  767. /// 陈冰 2014.10.04 新建
  768. /// </remarks>
  769. public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey)
  770. {
  771. ActionResult actionResult = new ActionResult();
  772. try
  773. {
  774. // 验证请求头信息
  775. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  776. // 验证失败
  777. if (actionResult.Status != (int)Constant.PDAResult.Success)
  778. {
  779. return actionResult;
  780. }
  781. #region 构造缺陷标识的数据源
  782. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  783. #endregion
  784. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  785. actionResult.Status = (int)Constant.PDAResult.Success;
  786. }
  787. catch (Exception ex)
  788. {
  789. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  790. OutputLog.TraceLog(LogPriority.Error,
  791. this.ToString(),
  792. System.Reflection.MethodBase.GetCurrentMethod().Name,
  793. ex.ToString(),
  794. LocalPath.LogExePath);
  795. actionResult.Status = (int)Constant.PDAResult.Exception;
  796. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  797. }
  798. return actionResult;
  799. }
  800. /// <summary>
  801. /// 由条码和当前检验工序获取返工工序
  802. /// </summary>
  803. /// <param name="accountCode">帐套code</param>
  804. /// <param name="userCode">用户code</param>
  805. /// <param name="userPassword">用户密码</param>
  806. /// <param name="sessionKey">本次登陆密钥</param>
  807. /// <param name="procedureID">当前检验工序ID</param>
  808. /// <param name="barcode">条码</param>
  809. /// <returns></returns>
  810. /// <remarks>
  811. /// 陈冰 2014.10.04 新建
  812. /// </remarks>
  813. public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  814. {
  815. ActionResult actionResult = new ActionResult();
  816. try
  817. {
  818. // 验证请求头信息
  819. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  820. // 验证失败
  821. if (actionResult.Status != (int)Constant.PDAResult.Success)
  822. {
  823. return actionResult;
  824. }
  825. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  826. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  827. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  828. {
  829. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  830. actionResult.Status = (int)Constant.PDAResult.Success;
  831. }
  832. else
  833. {
  834. actionResult.Status = (int)Constant.PDAResult.Fail;
  835. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  836. }
  837. }
  838. catch (Exception ex)
  839. {
  840. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  841. OutputLog.TraceLog(LogPriority.Error,
  842. this.ToString(),
  843. System.Reflection.MethodBase.GetCurrentMethod().Name,
  844. ex.ToString(),
  845. LocalPath.LogExePath);
  846. actionResult.Status = (int)Constant.PDAResult.Exception;
  847. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  848. }
  849. return actionResult;
  850. }
  851. /// <summary>
  852. /// 由当前检验工序获取缺陷列表
  853. /// </summary>
  854. /// <param name="accountCode">帐套code</param>
  855. /// <param name="userCode">用户code</param>
  856. /// <param name="userPassword">用户密码</param>
  857. /// <param name="sessionKey">本次登陆密钥</param>
  858. /// <param name="procedureID">当前检验工序ID</param>
  859. /// <param name="defectCode">缺陷编码</param>
  860. /// <returns></returns>
  861. /// <remarks>
  862. /// 陈冰 2014.10.04 新建
  863. /// </remarks>
  864. public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  865. {
  866. ActionResult actionResult = new ActionResult();
  867. try
  868. {
  869. // 验证请求头信息
  870. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  871. // 验证失败
  872. if (actionResult.Status != (int)Constant.PDAResult.Success)
  873. {
  874. return actionResult;
  875. }
  876. object defectDs = ServiceInvoker.Invoke<object>(this,
  877. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  878. if (defectDs != null)
  879. {
  880. actionResult.Result = JsonHelper.ToJson(defectDs);
  881. actionResult.Status = (int)Constant.PDAResult.Success;
  882. }
  883. else
  884. {
  885. actionResult.Status = (int)Constant.PDAResult.Fail;
  886. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  887. }
  888. }
  889. catch (Exception ex)
  890. {
  891. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  892. OutputLog.TraceLog(LogPriority.Error,
  893. this.ToString(),
  894. System.Reflection.MethodBase.GetCurrentMethod().Name,
  895. ex.ToString(),
  896. LocalPath.LogExePath);
  897. actionResult.Status = (int)Constant.PDAResult.Exception;
  898. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  899. }
  900. return actionResult;
  901. }
  902. /// <summary>
  903. /// 根据产品ID查出缺陷位置
  904. /// </summary>
  905. /// <param name="accountCode">帐套code</param>
  906. /// <param name="userCode">用户code</param>
  907. /// <param name="userPassword">用户密码</param>
  908. /// <param name="sessionKey">本次登陆密钥</param>
  909. /// <param name="goodsID">产品ID</param>
  910. /// <param name="positionCode">位置编码</param>
  911. /// <returns></returns>
  912. /// <remarks>
  913. /// 陈冰 2014.10.04 新建
  914. /// </remarks>
  915. public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  916. {
  917. ActionResult actionResult = new ActionResult();
  918. try
  919. {
  920. // 验证请求头信息
  921. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  922. // 验证失败
  923. if (actionResult.Status != (int)Constant.PDAResult.Success)
  924. {
  925. return actionResult;
  926. }
  927. // 缺陷位置已经不用在关联产品
  928. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  929. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  930. if (defectDs != null)
  931. {
  932. actionResult.Result = JsonHelper.ToJson(defectDs);
  933. actionResult.Status = (int)Constant.PDAResult.Success;
  934. }
  935. else
  936. {
  937. actionResult.Status = (int)Constant.PDAResult.Fail;
  938. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  939. }
  940. }
  941. catch (Exception ex)
  942. {
  943. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  944. OutputLog.TraceLog(LogPriority.Error,
  945. this.ToString(),
  946. System.Reflection.MethodBase.GetCurrentMethod().Name,
  947. ex.ToString(),
  948. LocalPath.LogExePath);
  949. actionResult.Status = (int)Constant.PDAResult.Exception;
  950. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  951. }
  952. return actionResult;
  953. }
  954. /// <summary>
  955. /// 通过条码和缺陷查出责任工序
  956. /// </summary>
  957. /// <param name="accountCode">帐套code</param>
  958. /// <param name="userCode">用户code</param>
  959. /// <param name="userPassword">用户密码</param>
  960. /// <param name="sessionKey">本次登陆密钥</param>
  961. /// <param name="barcode">条码</param>
  962. /// <param name="defectid">缺陷ID</param>
  963. /// <returns></returns>
  964. /// <remarks>
  965. /// 陈冰 2014.10.04 新建
  966. /// </remarks>
  967. public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  968. {
  969. ActionResult actionResult = new ActionResult();
  970. try
  971. {
  972. // 验证请求头信息
  973. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  974. // 验证失败
  975. if (actionResult.Status != (int)Constant.PDAResult.Success)
  976. {
  977. return actionResult;
  978. }
  979. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  980. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  981. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  982. {
  983. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  984. actionResult.Status = (int)Constant.PDAResult.Success;
  985. }
  986. else
  987. {
  988. actionResult.Status = (int)Constant.PDAResult.Fail;
  989. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  990. }
  991. }
  992. catch (Exception ex)
  993. {
  994. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  995. OutputLog.TraceLog(LogPriority.Error,
  996. this.ToString(),
  997. System.Reflection.MethodBase.GetCurrentMethod().Name,
  998. ex.ToString(),
  999. LocalPath.LogExePath);
  1000. actionResult.Status = (int)Constant.PDAResult.Exception;
  1001. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1002. }
  1003. return actionResult;
  1004. }
  1005. /// <summary>
  1006. /// 通过条码与工序查出责任工号(己废)
  1007. /// </summary>
  1008. /// <param name="accountCode">帐套code</param>
  1009. /// <param name="userCode">用户code</param>
  1010. /// <param name="userPassword">用户密码</param>
  1011. /// <param name="sessionKey">本次登陆密钥</param>
  1012. /// <param name="barcode">条码</param>
  1013. /// <param name="dutyProcedureID">责任工序</param>
  1014. /// <returns></returns>
  1015. /// <remarks>
  1016. /// 陈冰 2014.10.04 新建
  1017. /// </remarks>
  1018. public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  1019. {
  1020. ActionResult actionResult = new ActionResult();
  1021. try
  1022. {
  1023. // 验证请求头信息
  1024. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1025. // 验证失败
  1026. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1027. {
  1028. return actionResult;
  1029. }
  1030. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1031. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  1032. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1033. {
  1034. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1035. actionResult.Status = (int)Constant.PDAResult.Success;
  1036. }
  1037. else
  1038. {
  1039. actionResult.Status = (int)Constant.PDAResult.Fail;
  1040. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1041. }
  1042. }
  1043. catch (Exception ex)
  1044. {
  1045. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1046. OutputLog.TraceLog(LogPriority.Error,
  1047. this.ToString(),
  1048. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1049. ex.ToString(),
  1050. LocalPath.LogExePath);
  1051. actionResult.Status = (int)Constant.PDAResult.Exception;
  1052. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1053. }
  1054. return actionResult;
  1055. }
  1056. /// <summary>
  1057. /// 通过条码与工序查出责任工号
  1058. /// </summary>
  1059. /// <param name="accountCode"></param>
  1060. /// <param name="userCode"></param>
  1061. /// <param name="userPassword"></param>
  1062. /// <param name="sessionKey"></param>
  1063. /// <param name="ProductionDataID">生产数据ID</param>
  1064. /// <returns></returns>
  1065. public ActionResult GetDutyProcedureCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1066. {
  1067. ActionResult actionResult = new ActionResult();
  1068. try
  1069. {
  1070. // 验证请求头信息
  1071. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1072. // 验证失败
  1073. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1074. {
  1075. return actionResult;
  1076. }
  1077. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1078. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1079. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1080. {
  1081. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1082. actionResult.Status = (int)Constant.PDAResult.Success;
  1083. }
  1084. else
  1085. {
  1086. actionResult.Status = (int)Constant.PDAResult.Fail;
  1087. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1088. }
  1089. }
  1090. catch (Exception ex)
  1091. {
  1092. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1093. OutputLog.TraceLog(LogPriority.Error,
  1094. this.ToString(),
  1095. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1096. ex.ToString(),
  1097. LocalPath.LogExePath);
  1098. actionResult.Status = (int)Constant.PDAResult.Exception;
  1099. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1100. }
  1101. return actionResult;
  1102. }
  1103. /// <summary>
  1104. /// 通过生产数据与工号ID查询工种
  1105. /// </summary>
  1106. /// <param name="accountCode">帐套code</param>
  1107. /// <param name="userCode">用户code</param>
  1108. /// <param name="userPassword">用户密码</param>
  1109. /// <param name="sessionKey">本次登陆密钥</param>
  1110. /// <param name="productionDataID">生产数据ID</param>
  1111. /// <param name="userID">工号ID</param>
  1112. /// <returns></returns>
  1113. /// <remarks>
  1114. /// 陈冰 2014.10.08 新建
  1115. /// </remarks>
  1116. public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey,
  1117. //int productionDataID, int userID)
  1118. int classesSettingID, int defectid, int procedureID)
  1119. {
  1120. ActionResult actionResult = new ActionResult();
  1121. try
  1122. {
  1123. // 验证请求头信息
  1124. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1125. // 验证失败
  1126. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1127. {
  1128. return actionResult;
  1129. }
  1130. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1131. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1132. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  1133. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1134. {
  1135. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1136. actionResult.Status = (int)Constant.PDAResult.Success;
  1137. }
  1138. else
  1139. {
  1140. actionResult.Status = (int)Constant.PDAResult.Fail;
  1141. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1142. }
  1143. }
  1144. catch (Exception ex)
  1145. {
  1146. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1147. OutputLog.TraceLog(LogPriority.Error,
  1148. this.ToString(),
  1149. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1150. ex.ToString(),
  1151. LocalPath.LogExePath);
  1152. actionResult.Status = (int)Constant.PDAResult.Exception;
  1153. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1154. }
  1155. return actionResult;
  1156. }
  1157. /// <summary>
  1158. /// 根据生产数据ID,用户ID及工种选出责任员工
  1159. /// </summary>
  1160. /// <param name="accountCode">帐套code</param>
  1161. /// <param name="userCode">用户code</param>
  1162. /// <param name="userPassword">用户密码</param>
  1163. /// <param name="sessionKey">本次登陆密钥</param>
  1164. /// <param name="productionDataID">生产数据ID</param>
  1165. /// <param name="userID">工号ID</param>
  1166. /// <param name="jobsID">工种ID</param>
  1167. /// <returns></returns>
  1168. /// <remarks>
  1169. /// 陈冰 2014.10.08 新建
  1170. /// </remarks>
  1171. public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey,
  1172. //int productionDataID, int userID, int jobsID)
  1173. int classesSettingID, int jobsID)
  1174. {
  1175. ActionResult actionResult = new ActionResult();
  1176. try
  1177. {
  1178. // 验证请求头信息
  1179. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1180. // 验证失败
  1181. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1182. {
  1183. return actionResult;
  1184. }
  1185. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1186. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1187. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1188. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1189. {
  1190. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1191. actionResult.Status = (int)Constant.PDAResult.Success;
  1192. }
  1193. else
  1194. {
  1195. actionResult.Status = (int)Constant.PDAResult.Fail;
  1196. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1197. }
  1198. }
  1199. catch (Exception ex)
  1200. {
  1201. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1202. OutputLog.TraceLog(LogPriority.Error,
  1203. this.ToString(),
  1204. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1205. ex.ToString(),
  1206. LocalPath.LogExePath);
  1207. actionResult.Status = (int)Constant.PDAResult.Exception;
  1208. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1209. }
  1210. return actionResult;
  1211. }
  1212. /// <summary>
  1213. /// 获得产品分级
  1214. /// </summary>
  1215. /// <param name="accountCode">帐套code</param>
  1216. /// <param name="userCode">用户code</param>
  1217. /// <param name="userPassword">用户密码</param>
  1218. /// <param name="sessionKey">本次登陆密钥</param>
  1219. /// <returns></returns>
  1220. /// <remarks>
  1221. /// 陈冰 2014.10.08 新建
  1222. /// xuwei 2019-12-4 添加参数type 默认为2成检 为1时 半检
  1223. /// </remarks>
  1224. public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey, int type = 2)
  1225. {
  1226. ActionResult actionResult = new ActionResult();
  1227. try
  1228. {
  1229. // 验证请求头信息
  1230. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1231. // 验证失败
  1232. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1233. {
  1234. return actionResult;
  1235. }
  1236. #region 构造产品分级的数据源
  1237. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1238. //xuwei modify 2019-12-04 支持半检 没传参数 type=0
  1239. //DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2 , sUserInfo);
  1240. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(type == 0 ? 2 : type, sUserInfo);
  1241. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1242. {
  1243. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1244. actionResult.Status = (int)Constant.PDAResult.Success;
  1245. }
  1246. else
  1247. {
  1248. actionResult.Status = (int)Constant.PDAResult.Fail;
  1249. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1250. }
  1251. #endregion
  1252. }
  1253. catch (Exception ex)
  1254. {
  1255. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1256. OutputLog.TraceLog(LogPriority.Error,
  1257. this.ToString(),
  1258. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1259. ex.ToString(),
  1260. LocalPath.LogExePath);
  1261. OutputLog.TraceLog(LogPriority.Error,
  1262. this.ToString(),
  1263. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1264. ex.ToString(),
  1265. LocalPath.LogExePath);
  1266. actionResult.Status = (int)Constant.PDAResult.Exception;
  1267. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1268. }
  1269. return actionResult;
  1270. }
  1271. #endregion
  1272. #region 保存检验条码
  1273. /// <summary>
  1274. /// 保存检验条码
  1275. /// </summary>
  1276. /// <param name="accountCode">帐套code</param>
  1277. /// <param name="userCode">用户code</param>
  1278. /// <param name="userPassword">用户密码</param>
  1279. /// <param name="sessionKey">本次登陆密钥</param>
  1280. /// <param name="procedureID">工序ID</param>
  1281. /// <param name="productionDataEntitys">条码信息</param>
  1282. /// <returns></returns>
  1283. public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1284. {
  1285. ActionResult actionResult = new ActionResult();
  1286. try
  1287. {
  1288. // 验证请求头信息
  1289. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1290. // 验证失败
  1291. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1292. {
  1293. return actionResult;
  1294. }
  1295. //if(productionDataEntitys.Length>0)
  1296. //{
  1297. // if(productionDataEntitys[0].ProductionDataID>0)
  1298. // {
  1299. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1300. // }
  1301. //}
  1302. string err = ServiceInvoker.Invoke<string>(this,
  1303. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1304. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1305. if (err == null)
  1306. {
  1307. err = "";
  1308. }
  1309. //actionResult.Result = JsonHelper.ToJson(err);
  1310. actionResult.Result = err;// JsonHelper.ToJson(err);
  1311. actionResult.Status = (int)Constant.PDAResult.Success;
  1312. }
  1313. catch (Exception ex)
  1314. {
  1315. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1316. OutputLog.TraceLog(LogPriority.Error,
  1317. this.ToString(),
  1318. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1319. ex.ToString(),
  1320. LocalPath.LogExePath);
  1321. actionResult.Status = (int)Constant.PDAResult.Exception;
  1322. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1323. }
  1324. return actionResult;
  1325. }
  1326. #endregion
  1327. #region 文件上传下载
  1328. /// <summary>
  1329. /// 软件更新
  1330. /// </summary>
  1331. /// <param name="accountCode">帐套code</param>
  1332. /// <param name="userCode">用户code</param>
  1333. /// <param name="userPassword">用户密码</param>
  1334. /// <param name="sessionKey">本次登陆密钥</param>
  1335. /// <returns></returns>
  1336. public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey)
  1337. {
  1338. try
  1339. {
  1340. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1341. }
  1342. catch (Exception ex)
  1343. {
  1344. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1345. OutputLog.TraceLog(LogPriority.Error,
  1346. this.ToString(),
  1347. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1348. ex.ToString(),
  1349. LocalPath.LogExePath);
  1350. return null;
  1351. }
  1352. }
  1353. /// <summary>
  1354. /// 上传临时文件
  1355. /// </summary>
  1356. /// <param name="imgStream"></param>
  1357. /// <returns></returns>
  1358. public ActionResult SaveImg(Stream mageStream)
  1359. {
  1360. ActionResult actionResult = new ActionResult();
  1361. try
  1362. {
  1363. string err = PDAModuleLogic.SaveImg(mageStream);
  1364. if (err == null)
  1365. {
  1366. err = "";
  1367. }
  1368. actionResult.Result = err;
  1369. actionResult.Status = (int)Constant.PDAResult.Success;
  1370. }
  1371. catch (Exception ex)
  1372. {
  1373. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1374. OutputLog.TraceLog(LogPriority.Error,
  1375. this.ToString(),
  1376. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1377. ex.ToString(),
  1378. LocalPath.LogExePath);
  1379. actionResult.Status = (int)Constant.PDAResult.Exception;
  1380. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1381. }
  1382. return actionResult;
  1383. }
  1384. public Stream GetFileTest(string path)
  1385. {
  1386. return PDAModuleLogic.GetImg(path);
  1387. }
  1388. public Stream GetFileStream()
  1389. {
  1390. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1391. long l = fs.Length;
  1392. return fs;
  1393. }
  1394. public byte[] GetFileTestByte(string path)
  1395. {
  1396. FileStream stream = new FileInfo(path).OpenRead();
  1397. Byte[] buffer = new Byte[stream.Length];
  1398. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1399. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1400. return buffer;
  1401. }
  1402. public string GetFile(string path)
  1403. {
  1404. string imgFilePath = path;
  1405. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1406. int i = (int)fs.Length;
  1407. byte[] content = new byte[i];
  1408. fs.Read(content, 0, i);
  1409. string result = Convert.ToBase64String(content);
  1410. fs.Close();
  1411. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1412. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1413. sw.Write(result);
  1414. sw.Close();
  1415. fsTxt.Close();
  1416. return result;
  1417. }
  1418. #endregion
  1419. /// <summary>
  1420. /// 获得产品分级
  1421. /// </summary>
  1422. /// <param name="accountCode">帐套code</param>
  1423. /// <param name="userCode">用户code</param>
  1424. /// <param name="userPassword">用户密码</param>
  1425. /// <param name="sessionKey">本次登陆密钥</param>
  1426. /// <param name="procedureID">当前工序ID</param>
  1427. /// <returns></returns>
  1428. /// <remarks>
  1429. /// 陈冰 2014.10.22 新建
  1430. /// </remarks>
  1431. public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1432. {
  1433. ActionResult actionResult = new ActionResult();
  1434. try
  1435. {
  1436. // 验证请求头信息
  1437. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1438. // 验证失败
  1439. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1440. {
  1441. return actionResult;
  1442. }
  1443. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1444. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1445. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1446. {
  1447. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1448. actionResult.Status = (int)Constant.PDAResult.Success;
  1449. }
  1450. else
  1451. {
  1452. actionResult.Status = (int)Constant.PDAResult.Fail;
  1453. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1454. }
  1455. }
  1456. catch (Exception ex)
  1457. {
  1458. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1459. OutputLog.TraceLog(LogPriority.Error,
  1460. this.ToString(),
  1461. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1462. ex.ToString(),
  1463. LocalPath.LogExePath);
  1464. actionResult.Status = (int)Constant.PDAResult.Exception;
  1465. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1466. }
  1467. return actionResult;
  1468. }
  1469. /// <summary>
  1470. /// 获得产品分级
  1471. /// </summary>
  1472. /// <param name="accountCode">帐套code</param>
  1473. /// <param name="userCode">用户code</param>
  1474. /// <param name="userPassword">用户密码</param>
  1475. /// <param name="sessionKey">本次登陆密钥</param>
  1476. /// <param name="barcode">条码</param>
  1477. /// <returns></returns>
  1478. public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1479. {
  1480. ActionResult actionResult = new ActionResult();
  1481. try
  1482. {
  1483. // 验证请求头信息
  1484. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1485. // 验证失败
  1486. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1487. {
  1488. return actionResult;
  1489. }
  1490. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1491. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1492. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1493. {
  1494. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1495. actionResult.Status = (int)Constant.PDAResult.Success;
  1496. }
  1497. else
  1498. {
  1499. actionResult.Status = (int)Constant.PDAResult.Fail;
  1500. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1501. }
  1502. }
  1503. catch (Exception ex)
  1504. {
  1505. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1506. OutputLog.TraceLog(LogPriority.Error,
  1507. this.ToString(),
  1508. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1509. ex.ToString(),
  1510. LocalPath.LogExePath);
  1511. actionResult.Status = (int)Constant.PDAResult.Exception;
  1512. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1513. }
  1514. return actionResult;
  1515. }
  1516. #region 统计
  1517. /// <summary>
  1518. /// 统计当日计数数量
  1519. /// </summary>
  1520. /// <param name="accountCode">帐套code</param>
  1521. /// <param name="userCode">用户code</param>
  1522. /// <param name="userPassword">用户密码</param>
  1523. /// <param name="sessionKey">本次登陆密钥</param>
  1524. /// <param name="procedureID">工序ID</param>
  1525. /// <returns></returns>
  1526. public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1527. {
  1528. ActionResult actionResult = new ActionResult();
  1529. try
  1530. {
  1531. // 验证请求头信息
  1532. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1533. // 验证失败
  1534. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1535. {
  1536. return actionResult;
  1537. }
  1538. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1539. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1540. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1541. {
  1542. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1543. actionResult.Status = (int)Constant.PDAResult.Success;
  1544. }
  1545. else
  1546. {
  1547. actionResult.Status = (int)Constant.PDAResult.Fail;
  1548. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1549. }
  1550. }
  1551. catch (Exception ex)
  1552. {
  1553. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1554. OutputLog.TraceLog(LogPriority.Error,
  1555. this.ToString(),
  1556. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1557. ex.ToString(),
  1558. LocalPath.LogExePath);
  1559. actionResult.Status = (int)Constant.PDAResult.Exception;
  1560. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1561. }
  1562. return actionResult;
  1563. }
  1564. /// <summary>
  1565. /// 统计当日计数数量
  1566. /// </summary>
  1567. /// <param name="accountCode">帐套code</param>
  1568. /// <param name="userCode">用户code</param>
  1569. /// <param name="userPassword">用户密码</param>
  1570. /// <param name="sessionKey">本次登陆密钥</param>
  1571. /// <param name="procedureID">工序ID</param>
  1572. /// <returns></returns>
  1573. public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1574. {
  1575. ActionResult actionResult = new ActionResult();
  1576. try
  1577. {
  1578. // 验证请求头信息
  1579. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1580. // 验证失败
  1581. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1582. {
  1583. return actionResult;
  1584. }
  1585. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1586. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1587. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1588. {
  1589. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1590. actionResult.Status = (int)Constant.PDAResult.Success;
  1591. }
  1592. else
  1593. {
  1594. actionResult.Status = (int)Constant.PDAResult.Fail;
  1595. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1596. }
  1597. }
  1598. catch (Exception ex)
  1599. {
  1600. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1601. OutputLog.TraceLog(LogPriority.Error,
  1602. this.ToString(),
  1603. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1604. ex.ToString(),
  1605. LocalPath.LogExePath);
  1606. actionResult.Status = (int)Constant.PDAResult.Exception;
  1607. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1608. }
  1609. return actionResult;
  1610. }
  1611. /// <summary>
  1612. /// 统计产品跟踪
  1613. /// </summary>
  1614. /// <param name="accountCode">帐套code</param>
  1615. /// <param name="userCode">用户code</param>
  1616. /// <param name="userPassword">用户密码</param>
  1617. /// <param name="sessionKey">本次登陆密钥</param>
  1618. /// <param name="procedureID">工序ID</param>
  1619. /// <returns></returns>
  1620. public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1621. {
  1622. ActionResult actionResult = new ActionResult();
  1623. try
  1624. {
  1625. // 验证请求头信息
  1626. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1627. // 验证失败
  1628. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1629. {
  1630. return actionResult;
  1631. }
  1632. RPT020101_SE se = new RPT020101_SE();
  1633. se.Barcode = barcode;
  1634. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1635. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1636. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1637. {
  1638. actionResult.Status = (int)Constant.PDAResult.Fail;
  1639. actionResult.Message = Messages.MSG_CMN_I002;
  1640. }
  1641. else
  1642. {
  1643. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1644. actionResult.Status = (int)Constant.PDAResult.Success;
  1645. }
  1646. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1647. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1648. //if (productionDataEntity != null)
  1649. //{
  1650. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1651. // actionResult.Status = (int)Constant.PDAResult.Success;
  1652. //}
  1653. //else
  1654. //{
  1655. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1656. // actionResult.Message = Messages.MSG_CMN_I002;
  1657. //}
  1658. }
  1659. catch (Exception ex)
  1660. {
  1661. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1662. OutputLog.TraceLog(LogPriority.Error,
  1663. this.ToString(),
  1664. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1665. ex.ToString() + ex.HelpLink,
  1666. LocalPath.LogExePath);
  1667. actionResult.Status = (int)Constant.PDAResult.Exception;
  1668. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1669. }
  1670. return actionResult;
  1671. }
  1672. #endregion
  1673. #region 撤销装车及成检
  1674. /// <summary>
  1675. /// 检验条码是否可以撤销装车
  1676. /// </summary>
  1677. /// <param name="accountCode">帐套code</param>
  1678. /// <param name="userCode">用户code</param>
  1679. /// <param name="userPassword">用户密码</param>
  1680. /// <param name="sessionKey">本次登陆密钥</param>
  1681. /// <param name="procedureID">当前工序ID</param>
  1682. /// <param name="barcode">条码</param>
  1683. /// <returns></returns>
  1684. public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1685. {
  1686. ActionResult actionResult = new ActionResult();
  1687. try
  1688. {
  1689. // 验证请求头信息
  1690. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1691. // 验证失败
  1692. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1693. {
  1694. return actionResult;
  1695. }
  1696. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1697. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1698. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1699. actionResult.Status = (int)Constant.PDAResult.Success;
  1700. }
  1701. catch (Exception ex)
  1702. {
  1703. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1704. OutputLog.TraceLog(LogPriority.Error,
  1705. this.ToString(),
  1706. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1707. ex.ToString(),
  1708. LocalPath.LogExePath);
  1709. actionResult.Status = (int)Constant.PDAResult.Exception;
  1710. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1711. }
  1712. return actionResult;
  1713. }
  1714. /// <summary>
  1715. /// 保存撤销装车的条码
  1716. /// </summary>
  1717. /// <param name="accountCode">帐套code</param>
  1718. /// <param name="userCode">用户code</param>
  1719. /// <param name="userPassword">用户密码</param>
  1720. /// <param name="sessionKey">本次登陆密钥</param>
  1721. /// <param name="procedureID">当前工序ID</param>
  1722. /// <param name="barcode">条码</param>
  1723. /// <returns></returns>
  1724. public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1725. {
  1726. ActionResult actionResult = new ActionResult();
  1727. try
  1728. {
  1729. // 验证请求头信息
  1730. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1731. // 验证失败
  1732. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1733. {
  1734. return actionResult;
  1735. }
  1736. string err = ServiceInvoker.Invoke<string>(this,
  1737. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1738. if (err == null)
  1739. {
  1740. err = "";
  1741. }
  1742. actionResult.Result = JsonHelper.ToJson(err);
  1743. actionResult.Status = (int)Constant.PDAResult.Success;
  1744. }
  1745. catch (Exception ex)
  1746. {
  1747. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1748. OutputLog.TraceLog(LogPriority.Error,
  1749. this.ToString(),
  1750. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1751. ex.ToString(),
  1752. LocalPath.LogExePath);
  1753. actionResult.Status = (int)Constant.PDAResult.Exception;
  1754. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1755. }
  1756. return actionResult;
  1757. }
  1758. /// <summary>
  1759. /// 由产品条码获取注浆信息
  1760. /// </summary>
  1761. /// <param name="barcode"></param>
  1762. /// <returns></returns>
  1763. public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1764. {
  1765. ActionResult actionResult = new ActionResult();
  1766. try
  1767. {
  1768. // 验证请求头信息
  1769. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1770. // 验证失败
  1771. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1772. {
  1773. return actionResult;
  1774. }
  1775. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1776. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1777. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1778. {
  1779. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1780. actionResult.Status = (int)Constant.PDAResult.Success;
  1781. }
  1782. else
  1783. {
  1784. actionResult.Status = (int)Constant.PDAResult.Fail;
  1785. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1786. }
  1787. }
  1788. catch (Exception ex)
  1789. {
  1790. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1791. OutputLog.TraceLog(LogPriority.Error,
  1792. this.ToString(),
  1793. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1794. ex.ToString(),
  1795. LocalPath.LogExePath);
  1796. actionResult.Status = (int)Constant.PDAResult.Exception;
  1797. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1798. }
  1799. return actionResult;
  1800. }
  1801. /// <summary>
  1802. /// 获取工号下的所有工种信息
  1803. /// </summary>
  1804. /// <param name="UserID">工号ID</param>
  1805. /// <returns></returns>
  1806. public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1807. {
  1808. ActionResult actionResult = new ActionResult();
  1809. try
  1810. {
  1811. // 验证请求头信息
  1812. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1813. // 验证失败
  1814. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1815. {
  1816. return actionResult;
  1817. }
  1818. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1819. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1820. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1821. {
  1822. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1823. actionResult.Status = (int)Constant.PDAResult.Success;
  1824. }
  1825. else
  1826. {
  1827. actionResult.Status = (int)Constant.PDAResult.Fail;
  1828. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1829. }
  1830. }
  1831. catch (Exception ex)
  1832. {
  1833. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1834. OutputLog.TraceLog(LogPriority.Error,
  1835. this.ToString(),
  1836. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1837. ex.ToString(),
  1838. LocalPath.LogExePath);
  1839. actionResult.Status = (int)Constant.PDAResult.Exception;
  1840. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1841. }
  1842. return actionResult;
  1843. }
  1844. /// <summary>
  1845. /// 根据所选工号对应的工种,查出缺陷责任员工
  1846. /// </summary>
  1847. /// <param name="jobs">工种ID</param>
  1848. /// <returns></returns>
  1849. public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  1850. {
  1851. ActionResult actionResult = new ActionResult();
  1852. try
  1853. {
  1854. // 验证请求头信息
  1855. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1856. // 验证失败
  1857. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1858. {
  1859. return actionResult;
  1860. }
  1861. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1862. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  1863. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1864. {
  1865. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1866. actionResult.Status = (int)Constant.PDAResult.Success;
  1867. }
  1868. else
  1869. {
  1870. actionResult.Status = (int)Constant.PDAResult.Fail;
  1871. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1872. }
  1873. }
  1874. catch (Exception ex)
  1875. {
  1876. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1877. OutputLog.TraceLog(LogPriority.Error,
  1878. this.ToString(),
  1879. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1880. ex.ToString(),
  1881. LocalPath.LogExePath);
  1882. actionResult.Status = (int)Constant.PDAResult.Exception;
  1883. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1884. }
  1885. return actionResult;
  1886. }
  1887. /// <summary>
  1888. /// 根据所选工号,查出漏检责任员工
  1889. /// </summary>
  1890. /// <param name="userid">工号</param>
  1891. /// <returns></returns>
  1892. public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  1893. {
  1894. ActionResult actionResult = new ActionResult();
  1895. try
  1896. {
  1897. // 验证请求头信息
  1898. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1899. // 验证失败
  1900. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1901. {
  1902. return actionResult;
  1903. }
  1904. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1905. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  1906. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1907. {
  1908. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1909. actionResult.Status = (int)Constant.PDAResult.Success;
  1910. }
  1911. else
  1912. {
  1913. actionResult.Status = (int)Constant.PDAResult.Fail;
  1914. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1915. }
  1916. }
  1917. catch (Exception ex)
  1918. {
  1919. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1920. OutputLog.TraceLog(LogPriority.Error,
  1921. this.ToString(),
  1922. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1923. ex.ToString(),
  1924. LocalPath.LogExePath);
  1925. actionResult.Status = (int)Constant.PDAResult.Exception;
  1926. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1927. }
  1928. return actionResult;
  1929. }
  1930. /// <summary>
  1931. /// 获取用户列表
  1932. /// </summary>
  1933. /// <param name="requestEntity">用户实体</param>
  1934. /// <returns></returns>
  1935. public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  1936. {
  1937. ActionResult actionResult = new ActionResult();
  1938. try
  1939. {
  1940. // 验证请求头信息
  1941. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1942. // 验证失败
  1943. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1944. {
  1945. return actionResult;
  1946. }
  1947. SUserEntity requestEntity = new SUserEntity();
  1948. requestEntity.IsWorker = IsWorker;
  1949. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1950. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  1951. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1952. {
  1953. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1954. actionResult.Status = (int)Constant.PDAResult.Success;
  1955. }
  1956. else
  1957. {
  1958. actionResult.Status = (int)Constant.PDAResult.Fail;
  1959. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1960. }
  1961. }
  1962. catch (Exception ex)
  1963. {
  1964. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1965. OutputLog.TraceLog(LogPriority.Error,
  1966. this.ToString(),
  1967. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1968. ex.ToString(),
  1969. LocalPath.LogExePath);
  1970. actionResult.Status = (int)Constant.PDAResult.Exception;
  1971. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1972. }
  1973. return actionResult;
  1974. }
  1975. /// <summary>
  1976. /// 获取数据字典管理的数据
  1977. /// </summary>
  1978. /// <param name="Pvalue">显示停用标识</param>
  1979. /// <param name="dictionaryType">字典类别</param>
  1980. /// <returns></returns>
  1981. /// <remarks>
  1982. /// 2014.12.03 新建
  1983. /// </remarks>
  1984. public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  1985. {
  1986. ActionResult actionResult = new ActionResult();
  1987. try
  1988. {
  1989. // 验证请求头信息
  1990. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1991. // 验证失败
  1992. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1993. {
  1994. return actionResult;
  1995. }
  1996. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1997. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  1998. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1999. {
  2000. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2001. actionResult.Status = (int)Constant.PDAResult.Success;
  2002. }
  2003. else
  2004. {
  2005. actionResult.Status = (int)Constant.PDAResult.Fail;
  2006. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2007. }
  2008. }
  2009. catch (Exception ex)
  2010. {
  2011. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2012. OutputLog.TraceLog(LogPriority.Error,
  2013. this.ToString(),
  2014. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2015. ex.ToString(),
  2016. LocalPath.LogExePath);
  2017. actionResult.Status = (int)Constant.PDAResult.Exception;
  2018. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2019. }
  2020. return actionResult;
  2021. }
  2022. #endregion
  2023. #region 保存半检数据
  2024. /// <summary>
  2025. /// 保存半检数据
  2026. /// </summary>
  2027. /// <param name="accountCode">帐套code</param>
  2028. /// <param name="userCode">用户code</param>
  2029. /// <param name="userPassword">用户密码</param>
  2030. /// <param name="sessionKey">本次登陆密钥</param>
  2031. /// <param name="productionDataEntitys">半检信息</param>
  2032. /// <returns></returns>
  2033. public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  2034. {
  2035. ActionResult actionResult = new ActionResult();
  2036. try
  2037. {
  2038. // 验证请求头信息
  2039. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2040. // 验证失败
  2041. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2042. {
  2043. return actionResult;
  2044. }
  2045. string err = ServiceInvoker.Invoke<string>(this,
  2046. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2047. if (err == null)
  2048. {
  2049. err = "";
  2050. }
  2051. actionResult.Result = JsonHelper.ToJson(err);
  2052. actionResult.Status = (int)Constant.PDAResult.Success;
  2053. }
  2054. catch (Exception ex)
  2055. {
  2056. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2057. OutputLog.TraceLog(LogPriority.Error,
  2058. this.ToString(),
  2059. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2060. ex.ToString(),
  2061. LocalPath.LogExePath);
  2062. actionResult.Status = (int)Constant.PDAResult.Exception;
  2063. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2064. }
  2065. return actionResult;
  2066. }
  2067. #endregion
  2068. /// <summary>
  2069. /// 获取产品列表
  2070. /// </summary>
  2071. /// <returns></returns>
  2072. public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  2073. {
  2074. ActionResult actionResult = new ActionResult();
  2075. try
  2076. {
  2077. // 验证请求头信息
  2078. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2079. // 验证失败
  2080. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2081. {
  2082. return actionResult;
  2083. }
  2084. GoodsEntity goodsEntity = new GoodsEntity();
  2085. goodsEntity.ValueFlag = 1;//有效标记
  2086. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2087. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2088. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2089. {
  2090. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2091. actionResult.Status = (int)Constant.PDAResult.Success;
  2092. }
  2093. else
  2094. {
  2095. actionResult.Status = (int)Constant.PDAResult.Fail;
  2096. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2097. }
  2098. }
  2099. catch (Exception ex)
  2100. {
  2101. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2102. OutputLog.TraceLog(LogPriority.Error,
  2103. this.ToString(),
  2104. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2105. ex.ToString(),
  2106. LocalPath.LogExePath);
  2107. actionResult.Status = (int)Constant.PDAResult.Exception;
  2108. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2109. }
  2110. return actionResult;
  2111. }
  2112. /// <summary>
  2113. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2114. /// </summary>
  2115. /// <param name="searchEntity">生产数据实体类</param>
  2116. /// <returns>DataTable</returns>
  2117. public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2118. {
  2119. ActionResult actionResult = new ActionResult();
  2120. try
  2121. {
  2122. // 验证请求头信息
  2123. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2124. // 验证失败
  2125. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2126. {
  2127. return actionResult;
  2128. }
  2129. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2130. searchEntity.ProcedureID = ProcedureID;
  2131. searchEntity.BarCode = BarCode;
  2132. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2133. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2134. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2135. {
  2136. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2137. actionResult.Status = (int)Constant.PDAResult.Success;
  2138. }
  2139. else
  2140. {
  2141. actionResult.Status = (int)Constant.PDAResult.Fail;
  2142. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2143. }
  2144. }
  2145. catch (Exception ex)
  2146. {
  2147. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2148. OutputLog.TraceLog(LogPriority.Error,
  2149. this.ToString(),
  2150. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2151. ex.ToString(),
  2152. LocalPath.LogExePath);
  2153. actionResult.Status = (int)Constant.PDAResult.Exception;
  2154. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2155. }
  2156. return actionResult;
  2157. }
  2158. /// <summary>
  2159. /// xuwei add 2020-03-23 此方法用于成检后 回收 再次成检 获取正确ID
  2160. /// </summary>
  2161. /// <param name="searchEntity">生产数据实体类</param>
  2162. /// <returns>DataTable</returns>
  2163. public ActionResult GetProductionDataCheckID(string accountCode, string userCode, string userPassword, string sessionKey, string BarCode)
  2164. {
  2165. ActionResult actionResult = new ActionResult();
  2166. try
  2167. {
  2168. // 验证请求头信息
  2169. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2170. // 验证失败
  2171. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2172. {
  2173. return actionResult;
  2174. }
  2175. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2176. searchEntity.BarCode = BarCode;
  2177. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2178. () => PDAModuleLogic.GetProductionDataCheckID(searchEntity, sUserInfo));
  2179. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2180. {
  2181. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2182. actionResult.Status = (int)Constant.PDAResult.Success;
  2183. }
  2184. else
  2185. {
  2186. actionResult.Status = (int)Constant.PDAResult.Fail;
  2187. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2188. }
  2189. }
  2190. catch (Exception ex)
  2191. {
  2192. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2193. OutputLog.TraceLog(LogPriority.Error,
  2194. this.ToString(),
  2195. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2196. ex.ToString(),
  2197. LocalPath.LogExePath);
  2198. actionResult.Status = (int)Constant.PDAResult.Exception;
  2199. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2200. }
  2201. return actionResult;
  2202. }
  2203. /// <summary>
  2204. /// 根据所选生产数据ID,显示成检数据信息
  2205. /// </summary>
  2206. /// <param name="productionDataID">生产数据ID</param>
  2207. /// <returns>DataSet</returns>
  2208. public ActionResult GetProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2209. {
  2210. ActionResult actionResult = new ActionResult();
  2211. try
  2212. {
  2213. // 验证请求头信息
  2214. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2215. // 验证失败
  2216. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2217. {
  2218. return actionResult;
  2219. }
  2220. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2221. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2222. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2223. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2224. {
  2225. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2226. {
  2227. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2228. {
  2229. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2230. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2231. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2232. {
  2233. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2234. }
  2235. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2236. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2237. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2238. {
  2239. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2240. }
  2241. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2242. {
  2243. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2244. }
  2245. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2246. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2247. {
  2248. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2249. }
  2250. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2251. {
  2252. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2253. }
  2254. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2255. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2256. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2257. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2258. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2259. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2260. productionData.GlazeName = reworkDs.Tables[0].Rows[i]["GlazeName"].ToString();
  2261. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2262. {
  2263. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2264. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2265. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2266. }
  2267. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2268. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2269. {
  2270. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2271. }
  2272. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2273. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2274. DataTable dtDefect = dvDefect.ToTable();
  2275. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2276. {
  2277. // 产品缺陷
  2278. PDADefectResult defect = new PDADefectResult();
  2279. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2280. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2281. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2282. {
  2283. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2284. }
  2285. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2286. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2287. {
  2288. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2289. }
  2290. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2291. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2292. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2293. {
  2294. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2295. }
  2296. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2297. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2298. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2299. {
  2300. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2301. }
  2302. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2303. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2304. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2305. {
  2306. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2307. }
  2308. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2309. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2310. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2311. {
  2312. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2313. }
  2314. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2315. {
  2316. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2317. }
  2318. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2319. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2320. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2321. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2322. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2323. {
  2324. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2325. }
  2326. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2327. {
  2328. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2329. }
  2330. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2331. {
  2332. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2333. }
  2334. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2335. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2336. //--------责任员工-------------------
  2337. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2338. if (drRow.Length > Constant.INT_IS_ZERO)
  2339. {
  2340. foreach (DataRow r in drRow)
  2341. {
  2342. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2343. if (r["ProductionDefectID"].ToString() != "")
  2344. {
  2345. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2346. }
  2347. if (r["StaffID"].ToString() != "")
  2348. {
  2349. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2350. }
  2351. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2352. defectResponsible.StaffName = r["StaffName"].ToString();
  2353. if (r["StaffStatus"].ToString() != "")
  2354. {
  2355. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2356. }
  2357. if (r["UJobsID"].ToString() != "")
  2358. {
  2359. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2360. }
  2361. if (r["SJobsID"].ToString() != "")
  2362. {
  2363. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2364. }
  2365. defect.PDADefectResponsibles.Add(defectResponsible);
  2366. }
  2367. }
  2368. //------------------------------
  2369. //--------漏检员工-------------------
  2370. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2371. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2372. {
  2373. foreach (DataRow r in drMissedRow)
  2374. {
  2375. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2376. if (r["ProductionDefectID"].ToString() != "")
  2377. {
  2378. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2379. }
  2380. if (r["StaffID"].ToString() != "")
  2381. {
  2382. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2383. }
  2384. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2385. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2386. if (r["StaffStatus"].ToString() != "")
  2387. {
  2388. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2389. }
  2390. if (r["UJobsID"].ToString() != "")
  2391. {
  2392. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2393. }
  2394. if (r["SJobsID"].ToString() != "")
  2395. {
  2396. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2397. }
  2398. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2399. }
  2400. }
  2401. //------------------------------
  2402. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2403. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2404. {
  2405. foreach (DataRow r in drImageRow)
  2406. {
  2407. PDADefectImageResult defectImage = new PDADefectImageResult();
  2408. if (r["ProductionDefectID"].ToString() != "")
  2409. {
  2410. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2411. }
  2412. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2413. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2414. //{
  2415. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2416. //}
  2417. defect.PDADefectImageResults.Add(defectImage);
  2418. }
  2419. }
  2420. productionData.PDADefects.Add(defect);
  2421. }
  2422. if (productionDatas.PDAProductionData == null)
  2423. {
  2424. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2425. }
  2426. productionDatas.PDAProductionData.Add(productionData);
  2427. //---------------------------------------------------------------------------------
  2428. }
  2429. }
  2430. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2431. actionResult.Status = (int)Constant.PDAResult.Success;
  2432. }
  2433. else
  2434. {
  2435. actionResult.Status = (int)Constant.PDAResult.Fail;
  2436. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2437. }
  2438. }
  2439. catch (Exception ex)
  2440. {
  2441. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2442. OutputLog.TraceLog(LogPriority.Error,
  2443. this.ToString(),
  2444. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2445. ex.ToString(),
  2446. LocalPath.LogExePath);
  2447. actionResult.Status = (int)Constant.PDAResult.Exception;
  2448. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2449. }
  2450. return actionResult;
  2451. }
  2452. /// <summary>
  2453. /// 编辑后删除生产数据
  2454. /// </summary>
  2455. /// <param name="productionDataID">生产数据ID</param>
  2456. /// <returns>int</returns>
  2457. public ActionResult DeleteProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2458. {
  2459. ActionResult actionResult = new ActionResult();
  2460. try
  2461. {
  2462. // 验证请求头信息
  2463. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2464. // 验证失败
  2465. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2466. {
  2467. return actionResult;
  2468. }
  2469. int row = ServiceInvoker.Invoke<int>(this,
  2470. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2471. actionResult.Result = JsonHelper.ToJson(row);
  2472. actionResult.Status = (int)Constant.PDAResult.Success;
  2473. }
  2474. catch (Exception ex)
  2475. {
  2476. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2477. OutputLog.TraceLog(LogPriority.Error,
  2478. this.ToString(),
  2479. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2480. ex.ToString(),
  2481. LocalPath.LogExePath);
  2482. actionResult.Status = (int)Constant.PDAResult.Exception;
  2483. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2484. }
  2485. return actionResult;
  2486. }
  2487. /// <summary>
  2488. /// 获取产品完成工序的ID
  2489. /// </summary>
  2490. /// <param name="barcode">产品条码</param>
  2491. /// <returns>int</returns>
  2492. public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2493. {
  2494. ActionResult actionResult = new ActionResult();
  2495. try
  2496. {
  2497. // 验证请求头信息
  2498. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2499. // 验证失败
  2500. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2501. {
  2502. return actionResult;
  2503. }
  2504. int row = ServiceInvoker.Invoke<int>(this,
  2505. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2506. actionResult.Result = JsonHelper.ToJson(row);
  2507. actionResult.Status = (int)Constant.PDAResult.Success;
  2508. }
  2509. catch (Exception ex)
  2510. {
  2511. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2512. OutputLog.TraceLog(LogPriority.Error,
  2513. this.ToString(),
  2514. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2515. ex.ToString(),
  2516. LocalPath.LogExePath);
  2517. actionResult.Status = (int)Constant.PDAResult.Exception;
  2518. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2519. }
  2520. return actionResult;
  2521. }
  2522. /// <summary>
  2523. /// 绑定图片
  2524. /// </summary>
  2525. /// <param name="accountCode">帐套code</param>
  2526. /// <param name="userCode">用户code</param>
  2527. /// <param name="userPassword">用户密码</param>
  2528. /// <param name="sessionKey">本次登陆密钥</param>
  2529. /// <param name="imagePath">图片路径</param>
  2530. /// <returns></returns>
  2531. public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2532. {
  2533. try
  2534. {
  2535. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2536. }
  2537. catch (Exception ex)
  2538. {
  2539. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2540. OutputLog.TraceLog(LogPriority.Error,
  2541. this.ToString(),
  2542. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2543. ex.ToString(),
  2544. LocalPath.LogExePath);
  2545. return null;
  2546. }
  2547. }
  2548. /// <summary>
  2549. /// 根据所选工号对应的工种,查出缺陷责任员工
  2550. /// </summary>
  2551. /// <param name="jobs">工种ID</param>
  2552. /// <returns></returns>
  2553. public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2554. {
  2555. ActionResult actionResult = new ActionResult();
  2556. try
  2557. {
  2558. // 验证请求头信息
  2559. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2560. // 验证失败
  2561. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2562. {
  2563. return actionResult;
  2564. }
  2565. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2566. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2567. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2568. {
  2569. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2570. actionResult.Status = (int)Constant.PDAResult.Success;
  2571. }
  2572. else
  2573. {
  2574. actionResult.Status = (int)Constant.PDAResult.Fail;
  2575. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2576. }
  2577. }
  2578. catch (Exception ex)
  2579. {
  2580. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2581. OutputLog.TraceLog(LogPriority.Error,
  2582. this.ToString(),
  2583. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2584. ex.ToString(),
  2585. LocalPath.LogExePath);
  2586. actionResult.Status = (int)Constant.PDAResult.Exception;
  2587. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2588. }
  2589. return actionResult;
  2590. }
  2591. #region 产品报废
  2592. /// <summary>
  2593. /// 验证废弃产品唯一性
  2594. /// </summary>
  2595. /// <param name="barcode">产品条码</param>
  2596. /// <returns>int</returns>
  2597. public ActionResult ScrapProductChack(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2598. {
  2599. ActionResult actionResult = new ActionResult();
  2600. try
  2601. {
  2602. // 验证请求头信息
  2603. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2604. // 验证失败
  2605. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2606. {
  2607. return actionResult;
  2608. }
  2609. string row = ServiceInvoker.Invoke<string>(this,
  2610. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2611. string[] rm = row.Split(':');
  2612. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2613. if (rm.Length > 1)
  2614. {
  2615. actionResult.Message = rm[1];
  2616. }
  2617. actionResult.Status = (int)Constant.PDAResult.Success;
  2618. }
  2619. catch (Exception ex)
  2620. {
  2621. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2622. OutputLog.TraceLog(LogPriority.Error,
  2623. this.ToString(),
  2624. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2625. ex.ToString(),
  2626. LocalPath.LogExePath);
  2627. actionResult.Status = (int)Constant.PDAResult.Exception;
  2628. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2629. }
  2630. return actionResult;
  2631. }
  2632. /// <summary>
  2633. /// 根据条码获取该产品的在产信息以及生产数据
  2634. /// </summary>
  2635. /// <param name="Barcode">产品条码</param>
  2636. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2637. public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2638. {
  2639. ActionResult actionResult = new ActionResult();
  2640. try
  2641. {
  2642. // 验证请求头信息
  2643. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2644. // 验证失败
  2645. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2646. {
  2647. return actionResult;
  2648. }
  2649. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2650. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2651. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2652. {
  2653. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2654. actionResult.Status = (int)Constant.PDAResult.Success;
  2655. }
  2656. else
  2657. {
  2658. actionResult.Status = (int)Constant.PDAResult.Fail;
  2659. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2660. }
  2661. }
  2662. catch (Exception ex)
  2663. {
  2664. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2665. OutputLog.TraceLog(LogPriority.Error,
  2666. this.ToString(),
  2667. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2668. ex.ToString(),
  2669. LocalPath.LogExePath);
  2670. actionResult.Status = (int)Constant.PDAResult.Exception;
  2671. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2672. }
  2673. return actionResult;
  2674. }
  2675. /// <summary>
  2676. /// 根据工号查询员工档案信息
  2677. /// </summary>
  2678. /// <param name="accountCode"></param>
  2679. /// <param name="userCode"></param>
  2680. /// <param name="userPassword"></param>
  2681. /// <param name="sessionKey"></param>
  2682. /// <param name="userId"></param>
  2683. /// <returns></returns>
  2684. public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2685. {
  2686. ActionResult actionResult = new ActionResult();
  2687. try
  2688. {
  2689. // 验证请求头信息
  2690. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2691. // 验证失败
  2692. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2693. {
  2694. return actionResult;
  2695. }
  2696. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2697. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2698. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2699. {
  2700. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2701. actionResult.Status = (int)Constant.PDAResult.Success;
  2702. }
  2703. else
  2704. {
  2705. actionResult.Status = (int)Constant.PDAResult.Fail;
  2706. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2707. }
  2708. }
  2709. catch (Exception ex)
  2710. {
  2711. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2712. OutputLog.TraceLog(LogPriority.Error,
  2713. this.ToString(),
  2714. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2715. ex.ToString(),
  2716. LocalPath.LogExePath);
  2717. actionResult.Status = (int)Constant.PDAResult.Exception;
  2718. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2719. }
  2720. return actionResult;
  2721. }
  2722. /// <summary>
  2723. /// 添加废弃产品记录
  2724. /// </summary>
  2725. /// <param name="SProductEntity">废弃产品实体</param>
  2726. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2727. /// <param name="SResponsibleList">责任者集合</param>
  2728. /// <param name="userInfo">用户基本信息</param>
  2729. /// <returns>int结果返回值</returns>
  2730. /// <remarks>
  2731. /// 庄天威 2014.09.24 新建
  2732. /// </remarks>
  2733. public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey,
  2734. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2735. ScrapResponsibleEntity[] SResponsibleList)
  2736. {
  2737. ActionResult actionResult = new ActionResult();
  2738. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2739. {
  2740. actionResult.Status = (int)Constant.PDAResult.Fail;
  2741. actionResult.Message = "没有选择责任人";
  2742. }
  2743. try
  2744. {
  2745. // 验证请求头信息
  2746. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2747. // 验证失败
  2748. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2749. {
  2750. return actionResult;
  2751. }
  2752. int addRow = ServiceInvoker.Invoke<int>(this,
  2753. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  2754. actionResult.Result = JsonHelper.ToJson(addRow);
  2755. actionResult.Status = (int)Constant.PDAResult.Success;
  2756. }
  2757. catch (Exception ex)
  2758. {
  2759. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2760. OutputLog.TraceLog(LogPriority.Error,
  2761. this.ToString(),
  2762. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2763. ex.ToString(),
  2764. LocalPath.LogExePath);
  2765. actionResult.Status = (int)Constant.PDAResult.Exception;
  2766. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2767. // TODO 空指针异常问题检测
  2768. try
  2769. {
  2770. OutputLog.TraceLog(LogPriority.Error,
  2771. this.ToString(),
  2772. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2773. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  2774. LocalPath.LogExePath);
  2775. string json1 = JsonHelper.ToJson(SProductEntity);
  2776. OutputLog.TraceLog(LogPriority.Error,
  2777. this.ToString(),
  2778. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2779. "SProductEntity:" + json1,
  2780. LocalPath.LogExePath);
  2781. string json2 = JsonHelper.ToJson(RProcedureEntity);
  2782. OutputLog.TraceLog(LogPriority.Error,
  2783. this.ToString(),
  2784. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2785. "RProcedureEntity:" + json2,
  2786. LocalPath.LogExePath);
  2787. string json3 = JsonHelper.ToJson(SResponsibleList);
  2788. OutputLog.TraceLog(LogPriority.Error,
  2789. this.ToString(),
  2790. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2791. "SResponsibleList:" + json3,
  2792. LocalPath.LogExePath);
  2793. }
  2794. catch (Exception exc)
  2795. {
  2796. OutputLog.TraceLog(LogPriority.Error,
  2797. this.ToString(),
  2798. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2799. "参数输入异常:" + exc.Message,
  2800. LocalPath.LogExePath);
  2801. }
  2802. }
  2803. return actionResult;
  2804. }
  2805. /// <summary>
  2806. /// 获取产品分级的数据(根据ID)
  2807. /// </summary>
  2808. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  2809. /// <param name="GoodsLevelID">分类ID</param>
  2810. /// <param name="sUserInfo">用户基本信息</param>
  2811. /// <returns>DataSet</returns>
  2812. /// <remarks>
  2813. /// 2014.10.22 庄天威 新建
  2814. public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  2815. {
  2816. ActionResult actionResult = new ActionResult();
  2817. try
  2818. {
  2819. // 验证请求头信息
  2820. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2821. // 验证失败
  2822. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2823. {
  2824. return actionResult;
  2825. }
  2826. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2827. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  2828. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2829. {
  2830. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2831. actionResult.Status = (int)Constant.PDAResult.Success;
  2832. }
  2833. else
  2834. {
  2835. actionResult.Status = (int)Constant.PDAResult.Fail;
  2836. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2837. }
  2838. }
  2839. catch (Exception ex)
  2840. {
  2841. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2842. OutputLog.TraceLog(LogPriority.Error,
  2843. this.ToString(),
  2844. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2845. ex.ToString(),
  2846. LocalPath.LogExePath);
  2847. actionResult.Status = (int)Constant.PDAResult.Exception;
  2848. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2849. }
  2850. return actionResult;
  2851. }
  2852. /// <summary>
  2853. /// 获取账务日期
  2854. /// </summary>
  2855. /// <param name="accountCode"></param>
  2856. /// <param name="userCode"></param>
  2857. /// <param name="userPassword"></param>
  2858. /// <param name="sessionKey"></param>
  2859. /// <returns></returns>
  2860. public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey)
  2861. {
  2862. ActionResult actionResult = new ActionResult();
  2863. try
  2864. {
  2865. // 验证请求头信息
  2866. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2867. // 验证失败
  2868. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2869. {
  2870. return actionResult;
  2871. }
  2872. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  2873. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  2874. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2875. actionResult.Status = (int)Constant.PDAResult.Success;
  2876. }
  2877. catch (Exception ex)
  2878. {
  2879. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2880. OutputLog.TraceLog(LogPriority.Error,
  2881. this.ToString(),
  2882. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2883. ex.ToString(),
  2884. LocalPath.LogExePath);
  2885. actionResult.Status = (int)Constant.PDAResult.Exception;
  2886. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2887. }
  2888. return actionResult;
  2889. }
  2890. /// <summary>
  2891. /// 获取登陆帐户有无报损权限
  2892. /// </summary>
  2893. /// <param name="accountCode"></param>
  2894. /// <param name="userCode"></param>
  2895. /// <param name="userPassword"></param>
  2896. /// <param name="sessionKey"></param>
  2897. /// <param name="usercode">工号编码</param>
  2898. /// <returns></returns>
  2899. public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  2900. {
  2901. ActionResult actionResult = new ActionResult();
  2902. try
  2903. {
  2904. // 验证请求头信息
  2905. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2906. // 验证失败
  2907. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2908. {
  2909. return actionResult;
  2910. }
  2911. int returnValue = ServiceInvoker.Invoke<int>(this,
  2912. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  2913. actionResult.Result = JsonHelper.ToJson(returnValue);
  2914. actionResult.Status = (int)Constant.PDAResult.Success;
  2915. }
  2916. catch (Exception ex)
  2917. {
  2918. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2919. OutputLog.TraceLog(LogPriority.Error,
  2920. this.ToString(),
  2921. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2922. ex.ToString(),
  2923. LocalPath.LogExePath);
  2924. actionResult.Status = (int)Constant.PDAResult.Exception;
  2925. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2926. }
  2927. return actionResult;
  2928. }
  2929. #endregion
  2930. /// <summary>
  2931. /// 获取是否存在报损未审核产品
  2932. /// </summary>
  2933. /// <param name="barcode">产品条码</param>
  2934. /// <returns>int</returns>
  2935. public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2936. {
  2937. ActionResult actionResult = new ActionResult();
  2938. try
  2939. {
  2940. // 验证请求头信息
  2941. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2942. // 验证失败
  2943. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2944. {
  2945. return actionResult;
  2946. }
  2947. int row = ServiceInvoker.Invoke<int>(this,
  2948. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  2949. actionResult.Result = JsonHelper.ToJson(row);
  2950. actionResult.Status = (int)Constant.PDAResult.Success;
  2951. }
  2952. catch (Exception ex)
  2953. {
  2954. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2955. OutputLog.TraceLog(LogPriority.Error,
  2956. this.ToString(),
  2957. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2958. ex.ToString(),
  2959. LocalPath.LogExePath);
  2960. actionResult.Status = (int)Constant.PDAResult.Exception;
  2961. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2962. }
  2963. return actionResult;
  2964. }
  2965. /// <summary>
  2966. /// 查询报废产品信息
  2967. /// </summary>
  2968. /// <param name="accountCode"></param>
  2969. /// <param name="userCode"></param>
  2970. /// <param name="userPassword"></param>
  2971. /// <param name="sessionKey"></param>
  2972. /// <param name="barCode">产品条码</param>
  2973. /// <param name="scrapProductID">报废产品ID</param>
  2974. /// <returns></returns>
  2975. public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  2976. {
  2977. ActionResult actionResult = new ActionResult();
  2978. try
  2979. {
  2980. // 验证请求头信息
  2981. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2982. // 验证失败
  2983. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2984. {
  2985. return actionResult;
  2986. }
  2987. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  2988. selectProEntity.BarCode = barCode;
  2989. selectProEntity.ScrapProductID = scrapProductID;
  2990. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2991. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  2992. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2993. {
  2994. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2995. actionResult.Status = (int)Constant.PDAResult.Success;
  2996. }
  2997. else
  2998. {
  2999. actionResult.Status = (int)Constant.PDAResult.Fail;
  3000. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3001. }
  3002. }
  3003. catch (Exception ex)
  3004. {
  3005. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3006. OutputLog.TraceLog(LogPriority.Error,
  3007. this.ToString(),
  3008. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3009. ex.ToString(),
  3010. LocalPath.LogExePath);
  3011. actionResult.Status = (int)Constant.PDAResult.Exception;
  3012. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3013. }
  3014. return actionResult;
  3015. }
  3016. /// <summary>
  3017. /// 根据废弃产品ID获取责任工序
  3018. /// </summary>
  3019. /// <param name="accountCode"></param>
  3020. /// <param name="userCode"></param>
  3021. /// <param name="userPassword"></param>
  3022. /// <param name="sessionKey"></param>
  3023. /// <param name="scrapProductID">报废产品ID</param>
  3024. /// <returns></returns>
  3025. public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3026. {
  3027. ActionResult actionResult = new ActionResult();
  3028. try
  3029. {
  3030. // 验证请求头信息
  3031. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3032. // 验证失败
  3033. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3034. {
  3035. return actionResult;
  3036. }
  3037. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3038. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  3039. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3040. {
  3041. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3042. actionResult.Status = (int)Constant.PDAResult.Success;
  3043. }
  3044. else
  3045. {
  3046. actionResult.Status = (int)Constant.PDAResult.Fail;
  3047. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3048. }
  3049. }
  3050. catch (Exception ex)
  3051. {
  3052. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3053. OutputLog.TraceLog(LogPriority.Error,
  3054. this.ToString(),
  3055. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3056. ex.ToString(),
  3057. LocalPath.LogExePath);
  3058. actionResult.Status = (int)Constant.PDAResult.Exception;
  3059. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3060. }
  3061. return actionResult;
  3062. }
  3063. /// <summary>
  3064. /// 根据废弃产品ID获取责任人列表
  3065. /// </summary>
  3066. /// <param name="accountCode"></param>
  3067. /// <param name="userCode"></param>
  3068. /// <param name="userPassword"></param>
  3069. /// <param name="sessionKey"></param>
  3070. /// <param name="scrapProductID">报废产品ID</param>
  3071. /// <returns></returns>
  3072. public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3073. {
  3074. ActionResult actionResult = new ActionResult();
  3075. try
  3076. {
  3077. // 验证请求头信息
  3078. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3079. // 验证失败
  3080. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3081. {
  3082. return actionResult;
  3083. }
  3084. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3085. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  3086. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3087. {
  3088. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3089. actionResult.Status = (int)Constant.PDAResult.Success;
  3090. }
  3091. else
  3092. {
  3093. actionResult.Status = (int)Constant.PDAResult.Fail;
  3094. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3095. }
  3096. }
  3097. catch (Exception ex)
  3098. {
  3099. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3100. OutputLog.TraceLog(LogPriority.Error,
  3101. this.ToString(),
  3102. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3103. ex.ToString(),
  3104. LocalPath.LogExePath);
  3105. actionResult.Status = (int)Constant.PDAResult.Exception;
  3106. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3107. }
  3108. return actionResult;
  3109. }
  3110. /// <summary>
  3111. /// 添加废弃产品记录
  3112. /// </summary>
  3113. /// <param name="SProductEntity">废弃产品实体</param>
  3114. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3115. /// <param name="SResponsibleList">责任者集合</param>
  3116. /// <param name="userInfo">用户基本信息</param>
  3117. /// <returns>int结果返回值</returns>
  3118. /// <remarks>
  3119. /// 庄天威 2014.09.24 新建
  3120. /// </remarks>
  3121. public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3122. ResponProcedureEntity UpdateRProcedureEntity,
  3123. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3124. {
  3125. ActionResult actionResult = new ActionResult();
  3126. try
  3127. {
  3128. // 验证请求头信息
  3129. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3130. // 验证失败
  3131. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3132. {
  3133. return actionResult;
  3134. }
  3135. int addRow = ServiceInvoker.Invoke<int>(this,
  3136. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3137. actionResult.Result = JsonHelper.ToJson(addRow);
  3138. actionResult.Status = (int)Constant.PDAResult.Success;
  3139. }
  3140. catch (Exception ex)
  3141. {
  3142. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3143. OutputLog.TraceLog(LogPriority.Error,
  3144. this.ToString(),
  3145. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3146. ex.ToString(),
  3147. LocalPath.LogExePath);
  3148. actionResult.Status = (int)Constant.PDAResult.Exception;
  3149. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3150. }
  3151. return actionResult;
  3152. }
  3153. /// <summary>
  3154. /// 获取产品窑炉
  3155. /// </summary>
  3156. /// <param name="accountCode"></param>
  3157. /// <param name="userCode"></param>
  3158. /// <param name="userPassword"></param>
  3159. /// <param name="sessionKey"></param>
  3160. /// <returns>Datase</returns>
  3161. public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  3162. {
  3163. ActionResult actionResult = new ActionResult();
  3164. try
  3165. {
  3166. // 验证请求头信息
  3167. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3168. // 验证失败
  3169. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3170. {
  3171. return actionResult;
  3172. }
  3173. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3174. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3175. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3176. {
  3177. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3178. actionResult.Status = (int)Constant.PDAResult.Success;
  3179. }
  3180. else
  3181. {
  3182. actionResult.Status = (int)Constant.PDAResult.Fail;
  3183. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3184. }
  3185. }
  3186. catch (Exception ex)
  3187. {
  3188. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3189. OutputLog.TraceLog(LogPriority.Error,
  3190. this.ToString(),
  3191. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3192. ex.ToString(),
  3193. LocalPath.LogExePath);
  3194. actionResult.Status = (int)Constant.PDAResult.Exception;
  3195. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3196. }
  3197. return actionResult;
  3198. }
  3199. /// <summary>
  3200. /// 获取次品产品条码允许编辑
  3201. /// </summary>
  3202. /// <param name="accountCode"></param>
  3203. /// <param name="userCode"></param>
  3204. /// <param name="userPassword"></param>
  3205. /// <param name="sessionKey"></param>
  3206. /// <param name="barcode">产品条码</param>
  3207. /// <returns>Datase</returns>
  3208. public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3209. {
  3210. ActionResult actionResult = new ActionResult();
  3211. try
  3212. {
  3213. // 验证请求头信息
  3214. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3215. // 验证失败
  3216. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3217. {
  3218. return actionResult;
  3219. }
  3220. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3221. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3222. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3223. {
  3224. actionResult.Result = JsonHelper.ToJson(1);
  3225. actionResult.Status = (int)Constant.PDAResult.Success;
  3226. }
  3227. else
  3228. {
  3229. actionResult.Result = JsonHelper.ToJson(0);
  3230. actionResult.Status = (int)Constant.PDAResult.Fail;
  3231. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3232. }
  3233. }
  3234. catch (Exception ex)
  3235. {
  3236. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3237. OutputLog.TraceLog(LogPriority.Error,
  3238. this.ToString(),
  3239. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3240. ex.ToString(),
  3241. LocalPath.LogExePath);
  3242. actionResult.Status = (int)Constant.PDAResult.Exception;
  3243. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3244. }
  3245. return actionResult;
  3246. }
  3247. /// <summary>
  3248. /// 获取产品条码是否重烧
  3249. /// </summary>
  3250. /// <param name="accountCode"></param>
  3251. /// <param name="userCode"></param>
  3252. /// <param name="userPassword"></param>
  3253. /// <param name="sessionKey"></param>
  3254. /// <param name="barcode">产品条码</param>
  3255. /// <returns>Datase</returns>
  3256. public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3257. {
  3258. ActionResult actionResult = new ActionResult();
  3259. try
  3260. {
  3261. // 验证请求头信息
  3262. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3263. // 验证失败
  3264. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3265. {
  3266. return actionResult;
  3267. }
  3268. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3269. () => PDAModuleLogic.GetReFine(barcode));
  3270. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3271. {
  3272. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3273. }
  3274. else
  3275. {
  3276. actionResult.Result = JsonHelper.ToJson(0);
  3277. }
  3278. actionResult.Status = (int)Constant.PDAResult.Success;
  3279. }
  3280. catch (Exception ex)
  3281. {
  3282. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3283. OutputLog.TraceLog(LogPriority.Error,
  3284. this.ToString(),
  3285. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3286. ex.ToString(),
  3287. LocalPath.LogExePath);
  3288. actionResult.Status = (int)Constant.PDAResult.Exception;
  3289. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3290. }
  3291. return actionResult;
  3292. }
  3293. /// <summary>
  3294. /// 获取登陆帐户有无成检编辑权限
  3295. /// </summary>
  3296. /// <param name="accountCode"></param>
  3297. /// <param name="userCode"></param>
  3298. /// <param name="userPassword"></param>
  3299. /// <param name="sessionKey"></param>
  3300. /// <param name="usercode">工号编码</param>
  3301. /// <returns></returns>
  3302. public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3303. {
  3304. ActionResult actionResult = new ActionResult();
  3305. try
  3306. {
  3307. // 验证请求头信息
  3308. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3309. // 验证失败
  3310. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3311. {
  3312. return actionResult;
  3313. }
  3314. int returnValue = ServiceInvoker.Invoke<int>(this,
  3315. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3316. actionResult.Result = JsonHelper.ToJson(returnValue);
  3317. actionResult.Status = (int)Constant.PDAResult.Success;
  3318. }
  3319. catch (Exception ex)
  3320. {
  3321. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3322. OutputLog.TraceLog(LogPriority.Error,
  3323. this.ToString(),
  3324. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3325. ex.ToString(),
  3326. LocalPath.LogExePath);
  3327. actionResult.Status = (int)Constant.PDAResult.Exception;
  3328. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3329. }
  3330. return actionResult;
  3331. }
  3332. /// <summary>
  3333. /// 根据条码及工序判断是否漏扫
  3334. /// </summary>
  3335. /// <param name="accountCode"></param>
  3336. /// <param name="userCode"></param>
  3337. /// <param name="userPassword"></param>
  3338. /// <param name="sessionKey"></param>
  3339. /// <param name="usercode">工号编码</param>
  3340. /// <param name="barcode">产品条码</param>
  3341. /// <param name="produceid">工序ID</param>
  3342. /// <returns></returns>
  3343. public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3344. {
  3345. ActionResult actionResult = new ActionResult();
  3346. try
  3347. {
  3348. // 验证请求头信息
  3349. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3350. // 验证失败
  3351. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3352. {
  3353. return actionResult;
  3354. }
  3355. int returnValue = 1;
  3356. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3357. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3358. actionResult.Result = JsonHelper.ToJson(returnValue);
  3359. actionResult.Status = (int)Constant.PDAResult.Success;
  3360. }
  3361. catch (Exception ex)
  3362. {
  3363. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3364. OutputLog.TraceLog(LogPriority.Error,
  3365. this.ToString(),
  3366. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3367. ex.ToString(),
  3368. LocalPath.LogExePath);
  3369. actionResult.Status = (int)Constant.PDAResult.Exception;
  3370. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3371. }
  3372. return actionResult;
  3373. }
  3374. /// <summary>
  3375. /// 获取登陆帐户有无报损审批权限
  3376. /// </summary>
  3377. /// <param name="accountCode"></param>
  3378. /// <param name="userCode"></param>
  3379. /// <param name="userPassword"></param>
  3380. /// <param name="sessionKey"></param>
  3381. /// <param name="usercode">工号编码</param>
  3382. /// <returns></returns>
  3383. public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3384. {
  3385. ActionResult actionResult = new ActionResult();
  3386. try
  3387. {
  3388. // 验证请求头信息
  3389. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3390. // 验证失败
  3391. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3392. {
  3393. return actionResult;
  3394. }
  3395. int returnValue = ServiceInvoker.Invoke<int>(this,
  3396. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3397. actionResult.Result = JsonHelper.ToJson(returnValue);
  3398. actionResult.Status = (int)Constant.PDAResult.Success;
  3399. }
  3400. catch (Exception ex)
  3401. {
  3402. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3403. OutputLog.TraceLog(LogPriority.Error,
  3404. this.ToString(),
  3405. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3406. ex.ToString(),
  3407. LocalPath.LogExePath);
  3408. actionResult.Status = (int)Constant.PDAResult.Exception;
  3409. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3410. }
  3411. return actionResult;
  3412. }
  3413. /// <summary>
  3414. /// 获取登陆帐户有无报损审批权限
  3415. /// </summary>
  3416. /// <param name="accountCode"></param>
  3417. /// <param name="userCode"></param>
  3418. /// <param name="userPassword"></param>
  3419. /// <param name="sessionKey"></param>
  3420. /// <param name="usercode">工号编码</param>
  3421. /// <returns></returns>
  3422. public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3423. {
  3424. ActionResult actionResult = new ActionResult();
  3425. try
  3426. {
  3427. // 验证请求头信息
  3428. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3429. // 验证失败
  3430. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3431. {
  3432. return actionResult;
  3433. }
  3434. int returnValue = ServiceInvoker.Invoke<int>(this,
  3435. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3436. actionResult.Result = JsonHelper.ToJson(returnValue);
  3437. actionResult.Status = (int)Constant.PDAResult.Success;
  3438. }
  3439. catch (Exception ex)
  3440. {
  3441. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3442. OutputLog.TraceLog(LogPriority.Error,
  3443. this.ToString(),
  3444. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3445. ex.ToString(),
  3446. LocalPath.LogExePath);
  3447. actionResult.Status = (int)Constant.PDAResult.Exception;
  3448. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3449. }
  3450. return actionResult;
  3451. }
  3452. /// <summary>
  3453. /// 获取窑车对应产品列表
  3454. /// </summary>
  3455. /// <param name="accountCode"></param>
  3456. /// <param name="userCode"></param>
  3457. /// <param name="userPassword"></param>
  3458. /// <param name="sessionKey"></param>
  3459. /// <param name="KilnCarID">窑车ID</param>
  3460. /// <returns>Dataset</returns>
  3461. public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  3462. {
  3463. ActionResult actionResult = new ActionResult();
  3464. try
  3465. {
  3466. // 验证请求头信息
  3467. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3468. // 验证失败
  3469. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3470. {
  3471. return actionResult;
  3472. }
  3473. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3474. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3475. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3476. {
  3477. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3478. actionResult.Status = (int)Constant.PDAResult.Success;
  3479. }
  3480. else
  3481. {
  3482. actionResult.Status = (int)Constant.PDAResult.Fail;
  3483. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3484. }
  3485. }
  3486. catch (Exception ex)
  3487. {
  3488. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3489. OutputLog.TraceLog(LogPriority.Error,
  3490. this.ToString(),
  3491. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3492. ex.ToString(),
  3493. LocalPath.LogExePath);
  3494. actionResult.Status = (int)Constant.PDAResult.Exception;
  3495. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3496. }
  3497. return actionResult;
  3498. }
  3499. /// <summary>
  3500. /// 更换条码
  3501. /// </summary>
  3502. /// <param name="accountCode"></param>
  3503. /// <param name="userCode"></param>
  3504. /// <param name="userPassword"></param>
  3505. /// <param name="sessionKey"></param>
  3506. ///<param name="barcode">原条码</param>
  3507. /// <param name="newBarcode">新条码</param>
  3508. /// <param name="remarks">备注</param>
  3509. /// <returns>操作结果</returns>
  3510. public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  3511. {
  3512. ActionResult actionResult = new ActionResult();
  3513. try
  3514. {
  3515. // 验证请求头信息
  3516. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3517. // 验证失败
  3518. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3519. {
  3520. return actionResult;
  3521. }
  3522. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3523. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3524. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3525. {
  3526. actionResult.Result = 1;
  3527. actionResult.Status = (int)Constant.PDAResult.Success;
  3528. }
  3529. else
  3530. {
  3531. actionResult.Status = (int)Constant.PDAResult.Fail;
  3532. actionResult.Message = serviceResultEntity.Message;
  3533. }
  3534. }
  3535. catch (Exception ex)
  3536. {
  3537. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3538. OutputLog.TraceLog(LogPriority.Error,
  3539. this.ToString(),
  3540. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3541. ex.ToString(),
  3542. LocalPath.LogExePath);
  3543. actionResult.Status = (int)Constant.PDAResult.Exception;
  3544. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3545. }
  3546. return actionResult;
  3547. }
  3548. /// <summary>
  3549. /// 获取(注浆登记)的查询数据
  3550. /// </summary>
  3551. /// <param name="accountCode"></param>
  3552. /// <param name="userCode"></param>
  3553. /// <param name="userPassword"></param>
  3554. /// <param name="sessionKey"></param>
  3555. /// <param name="se">查询条件</param>
  3556. /// <returns>Dataset</returns>
  3557. public ActionResult GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  3558. {
  3559. ActionResult actionResult = new ActionResult();
  3560. try
  3561. {
  3562. // 验证请求头信息
  3563. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3564. // 验证失败
  3565. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3566. {
  3567. return actionResult;
  3568. }
  3569. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3570. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3571. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3572. {
  3573. // PDA不显示的列删除掉
  3574. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3575. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3576. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3577. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3578. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3579. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3580. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3581. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3582. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3583. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3584. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3585. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3586. actionResult.Status = (int)Constant.PDAResult.Success;
  3587. }
  3588. else
  3589. {
  3590. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3591. actionResult.Message = "无查询数据";
  3592. }
  3593. }
  3594. catch (Exception ex)
  3595. {
  3596. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3597. OutputLog.TraceLog(LogPriority.Error,
  3598. this.ToString(),
  3599. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3600. ex.ToString(),
  3601. LocalPath.LogExePath);
  3602. actionResult.Status = (int)Constant.PDAResult.Exception;
  3603. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3604. }
  3605. return actionResult;
  3606. }
  3607. /// <summary>
  3608. /// 获取(注浆登记)的查询数据
  3609. /// </summary>
  3610. /// <param name="accountCode"></param>
  3611. /// <param name="userCode"></param>
  3612. /// <param name="userPassword"></param>
  3613. /// <param name="sessionKey"></param>
  3614. /// <param name="se">查询条件</param>
  3615. /// <returns>Dataset</returns>
  3616. public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3617. {
  3618. ActionResult actionResult = new ActionResult();
  3619. try
  3620. {
  3621. // 验证请求头信息
  3622. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3623. // 验证失败
  3624. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3625. {
  3626. return actionResult;
  3627. }
  3628. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3629. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3630. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3631. {
  3632. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3633. actionResult.Status = (int)Constant.PDAResult.Success;
  3634. }
  3635. else
  3636. {
  3637. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3638. actionResult.Message = "无查询数据";
  3639. }
  3640. }
  3641. catch (Exception ex)
  3642. {
  3643. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3644. OutputLog.TraceLog(LogPriority.Error,
  3645. this.ToString(),
  3646. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3647. ex.ToString(),
  3648. LocalPath.LogExePath);
  3649. actionResult.Status = (int)Constant.PDAResult.Exception;
  3650. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3651. }
  3652. return actionResult;
  3653. }
  3654. /// <summary>
  3655. ///获得成型线信息
  3656. /// </summary>
  3657. /// <param name="accountCode"></param>
  3658. /// <param name="userCode"></param>
  3659. /// <param name="userPassword"></param>
  3660. /// <param name="sessionKey"></param>
  3661. /// <param name="se">查询条件</param>
  3662. /// <returns>Dataset</returns>
  3663. public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3664. {
  3665. ActionResult actionResult = new ActionResult();
  3666. try
  3667. {
  3668. // 验证请求头信息
  3669. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3670. // 验证失败
  3671. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3672. {
  3673. return actionResult;
  3674. }
  3675. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3676. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3677. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3678. {
  3679. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3680. actionResult.Status = (int)Constant.PDAResult.Success;
  3681. }
  3682. else
  3683. {
  3684. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3685. actionResult.Message = "无查询数据";
  3686. }
  3687. }
  3688. catch (Exception ex)
  3689. {
  3690. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3691. OutputLog.TraceLog(LogPriority.Error,
  3692. this.ToString(),
  3693. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3694. ex.ToString(),
  3695. LocalPath.LogExePath);
  3696. actionResult.Status = (int)Constant.PDAResult.Exception;
  3697. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3698. }
  3699. return actionResult;
  3700. }
  3701. /// <summary>
  3702. ///获取在产产品的信息标识列表
  3703. /// </summary>
  3704. /// <param name="accountCode"></param>
  3705. /// <param name="userCode"></param>
  3706. /// <param name="userPassword"></param>
  3707. /// <param name="sessionKey"></param>
  3708. /// <param name="barcode">查询条件</param>
  3709. /// <returns>Dataset</returns>
  3710. public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3711. {
  3712. ActionResult actionResult = new ActionResult();
  3713. try
  3714. {
  3715. // 验证请求头信息
  3716. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3717. // 验证失败
  3718. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3719. {
  3720. return actionResult;
  3721. }
  3722. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3723. () => PMModuleLogic.GetInProductionDataList(barcode));
  3724. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3725. {
  3726. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3727. actionResult.Status = (int)Constant.PDAResult.Success;
  3728. }
  3729. else
  3730. {
  3731. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3732. actionResult.Message = "无查询数据";
  3733. }
  3734. }
  3735. catch (Exception ex)
  3736. {
  3737. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3738. OutputLog.TraceLog(LogPriority.Error,
  3739. this.ToString(),
  3740. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3741. ex.ToString(),
  3742. LocalPath.LogExePath);
  3743. actionResult.Status = (int)Constant.PDAResult.Exception;
  3744. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3745. }
  3746. return actionResult;
  3747. }
  3748. /// <summary>
  3749. ///获取条码是否注浆登记过,0行无效
  3750. /// </summary>
  3751. /// <param name="accountCode"></param>
  3752. /// <param name="userCode"></param>
  3753. /// <param name="userPassword"></param>
  3754. /// <param name="sessionKey"></param>
  3755. /// <param name="barcode">查询条件</param>
  3756. /// <returns>Dataset</returns>
  3757. public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3758. {
  3759. ActionResult actionResult = new ActionResult();
  3760. try
  3761. {
  3762. // 验证请求头信息
  3763. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3764. // 验证失败
  3765. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3766. {
  3767. return actionResult;
  3768. }
  3769. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3770. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  3771. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3772. {
  3773. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3774. actionResult.Status = (int)Constant.PDAResult.Success;
  3775. }
  3776. else
  3777. {
  3778. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3779. actionResult.Message = "该产品条码无效,无法报损!";
  3780. }
  3781. }
  3782. catch (Exception ex)
  3783. {
  3784. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3785. OutputLog.TraceLog(LogPriority.Error,
  3786. this.ToString(),
  3787. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3788. ex.ToString(),
  3789. LocalPath.LogExePath);
  3790. actionResult.Status = (int)Constant.PDAResult.Exception;
  3791. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3792. }
  3793. return actionResult;
  3794. }
  3795. /// <summary>
  3796. /// 获取登陆帐户有变更条码权限
  3797. /// </summary>
  3798. /// <param name="accountCode"></param>
  3799. /// <param name="userCode"></param>
  3800. /// <param name="userPassword"></param>
  3801. /// <param name="sessionKey"></param>
  3802. /// <returns></returns>
  3803. public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3804. {
  3805. ActionResult actionResult = new ActionResult();
  3806. try
  3807. {
  3808. // 验证请求头信息
  3809. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3810. // 验证失败
  3811. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3812. {
  3813. return actionResult;
  3814. }
  3815. int returnValue = ServiceInvoker.Invoke<int>(this,
  3816. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  3817. actionResult.Result = JsonHelper.ToJson(returnValue);
  3818. actionResult.Status = (int)Constant.PDAResult.Success;
  3819. }
  3820. catch (Exception ex)
  3821. {
  3822. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3823. OutputLog.TraceLog(LogPriority.Error,
  3824. this.ToString(),
  3825. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3826. ex.ToString(),
  3827. LocalPath.LogExePath);
  3828. actionResult.Status = (int)Constant.PDAResult.Exception;
  3829. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3830. }
  3831. return actionResult;
  3832. }
  3833. /// <summary>
  3834. /// 成检时获取此条码是否报损
  3835. /// </summary>
  3836. /// <param name="accountCode"></param>
  3837. /// <param name="userCode"></param>
  3838. /// <param name="userPassword"></param>
  3839. /// <param name="sessionKey"></param>
  3840. /// <param name="barcode">产品条码</param>
  3841. /// <returns></returns>
  3842. public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3843. {
  3844. ActionResult actionResult = new ActionResult();
  3845. try
  3846. {
  3847. // 验证请求头信息
  3848. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3849. // 验证失败
  3850. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3851. {
  3852. return actionResult;
  3853. }
  3854. int returnValue = ServiceInvoker.Invoke<int>(this,
  3855. () => PMModuleLogic.CheckScrapProduct(barcode));
  3856. if (returnValue == -100)
  3857. {
  3858. actionResult.Result = JsonHelper.ToJson(returnValue);
  3859. actionResult.Status = (int)Constant.PDAResult.Success;
  3860. }
  3861. else
  3862. {
  3863. actionResult.Status = (int)Constant.PDAResult.Fail;
  3864. if (returnValue == 0)
  3865. {
  3866. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  3867. }
  3868. else
  3869. {
  3870. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  3871. }
  3872. }
  3873. }
  3874. catch (Exception ex)
  3875. {
  3876. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3877. OutputLog.TraceLog(LogPriority.Error,
  3878. this.ToString(),
  3879. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3880. ex.ToString(),
  3881. LocalPath.LogExePath);
  3882. actionResult.Status = (int)Constant.PDAResult.Exception;
  3883. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3884. }
  3885. return actionResult;
  3886. }
  3887. /// <summary>
  3888. /// 获取产品完成工序的ID(PDA)
  3889. /// </summary>
  3890. /// <param name="barcode">产品条码</param>
  3891. /// <returns>int</returns>
  3892. public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3893. {
  3894. ActionResult actionResult = new ActionResult();
  3895. try
  3896. {
  3897. // 验证请求头信息
  3898. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3899. // 验证失败
  3900. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3901. {
  3902. return actionResult;
  3903. }
  3904. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3905. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  3906. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3907. actionResult.Status = (int)Constant.PDAResult.Success;
  3908. }
  3909. catch (Exception ex)
  3910. {
  3911. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3912. OutputLog.TraceLog(LogPriority.Error,
  3913. this.ToString(),
  3914. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3915. ex.ToString(),
  3916. LocalPath.LogExePath);
  3917. actionResult.Status = (int)Constant.PDAResult.Exception;
  3918. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3919. }
  3920. return actionResult;
  3921. }
  3922. /// <summary>
  3923. /// 获取产品完成工序的ID(PDA)
  3924. /// </summary>
  3925. /// <param name="barcode">产品条码</param>
  3926. /// <returns>int</returns>
  3927. public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3928. {
  3929. ActionResult actionResult = new ActionResult();
  3930. try
  3931. {
  3932. // 验证请求头信息
  3933. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3934. // 验证失败
  3935. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3936. {
  3937. return actionResult;
  3938. }
  3939. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3940. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  3941. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3942. actionResult.Status = (int)Constant.PDAResult.Success;
  3943. }
  3944. catch (Exception ex)
  3945. {
  3946. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3947. OutputLog.TraceLog(LogPriority.Error,
  3948. this.ToString(),
  3949. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3950. ex.ToString(),
  3951. LocalPath.LogExePath);
  3952. actionResult.Status = (int)Constant.PDAResult.Exception;
  3953. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3954. }
  3955. return actionResult;
  3956. }
  3957. /// <summary>
  3958. /// 成检-校验生产工号
  3959. /// </summary>
  3960. /// <param name="usercode">生产工号</param>
  3961. /// <returns>int</returns>
  3962. public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode)
  3963. {
  3964. ActionResult actionResult = new ActionResult();
  3965. try
  3966. {
  3967. // 验证请求头信息
  3968. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3969. // 验证失败
  3970. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3971. {
  3972. return actionResult;
  3973. }
  3974. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3975. () => PDAModuleLogic.GetUserCode(usercode, sUserInfo));
  3976. actionResult.Result = JsonHelper.ToJson(ds);
  3977. actionResult.Status = (int)Constant.PDAResult.Success;
  3978. }
  3979. catch (Exception ex)
  3980. {
  3981. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3982. OutputLog.TraceLog(LogPriority.Error,
  3983. this.ToString(),
  3984. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3985. ex.ToString(),
  3986. LocalPath.LogExePath);
  3987. actionResult.Status = (int)Constant.PDAResult.Exception;
  3988. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3989. }
  3990. return actionResult;
  3991. }
  3992. /// <summary>
  3993. /// 更新漏扫的成型工号
  3994. /// </summary>
  3995. /// <param name="accountCode"></param>
  3996. /// <param name="userCode"></param>
  3997. /// <param name="userPassword"></param>
  3998. /// <param name="sessionKey"></param>
  3999. /// <param name="groutingUserCode">成型工号</param>
  4000. /// <param name="missingID">漏扫ID</param>
  4001. /// <returns></returns>
  4002. public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  4003. {
  4004. ActionResult actionResult = new ActionResult();
  4005. try
  4006. {
  4007. // 验证请求头信息
  4008. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4009. // 验证失败
  4010. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4011. {
  4012. return actionResult;
  4013. }
  4014. int returnValue = ServiceInvoker.Invoke<int>(this,
  4015. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  4016. if (returnValue != -1)
  4017. {
  4018. actionResult.Result = JsonHelper.ToJson(returnValue);
  4019. actionResult.Status = (int)Constant.PDAResult.Success;
  4020. }
  4021. else
  4022. {
  4023. actionResult.Status = (int)Constant.PDAResult.Fail;
  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="accountCode"></param>
  4044. /// <param name="userCode"></param>
  4045. /// <param name="userPassword"></param>
  4046. /// <param name="sessionKey"></param>
  4047. /// <param name="kilncarcode">窑车编码</param>
  4048. /// <param name="procedureid">工序ID</param>
  4049. /// <returns></returns>
  4050. public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4051. {
  4052. ActionResult actionResult = new ActionResult();
  4053. try
  4054. {
  4055. // 验证请求头信息
  4056. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4057. // 验证失败
  4058. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4059. {
  4060. return actionResult;
  4061. }
  4062. int returnValue = ServiceInvoker.Invoke<int>(this,
  4063. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  4064. if (returnValue == 1)
  4065. {
  4066. actionResult.Result = JsonHelper.ToJson(returnValue);
  4067. actionResult.Status = (int)Constant.PDAResult.Success;
  4068. }
  4069. else
  4070. {
  4071. actionResult.Status = (int)Constant.PDAResult.Fail;
  4072. if (returnValue == -99)
  4073. actionResult.Message = "窑炉车号无效";
  4074. else if (returnValue == -98)
  4075. actionResult.Message = "窑车己无产品";
  4076. else if (returnValue == -97)
  4077. actionResult.Message = "窑车没有入窑,不可以撤销";
  4078. else if (returnValue == -1)
  4079. actionResult.Message = "保存失败";
  4080. }
  4081. }
  4082. catch (Exception ex)
  4083. {
  4084. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4085. OutputLog.TraceLog(LogPriority.Error,
  4086. this.ToString(),
  4087. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4088. ex.ToString(),
  4089. LocalPath.LogExePath);
  4090. actionResult.Status = (int)Constant.PDAResult.Exception;
  4091. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4092. }
  4093. return actionResult;
  4094. }
  4095. /// <summary>
  4096. /// 获取盘点单列表
  4097. /// </summary>
  4098. /// <param name="sUserInfo"></param>
  4099. /// <returns></returns>
  4100. public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey)
  4101. {
  4102. ActionResult actionResult = new ActionResult();
  4103. try
  4104. {
  4105. // 验证请求头信息
  4106. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4107. // 验证失败
  4108. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4109. {
  4110. return actionResult;
  4111. }
  4112. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4113. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  4114. actionResult.Result = JsonHelper.ToJson(ds);
  4115. actionResult.Status = (int)Constant.PDAResult.Success;
  4116. }
  4117. catch (Exception ex)
  4118. {
  4119. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4120. OutputLog.TraceLog(LogPriority.Error,
  4121. this.ToString(),
  4122. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4123. ex.ToString(),
  4124. LocalPath.LogExePath);
  4125. actionResult.Status = (int)Constant.PDAResult.Exception;
  4126. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4127. }
  4128. return actionResult;
  4129. }
  4130. /// <summary>
  4131. /// 进行盘点操作
  4132. /// </summary>
  4133. /// <param name="accountCode"></param>
  4134. /// <param name="userCode"></param>
  4135. /// <param name="userPassword"></param>
  4136. /// <param name="sessionKey"></param>
  4137. /// <param name="InCheckedID">盘点单ID</param>
  4138. /// <param name="BarCode">产品条码</param>
  4139. /// <returns></returns>
  4140. public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4141. {
  4142. ActionResult actionResult = new ActionResult();
  4143. try
  4144. {
  4145. // 验证请求头信息
  4146. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4147. // 验证失败
  4148. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4149. {
  4150. return actionResult;
  4151. }
  4152. int returnValue = ServiceInvoker.Invoke<int>(this,
  4153. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4154. if (returnValue > 0)
  4155. {
  4156. actionResult.Result = JsonHelper.ToJson(returnValue);
  4157. actionResult.Status = (int)Constant.PDAResult.Success;
  4158. actionResult.Message = "产品" + BarCode + "盘点成功";
  4159. }
  4160. else if (returnValue == 10)
  4161. {
  4162. actionResult.Result = JsonHelper.ToJson(returnValue);
  4163. actionResult.Status = (int)Constant.PDAResult.Success;
  4164. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4165. }
  4166. else
  4167. {
  4168. actionResult.Status = (int)Constant.PDAResult.Fail;
  4169. if (returnValue == -2)
  4170. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4171. //if (returnValue == 10)
  4172. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4173. //if (returnValue > 0)
  4174. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4175. if (returnValue == -22)
  4176. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4177. if (returnValue == -23)
  4178. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4179. if (returnValue == -24)
  4180. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4181. if (returnValue == -25)
  4182. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4183. else if (returnValue == 0)
  4184. actionResult.Message = "盘点失败";
  4185. }
  4186. }
  4187. catch (Exception ex)
  4188. {
  4189. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4190. OutputLog.TraceLog(LogPriority.Error,
  4191. this.ToString(),
  4192. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4193. ex.ToString(),
  4194. LocalPath.LogExePath);
  4195. actionResult.Status = (int)Constant.PDAResult.Exception;
  4196. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4197. }
  4198. return actionResult;
  4199. }
  4200. #region 班次配置
  4201. /// <summary>
  4202. /// 班次配置-通过工号获取工种列表
  4203. /// </summary>
  4204. /// <param name="userId">工号ID</param>
  4205. /// <returns></returns>
  4206. public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4207. {
  4208. ActionResult actionResult = new ActionResult();
  4209. try
  4210. {
  4211. // 验证请求头信息
  4212. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4213. // 验证失败
  4214. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4215. {
  4216. return actionResult;
  4217. }
  4218. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4219. () => SystemModuleLogic.GetJobByUserId(userId));
  4220. actionResult.Result = JsonHelper.ToJson(ds);
  4221. actionResult.Status = (int)Constant.PDAResult.Success;
  4222. }
  4223. catch (Exception ex)
  4224. {
  4225. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4226. OutputLog.TraceLog(LogPriority.Error,
  4227. this.ToString(),
  4228. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4229. ex.ToString(),
  4230. LocalPath.LogExePath);
  4231. actionResult.Status = (int)Constant.PDAResult.Exception;
  4232. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4233. }
  4234. return actionResult;
  4235. }
  4236. ///// <summary>
  4237. ///// 班次配置-根据工号查询员工档案信息
  4238. ///// </summary>
  4239. ///// <param name="userId">工号ID</param>
  4240. ///// <returns></returns>
  4241. //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4242. //{
  4243. // ActionResult actionResult = new ActionResult();
  4244. // try
  4245. // {
  4246. // // 验证请求头信息
  4247. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4248. // // 验证失败
  4249. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4250. // {
  4251. // return actionResult;
  4252. // }
  4253. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4254. // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
  4255. // actionResult.Result = JsonHelper.ToJson(ds);
  4256. // actionResult.Status = (int)Constant.PDAResult.Success;
  4257. // }
  4258. // catch (Exception ex)
  4259. // {
  4260. // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4261. // OutputLog.TraceLog(LogPriority.Error,
  4262. // this.ToString(),
  4263. // System.Reflection.MethodBase.GetCurrentMethod().Name,
  4264. // ex.ToString(),
  4265. // LocalPath.LogExePath);
  4266. // actionResult.Status = (int)Constant.PDAResult.Exception;
  4267. // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4268. // }
  4269. // return actionResult;
  4270. //}
  4271. /// <summary>
  4272. /// 班次配置-根据员工姓名查员工信息
  4273. /// </summary>
  4274. /// <param name="searchStaffEntity"></param>
  4275. /// <returns></returns>
  4276. public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4277. {
  4278. ActionResult actionResult = new ActionResult();
  4279. try
  4280. {
  4281. // 验证请求头信息
  4282. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4283. // 验证失败
  4284. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4285. {
  4286. return actionResult;
  4287. }
  4288. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4289. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4290. actionResult.Result = JsonHelper.ToJson(ds);
  4291. actionResult.Status = (int)Constant.PDAResult.Success;
  4292. }
  4293. catch (Exception ex)
  4294. {
  4295. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4296. OutputLog.TraceLog(LogPriority.Error,
  4297. this.ToString(),
  4298. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4299. ex.ToString(),
  4300. LocalPath.LogExePath);
  4301. actionResult.Status = (int)Constant.PDAResult.Exception;
  4302. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4303. }
  4304. return actionResult;
  4305. }
  4306. /// <summary>
  4307. /// 获取班次配置信息
  4308. /// </summary>
  4309. /// <param name="searchEntity"></param>
  4310. /// <returns></returns>
  4311. public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  4312. {
  4313. ActionResult actionResult = new ActionResult();
  4314. try
  4315. {
  4316. // 验证请求头信息
  4317. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4318. // 验证失败
  4319. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4320. {
  4321. return actionResult;
  4322. }
  4323. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4324. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4325. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4326. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4327. actionResult.Result = JsonHelper.ToJson(ds);
  4328. actionResult.Status = (int)Constant.PDAResult.Success;
  4329. }
  4330. catch (Exception ex)
  4331. {
  4332. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4333. OutputLog.TraceLog(LogPriority.Error,
  4334. this.ToString(),
  4335. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4336. ex.ToString(),
  4337. LocalPath.LogExePath);
  4338. actionResult.Status = (int)Constant.PDAResult.Exception;
  4339. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4340. }
  4341. return actionResult;
  4342. }
  4343. public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4344. {
  4345. ActionResult actionResult = new ActionResult();
  4346. try
  4347. {
  4348. // 验证请求头信息
  4349. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4350. // 验证失败
  4351. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4352. {
  4353. return actionResult;
  4354. }
  4355. int returnValue = ServiceInvoker.Invoke<int>(this,
  4356. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4357. if (returnValue > 0)
  4358. {
  4359. actionResult.Result = JsonHelper.ToJson(returnValue);
  4360. actionResult.Status = (int)Constant.PDAResult.Success;
  4361. }
  4362. else
  4363. {
  4364. actionResult.Status = (int)Constant.PDAResult.Fail;
  4365. actionResult.Message = "保存失败";
  4366. }
  4367. }
  4368. catch (Exception ex)
  4369. {
  4370. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4371. OutputLog.TraceLog(LogPriority.Error,
  4372. this.ToString(),
  4373. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4374. ex.ToString(),
  4375. LocalPath.LogExePath);
  4376. actionResult.Status = (int)Constant.PDAResult.Exception;
  4377. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4378. }
  4379. return actionResult;
  4380. }
  4381. /// <summary>
  4382. /// 班次配置--获取详细信息
  4383. /// </summary>
  4384. /// <param name="searchEntity"></param>
  4385. /// <returns></returns>
  4386. public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4387. {
  4388. ActionResult actionResult = new ActionResult();
  4389. try
  4390. {
  4391. // 验证请求头信息
  4392. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4393. // 验证失败
  4394. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4395. {
  4396. return actionResult;
  4397. }
  4398. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4399. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4400. actionResult.Result = JsonHelper.ToJson(ds);
  4401. actionResult.Status = (int)Constant.PDAResult.Success;
  4402. }
  4403. catch (Exception ex)
  4404. {
  4405. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4406. OutputLog.TraceLog(LogPriority.Error,
  4407. this.ToString(),
  4408. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4409. ex.ToString(),
  4410. LocalPath.LogExePath);
  4411. actionResult.Status = (int)Constant.PDAResult.Exception;
  4412. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4413. }
  4414. return actionResult;
  4415. }
  4416. /// <summary>
  4417. /// 获取用户是否有班次配置权限
  4418. /// </summary>
  4419. /// <param name="accountCode"></param>
  4420. /// <param name="userCode"></param>
  4421. /// <param name="userPassword"></param>
  4422. /// <param name="sessionKey"></param>
  4423. /// <returns></returns>
  4424. public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4425. {
  4426. ActionResult actionResult = new ActionResult();
  4427. try
  4428. {
  4429. // 验证请求头信息
  4430. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4431. // 验证失败
  4432. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4433. {
  4434. return actionResult;
  4435. }
  4436. int returnValue = ServiceInvoker.Invoke<int>(this,
  4437. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4438. actionResult.Result = JsonHelper.ToJson(returnValue);
  4439. actionResult.Status = (int)Constant.PDAResult.Success;
  4440. }
  4441. catch (Exception ex)
  4442. {
  4443. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4444. OutputLog.TraceLog(LogPriority.Error,
  4445. this.ToString(),
  4446. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4447. ex.ToString(),
  4448. LocalPath.LogExePath);
  4449. actionResult.Status = (int)Constant.PDAResult.Exception;
  4450. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4451. }
  4452. return actionResult;
  4453. }
  4454. /// <summary>
  4455. /// 获取盘点单列表
  4456. /// </summary>
  4457. /// <param name="sUserInfo"></param>
  4458. /// <returns></returns>
  4459. public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  4460. {
  4461. ActionResult actionResult = new ActionResult();
  4462. try
  4463. {
  4464. // 验证请求头信息
  4465. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4466. // 验证失败
  4467. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4468. {
  4469. return actionResult;
  4470. }
  4471. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4472. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4473. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4474. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4475. actionResult.Result = JsonHelper.ToJson(ds);
  4476. actionResult.Status = (int)Constant.PDAResult.Success;
  4477. }
  4478. catch (Exception ex)
  4479. {
  4480. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4481. OutputLog.TraceLog(LogPriority.Error,
  4482. this.ToString(),
  4483. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4484. ex.ToString(),
  4485. LocalPath.LogExePath);
  4486. actionResult.Status = (int)Constant.PDAResult.Exception;
  4487. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4488. }
  4489. return actionResult;
  4490. }
  4491. #endregion
  4492. #region PDA报表
  4493. /// <summary>
  4494. /// 产品质量跟踪
  4495. /// </summary>
  4496. /// <param name="accountCode"></param>
  4497. /// <param name="userCode"></param>
  4498. /// <param name="userPassword"></param>
  4499. /// <param name="sessionKey"></param>
  4500. /// <param name="se"></param>
  4501. /// <returns></returns>
  4502. public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4503. {
  4504. ActionResult actionResult = new ActionResult();
  4505. try
  4506. {
  4507. // 验证请求头信息
  4508. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4509. // 验证失败
  4510. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4511. {
  4512. return actionResult;
  4513. }
  4514. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4515. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4516. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4517. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4518. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4519. {
  4520. actionResult.Status = (int)Constant.PDAResult.Fail;
  4521. actionResult.Message = Messages.MSG_CMN_I002;
  4522. }
  4523. else
  4524. {
  4525. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4526. actionResult.Status = (int)Constant.PDAResult.Success;
  4527. }
  4528. }
  4529. catch (Exception ex)
  4530. {
  4531. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4532. OutputLog.TraceLog(LogPriority.Error,
  4533. this.ToString(),
  4534. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4535. ex.ToString(),
  4536. LocalPath.LogExePath);
  4537. actionResult.Status = (int)Constant.PDAResult.Exception;
  4538. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4539. }
  4540. return actionResult;
  4541. }
  4542. /// <summary>
  4543. /// 工号产量质量分析表
  4544. /// </summary>
  4545. /// <param name="accountCode"></param>
  4546. /// <param name="userCode"></param>
  4547. /// <param name="userPassword"></param>
  4548. /// <param name="sessionKey"></param>
  4549. /// <param name="se"></param>
  4550. /// <returns></returns>
  4551. public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4552. int rptSProcedureID, string workcode, string date)
  4553. {
  4554. ActionResult actionResult = new ActionResult();
  4555. try
  4556. {
  4557. // 验证请求头信息
  4558. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4559. // 验证失败
  4560. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4561. {
  4562. return actionResult;
  4563. }
  4564. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4565. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4566. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4567. {
  4568. actionResult.Status = (int)Constant.PDAResult.Fail;
  4569. actionResult.Message = Messages.MSG_CMN_I002;
  4570. }
  4571. else
  4572. {
  4573. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4574. actionResult.Status = (int)Constant.PDAResult.Success;
  4575. }
  4576. }
  4577. catch (Exception ex)
  4578. {
  4579. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4580. OutputLog.TraceLog(LogPriority.Error,
  4581. this.ToString(),
  4582. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4583. ex.ToString(),
  4584. LocalPath.LogExePath);
  4585. actionResult.Status = (int)Constant.PDAResult.Exception;
  4586. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4587. }
  4588. return actionResult;
  4589. }
  4590. /// <summary>
  4591. /// 半检数据统计表
  4592. /// </summary>
  4593. /// <param name="accountCode"></param>
  4594. /// <param name="userCode"></param>
  4595. /// <param name="userPassword"></param>
  4596. /// <param name="sessionKey"></param>
  4597. /// <param name="se"></param>
  4598. /// <returns></returns>
  4599. public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4600. string workcode, string datebegin, string dateend)
  4601. {
  4602. ActionResult actionResult = new ActionResult();
  4603. try
  4604. {
  4605. // 验证请求头信息
  4606. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4607. // 验证失败
  4608. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4609. {
  4610. return actionResult;
  4611. }
  4612. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4613. DateTime datetimeend = Convert.ToDateTime(dateend);
  4614. datetimebegin = datetimebegin.Date;
  4615. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4616. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4617. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4618. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4619. {
  4620. actionResult.Status = (int)Constant.PDAResult.Fail;
  4621. actionResult.Message = Messages.MSG_CMN_I002;
  4622. }
  4623. else
  4624. {
  4625. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4626. actionResult.Status = (int)Constant.PDAResult.Success;
  4627. }
  4628. }
  4629. catch (Exception ex)
  4630. {
  4631. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4632. OutputLog.TraceLog(LogPriority.Error,
  4633. this.ToString(),
  4634. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4635. ex.ToString(),
  4636. LocalPath.LogExePath);
  4637. actionResult.Status = (int)Constant.PDAResult.Exception;
  4638. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4639. }
  4640. return actionResult;
  4641. }
  4642. /// <summary>
  4643. /// 工号质量统计表
  4644. /// </summary>
  4645. /// <param name="accountCode"></param>
  4646. /// <param name="userCode"></param>
  4647. /// <param name="userPassword"></param>
  4648. /// <param name="sessionKey"></param>
  4649. /// <param name="se"></param>
  4650. /// <returns></returns>
  4651. public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4652. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4653. {
  4654. ActionResult actionResult = new ActionResult();
  4655. try
  4656. {
  4657. // 验证请求头信息
  4658. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4659. // 验证失败
  4660. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4661. {
  4662. return actionResult;
  4663. }
  4664. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4665. DateTime datetimeend = Convert.ToDateTime(dateend);
  4666. datetimebegin = datetimebegin.Date;
  4667. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4668. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4669. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4670. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4671. {
  4672. actionResult.Status = (int)Constant.PDAResult.Fail;
  4673. actionResult.Message = Messages.MSG_CMN_I002;
  4674. }
  4675. else
  4676. {
  4677. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4678. actionResult.Status = (int)Constant.PDAResult.Success;
  4679. }
  4680. }
  4681. catch (Exception ex)
  4682. {
  4683. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4684. OutputLog.TraceLog(LogPriority.Error,
  4685. this.ToString(),
  4686. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4687. ex.ToString(),
  4688. LocalPath.LogExePath);
  4689. actionResult.Status = (int)Constant.PDAResult.Exception;
  4690. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4691. }
  4692. return actionResult;
  4693. }
  4694. /// <summary>
  4695. /// 损坯数据统计表
  4696. /// </summary>
  4697. /// <param name="accountCode"></param>
  4698. /// <param name="userCode"></param>
  4699. /// <param name="userPassword"></param>
  4700. /// <param name="sessionKey"></param>
  4701. /// <param name="se"></param>
  4702. /// <returns></returns>
  4703. public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4704. string workcode, string datebegin, string dateend)
  4705. {
  4706. ActionResult actionResult = new ActionResult();
  4707. try
  4708. {
  4709. // 验证请求头信息
  4710. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4711. // 验证失败
  4712. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4713. {
  4714. return actionResult;
  4715. }
  4716. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4717. DateTime datetimeend = Convert.ToDateTime(dateend);
  4718. datetimebegin = datetimebegin.Date;
  4719. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4720. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4721. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4722. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4723. {
  4724. actionResult.Status = (int)Constant.PDAResult.Fail;
  4725. actionResult.Message = Messages.MSG_CMN_I002;
  4726. }
  4727. else
  4728. {
  4729. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4730. actionResult.Status = (int)Constant.PDAResult.Success;
  4731. }
  4732. }
  4733. catch (Exception ex)
  4734. {
  4735. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4736. OutputLog.TraceLog(LogPriority.Error,
  4737. this.ToString(),
  4738. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4739. ex.ToString(),
  4740. LocalPath.LogExePath);
  4741. actionResult.Status = (int)Constant.PDAResult.Exception;
  4742. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4743. }
  4744. return actionResult;
  4745. }
  4746. #endregion
  4747. /// <summary>
  4748. /// 取得报表数据源数据
  4749. /// </summary>
  4750. /// <param name="accountCode"></param>
  4751. /// <param name="userCode"></param>
  4752. /// <param name="userPassword"></param>
  4753. /// <param name="sessionKey"></param>
  4754. /// <returns></returns>
  4755. public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
  4756. {
  4757. ActionResult actionResult = new ActionResult();
  4758. try
  4759. {
  4760. // 验证请求头信息
  4761. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4762. // 验证失败
  4763. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4764. {
  4765. return actionResult;
  4766. }
  4767. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4768. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4769. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4770. {
  4771. actionResult.Status = (int)Constant.PDAResult.Fail;
  4772. actionResult.Message = Messages.MSG_CMN_I002;
  4773. }
  4774. else
  4775. {
  4776. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4777. actionResult.Status = (int)Constant.PDAResult.Success;
  4778. }
  4779. }
  4780. catch (Exception ex)
  4781. {
  4782. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4783. OutputLog.TraceLog(LogPriority.Error,
  4784. this.ToString(),
  4785. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4786. ex.ToString(),
  4787. LocalPath.LogExePath);
  4788. actionResult.Status = (int)Constant.PDAResult.Exception;
  4789. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4790. }
  4791. return actionResult;
  4792. }
  4793. /// <summary>
  4794. /// 取得报表的查询数据源统计工序数据
  4795. /// </summary>
  4796. /// <param name="accountCode"></param>
  4797. /// <param name="userCode"></param>
  4798. /// <param name="userPassword"></param>
  4799. /// <param name="sessionKey"></param>
  4800. /// <param name="RptProcedureID"></param>
  4801. /// <returns></returns>
  4802. public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  4803. {
  4804. ActionResult actionResult = new ActionResult();
  4805. try
  4806. {
  4807. // 验证请求头信息
  4808. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4809. // 验证失败
  4810. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4811. {
  4812. return actionResult;
  4813. }
  4814. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4815. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  4816. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4817. {
  4818. actionResult.Status = (int)Constant.PDAResult.Fail;
  4819. actionResult.Message = Messages.MSG_CMN_I002;
  4820. }
  4821. else
  4822. {
  4823. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4824. actionResult.Status = (int)Constant.PDAResult.Success;
  4825. }
  4826. }
  4827. catch (Exception ex)
  4828. {
  4829. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4830. OutputLog.TraceLog(LogPriority.Error,
  4831. this.ToString(),
  4832. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4833. ex.ToString(),
  4834. LocalPath.LogExePath);
  4835. actionResult.Status = (int)Constant.PDAResult.Exception;
  4836. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4837. }
  4838. return actionResult;
  4839. }
  4840. /// <summary>
  4841. /// 获取用户是否有统计产成品权限
  4842. /// </summary>
  4843. /// <param name="accountCode"></param>
  4844. /// <param name="userCode"></param>
  4845. /// <param name="userPassword"></param>
  4846. /// <param name="sessionKey"></param>
  4847. /// <returns></returns>
  4848. public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4849. {
  4850. ActionResult actionResult = new ActionResult();
  4851. try
  4852. {
  4853. // 验证请求头信息
  4854. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4855. // 验证失败
  4856. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4857. {
  4858. return actionResult;
  4859. }
  4860. int returnValue = ServiceInvoker.Invoke<int>(this,
  4861. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  4862. actionResult.Result = JsonHelper.ToJson(returnValue);
  4863. actionResult.Status = (int)Constant.PDAResult.Success;
  4864. }
  4865. catch (Exception ex)
  4866. {
  4867. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4868. OutputLog.TraceLog(LogPriority.Error,
  4869. this.ToString(),
  4870. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4871. ex.ToString(),
  4872. LocalPath.LogExePath);
  4873. actionResult.Status = (int)Constant.PDAResult.Exception;
  4874. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4875. }
  4876. return actionResult;
  4877. }
  4878. /// <summary>
  4879. /// 获取用户是否有盘点权限
  4880. /// </summary>
  4881. /// <param name="accountCode"></param>
  4882. /// <param name="userCode"></param>
  4883. /// <param name="userPassword"></param>
  4884. /// <param name="sessionKey"></param>
  4885. /// <returns></returns>
  4886. public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4887. {
  4888. ActionResult actionResult = new ActionResult();
  4889. try
  4890. {
  4891. // 验证请求头信息
  4892. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4893. // 验证失败
  4894. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4895. {
  4896. return actionResult;
  4897. }
  4898. int returnValue = ServiceInvoker.Invoke<int>(this,
  4899. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  4900. actionResult.Result = JsonHelper.ToJson(returnValue);
  4901. actionResult.Status = (int)Constant.PDAResult.Success;
  4902. }
  4903. catch (Exception ex)
  4904. {
  4905. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4906. OutputLog.TraceLog(LogPriority.Error,
  4907. this.ToString(),
  4908. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4909. ex.ToString(),
  4910. LocalPath.LogExePath);
  4911. actionResult.Status = (int)Constant.PDAResult.Exception;
  4912. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4913. }
  4914. return actionResult;
  4915. }
  4916. /// <summary>
  4917. /// 根据条件查询是否存在班次配置
  4918. /// </summary>
  4919. /// <param name="accountCode"></param>
  4920. /// <param name="userCode"></param>
  4921. /// <param name="userPassword"></param>
  4922. /// <param name="sessionKey"></param>
  4923. /// <param name="userCode">工号编码</param>
  4924. /// <returns></returns>
  4925. public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  4926. {
  4927. ActionResult actionResult = new ActionResult();
  4928. try
  4929. {
  4930. // 验证请求头信息
  4931. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4932. // 验证失败
  4933. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4934. {
  4935. return actionResult;
  4936. }
  4937. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4938. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  4939. actionResult.Result = JsonHelper.ToJson(ds);
  4940. actionResult.Status = (int)Constant.PDAResult.Success;
  4941. }
  4942. catch (Exception ex)
  4943. {
  4944. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4945. OutputLog.TraceLog(LogPriority.Error,
  4946. this.ToString(),
  4947. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4948. ex.ToString(),
  4949. LocalPath.LogExePath);
  4950. actionResult.Status = (int)Constant.PDAResult.Exception;
  4951. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4952. }
  4953. return actionResult;
  4954. }
  4955. /// <summary>
  4956. /// 报损工序查出工号根据生产数据ID
  4957. /// </summary>
  4958. /// <param name="accountCode"></param>
  4959. /// <param name="userCode"></param>
  4960. /// <param name="userPassword"></param>
  4961. /// <param name="sessionKey"></param>
  4962. /// <param name="ProductionDataID">生产数据ID</param>
  4963. /// <returns></returns>
  4964. public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  4965. {
  4966. ActionResult actionResult = new ActionResult();
  4967. try
  4968. {
  4969. // 验证请求头信息
  4970. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4971. // 验证失败
  4972. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4973. {
  4974. return actionResult;
  4975. }
  4976. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  4977. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  4978. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  4979. {
  4980. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  4981. actionResult.Status = (int)Constant.PDAResult.Success;
  4982. }
  4983. else
  4984. {
  4985. actionResult.Status = (int)Constant.PDAResult.Fail;
  4986. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  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="kilncarcode">窑车编码</param>
  5010. /// <param name="procedureid">工序ID</param>
  5011. /// <returns></returns>
  5012. public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  5013. {
  5014. ActionResult actionResult = new ActionResult();
  5015. try
  5016. {
  5017. // 验证请求头信息
  5018. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5019. // 验证失败
  5020. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5021. {
  5022. return actionResult;
  5023. }
  5024. int returnValue = ServiceInvoker.Invoke<int>(this,
  5025. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  5026. if (returnValue == 1)
  5027. {
  5028. actionResult.Result = JsonHelper.ToJson(returnValue);
  5029. actionResult.Status = (int)Constant.PDAResult.Success;
  5030. }
  5031. else
  5032. {
  5033. actionResult.Status = (int)Constant.PDAResult.Fail;
  5034. if (returnValue == -99)
  5035. actionResult.Message = "窑炉车号无效";
  5036. else if (returnValue == -98)
  5037. actionResult.Message = "窑车己无产品";
  5038. else if (returnValue == -97)
  5039. actionResult.Message = "窑车没有入窑,不可以撤销";
  5040. else if (returnValue == -1)
  5041. actionResult.Message = "保存失败";
  5042. }
  5043. }
  5044. catch (Exception ex)
  5045. {
  5046. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5047. OutputLog.TraceLog(LogPriority.Error,
  5048. this.ToString(),
  5049. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5050. ex.ToString(),
  5051. LocalPath.LogExePath);
  5052. actionResult.Status = (int)Constant.PDAResult.Exception;
  5053. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5054. }
  5055. return actionResult;
  5056. }
  5057. /// <summary>
  5058. /// 撤销包装
  5059. /// </summary>
  5060. /// <param name="accountCode"></param>
  5061. /// <param name="userCode"></param>
  5062. /// <param name="userPassword"></param>
  5063. /// <param name="sessionKey"></param>
  5064. /// <param name="barcode"></param>
  5065. /// <returns></returns>
  5066. public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5067. {
  5068. ActionResult actionResult = new ActionResult();
  5069. try
  5070. {
  5071. // 验证请求头信息
  5072. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5073. // 验证失败
  5074. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5075. {
  5076. return actionResult;
  5077. }
  5078. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5079. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  5080. if (Convert.ToInt32(returnValue.Result) > 0)
  5081. {
  5082. actionResult.Result = JsonHelper.ToJson(returnValue);
  5083. actionResult.Status = (int)Constant.PDAResult.Success;
  5084. }
  5085. else
  5086. {
  5087. actionResult.Status = (int)Constant.PDAResult.Fail;
  5088. if (Convert.ToInt32(returnValue.Result) == -1)
  5089. actionResult.Message = "产品条码不存在包装记录";
  5090. else if (Convert.ToInt32(returnValue.Result) == -200)
  5091. actionResult.Message = returnValue.Message;
  5092. else
  5093. actionResult.Message = "成品撤销失败";
  5094. }
  5095. }
  5096. catch (Exception ex)
  5097. {
  5098. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5099. OutputLog.TraceLog(LogPriority.Error,
  5100. this.ToString(),
  5101. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5102. ex.ToString(),
  5103. LocalPath.LogExePath);
  5104. actionResult.Status = (int)Constant.PDAResult.Exception;
  5105. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5106. }
  5107. return actionResult;
  5108. }
  5109. /*
  5110. /// <summary>
  5111. /// 获取用户是否有撤销包装权限
  5112. /// </summary>
  5113. /// <param name="accountCode"></param>
  5114. /// <param name="userCode"></param>
  5115. /// <param name="userPassword"></param>
  5116. /// <param name="sessionKey"></param>
  5117. /// <returns></returns>
  5118. public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5119. {
  5120. ActionResult actionResult = new ActionResult();
  5121. try
  5122. {
  5123. // 验证请求头信息
  5124. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5125. // 验证失败
  5126. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5127. {
  5128. return actionResult;
  5129. }
  5130. int returnValue = ServiceInvoker.Invoke<int>(this,
  5131. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5132. actionResult.Result = JsonHelper.ToJson(returnValue);
  5133. actionResult.Status = (int)Constant.PDAResult.Success;
  5134. }
  5135. catch (Exception ex)
  5136. {
  5137. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5138. OutputLog.TraceLog(LogPriority.Error,
  5139. this.ToString(),
  5140. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5141. ex.ToString(),
  5142. LocalPath.LogExePath);
  5143. actionResult.Status = (int)Constant.PDAResult.Exception;
  5144. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5145. }
  5146. return actionResult;
  5147. }
  5148. */
  5149. /// <summary>
  5150. /// 窑车状态明细表查询
  5151. /// </summary>
  5152. /// <param name="accountCode"></param>
  5153. /// <param name="userCode"></param>
  5154. /// <param name="userPassword"></param>
  5155. /// <param name="sessionKey"></param>
  5156. /// <param name="kilnCarCode"></param>
  5157. /// <returns></returns>
  5158. public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5159. {
  5160. ActionResult actionResult = new ActionResult();
  5161. try
  5162. {
  5163. // 验证请求头信息
  5164. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5165. // 验证失败
  5166. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5167. {
  5168. return actionResult;
  5169. }
  5170. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5171. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5172. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5173. {
  5174. actionResult.Status = (int)Constant.PDAResult.Fail;
  5175. actionResult.Message = Messages.MSG_CMN_I002;
  5176. }
  5177. else
  5178. {
  5179. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5180. actionResult.Status = (int)Constant.PDAResult.Success;
  5181. }
  5182. }
  5183. catch (Exception ex)
  5184. {
  5185. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5186. OutputLog.TraceLog(LogPriority.Error,
  5187. this.ToString(),
  5188. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5189. ex.ToString(),
  5190. LocalPath.LogExePath);
  5191. actionResult.Status = (int)Constant.PDAResult.Exception;
  5192. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5193. }
  5194. return actionResult;
  5195. }
  5196. /// <summary>
  5197. /// 损坯撤销
  5198. /// </summary>
  5199. /// <param name="accountCode"></param>
  5200. /// <param name="userCode"></param>
  5201. /// <param name="userPassword"></param>
  5202. /// <param name="sessionKey"></param>
  5203. /// <param name="barcode"></param>
  5204. /// <returns></returns>
  5205. public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5206. {
  5207. ActionResult actionResult = new ActionResult();
  5208. try
  5209. {
  5210. // 验证请求头信息
  5211. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5212. // 验证失败
  5213. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5214. {
  5215. return actionResult;
  5216. }
  5217. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5218. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5219. if (Convert.ToInt32(returnValue.Result) > 0)
  5220. {
  5221. actionResult.Result = JsonHelper.ToJson(returnValue);
  5222. actionResult.Status = (int)Constant.PDAResult.Success;
  5223. }
  5224. else
  5225. {
  5226. actionResult.Status = (int)Constant.PDAResult.Fail;
  5227. if (Convert.ToInt32(returnValue.Result) == -1)
  5228. actionResult.Message = "此产品没有损坯,不能撤销";
  5229. else if (Convert.ToInt32(returnValue.Result) == -200)
  5230. actionResult.Message = returnValue.Message;
  5231. else
  5232. actionResult.Message = "损坯撤销失败";
  5233. }
  5234. }
  5235. catch (Exception ex)
  5236. {
  5237. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5238. OutputLog.TraceLog(LogPriority.Error,
  5239. this.ToString(),
  5240. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5241. ex.ToString(),
  5242. LocalPath.LogExePath);
  5243. actionResult.Status = (int)Constant.PDAResult.Exception;
  5244. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5245. }
  5246. return actionResult;
  5247. }
  5248. /*
  5249. /// <summary>
  5250. /// 获取用户是否有损坯撤销权限
  5251. /// </summary>
  5252. /// <param name="accountCode"></param>
  5253. /// <param name="userCode"></param>
  5254. /// <param name="userPassword"></param>
  5255. /// <param name="sessionKey"></param>
  5256. /// <returns></returns>
  5257. public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5258. {
  5259. ActionResult actionResult = new ActionResult();
  5260. try
  5261. {
  5262. // 验证请求头信息
  5263. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5264. // 验证失败
  5265. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5266. {
  5267. return actionResult;
  5268. }
  5269. int returnValue = ServiceInvoker.Invoke<int>(this,
  5270. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5271. actionResult.Result = JsonHelper.ToJson(returnValue);
  5272. actionResult.Status = (int)Constant.PDAResult.Success;
  5273. }
  5274. catch (Exception ex)
  5275. {
  5276. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5277. OutputLog.TraceLog(LogPriority.Error,
  5278. this.ToString(),
  5279. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5280. ex.ToString(),
  5281. LocalPath.LogExePath);
  5282. actionResult.Status = (int)Constant.PDAResult.Exception;
  5283. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5284. }
  5285. return actionResult;
  5286. }
  5287. */
  5288. /// <summary>
  5289. /// 获取条码注浆信息
  5290. /// </summary>
  5291. /// <param name="accountCode"></param>
  5292. /// <param name="userCode"></param>
  5293. /// <param name="userPassword"></param>
  5294. /// <param name="sessionKey"></param>
  5295. /// <returns></returns>
  5296. public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5297. {
  5298. ActionResult actionResult = new ActionResult();
  5299. try
  5300. {
  5301. // 验证请求头信息
  5302. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5303. // 验证失败
  5304. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5305. {
  5306. return actionResult;
  5307. }
  5308. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5309. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5310. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5311. {
  5312. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5313. actionResult.Status = (int)Constant.PDAResult.Success;
  5314. }
  5315. else
  5316. {
  5317. actionResult.Status = (int)Constant.PDAResult.Fail;
  5318. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5319. }
  5320. }
  5321. catch (Exception ex)
  5322. {
  5323. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5324. OutputLog.TraceLog(LogPriority.Error,
  5325. this.ToString(),
  5326. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5327. ex.ToString(),
  5328. LocalPath.LogExePath);
  5329. actionResult.Status = (int)Constant.PDAResult.Exception;
  5330. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5331. }
  5332. return actionResult;
  5333. }
  5334. /// <summary>
  5335. /// 获取条码注浆信息
  5336. /// </summary>
  5337. /// <param name="accountCode"></param>
  5338. /// <param name="userCode"></param>
  5339. /// <param name="userPassword"></param>
  5340. /// <param name="sessionKey"></param>
  5341. /// <returns></returns>
  5342. public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5343. {
  5344. ActionResult actionResult = new ActionResult();
  5345. try
  5346. {
  5347. // 验证请求头信息
  5348. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5349. // 验证失败
  5350. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5351. {
  5352. return actionResult;
  5353. }
  5354. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5355. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5356. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5357. {
  5358. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5359. actionResult.Status = (int)Constant.PDAResult.Success;
  5360. }
  5361. else
  5362. {
  5363. actionResult.Status = (int)Constant.PDAResult.Fail;
  5364. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5365. }
  5366. }
  5367. catch (Exception ex)
  5368. {
  5369. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5370. OutputLog.TraceLog(LogPriority.Error,
  5371. this.ToString(),
  5372. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5373. ex.ToString(),
  5374. LocalPath.LogExePath);
  5375. actionResult.Status = (int)Constant.PDAResult.Exception;
  5376. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5377. }
  5378. return actionResult;
  5379. }
  5380. /// <summary>
  5381. /// 公坯设定
  5382. /// </summary>
  5383. /// <param name="accountCode"></param>
  5384. /// <param name="userCode"></param>
  5385. /// <param name="userPassword"></param>
  5386. /// <param name="sessionKey"></param>
  5387. /// <param name="barcode"></param>
  5388. /// <returns></returns>
  5389. public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5390. {
  5391. ActionResult actionResult = new ActionResult();
  5392. try
  5393. {
  5394. // 验证请求头信息
  5395. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5396. // 验证失败
  5397. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5398. {
  5399. return actionResult;
  5400. }
  5401. int returnValue = ServiceInvoker.Invoke<int>(this,
  5402. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5403. if (returnValue > 0)
  5404. {
  5405. actionResult.Result = JsonHelper.ToJson(returnValue);
  5406. actionResult.Status = (int)Constant.PDAResult.Success;
  5407. }
  5408. else
  5409. {
  5410. actionResult.Status = (int)Constant.PDAResult.Fail;
  5411. if (returnValue == -1)
  5412. actionResult.Message = "此产品不在生产线上";
  5413. else if (returnValue == -2)
  5414. actionResult.Message = "该产品已经标识为公坯";
  5415. else
  5416. actionResult.Message = "公坯设定失败";
  5417. }
  5418. }
  5419. catch (Exception ex)
  5420. {
  5421. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5422. OutputLog.TraceLog(LogPriority.Error,
  5423. this.ToString(),
  5424. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5425. ex.ToString(),
  5426. LocalPath.LogExePath);
  5427. actionResult.Status = (int)Constant.PDAResult.Exception;
  5428. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5429. }
  5430. return actionResult;
  5431. }
  5432. /*
  5433. /// <summary>
  5434. /// 获取用户是否有公坯设定
  5435. /// </summary>
  5436. /// <param name="accountCode"></param>
  5437. /// <param name="userCode"></param>
  5438. /// <param name="userPassword"></param>
  5439. /// <param name="sessionKey"></param>
  5440. /// <returns></returns>
  5441. public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5442. {
  5443. ActionResult actionResult = new ActionResult();
  5444. try
  5445. {
  5446. // 验证请求头信息
  5447. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5448. // 验证失败
  5449. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5450. {
  5451. return actionResult;
  5452. }
  5453. int returnValue = ServiceInvoker.Invoke<int>(this,
  5454. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5455. actionResult.Result = JsonHelper.ToJson(returnValue);
  5456. actionResult.Status = (int)Constant.PDAResult.Success;
  5457. }
  5458. catch (Exception ex)
  5459. {
  5460. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5461. OutputLog.TraceLog(LogPriority.Error,
  5462. this.ToString(),
  5463. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5464. ex.ToString(),
  5465. LocalPath.LogExePath);
  5466. actionResult.Status = (int)Constant.PDAResult.Exception;
  5467. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5468. }
  5469. return actionResult;
  5470. }
  5471. */
  5472. /// <summary>
  5473. /// 校验产品条码是否可以走到该工序
  5474. /// </summary>
  5475. /// <param name="accountCode">帐套code</param>
  5476. /// <param name="userCode">用户code</param>
  5477. /// <param name="userPassword">用户密码</param>
  5478. /// <param name="sessionKey">本次登陆密钥</param>
  5479. /// <param name="procedureID">工序ID</param>
  5480. /// <param name="barcode">条码</param>
  5481. /// <returns></returns>
  5482. /// <remarks>
  5483. /// 陈冰 2014.09.18 新建
  5484. /// </remarks>
  5485. public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5486. {
  5487. ActionResult actionResult = new ActionResult();
  5488. try
  5489. {
  5490. // 验证请求头信息
  5491. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5492. // 验证失败
  5493. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5494. {
  5495. return actionResult;
  5496. }
  5497. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5498. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5499. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5500. {
  5501. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5502. actionResult.Status = (int)Constant.PDAResult.Success;
  5503. }
  5504. else
  5505. {
  5506. actionResult.Status = (int)Constant.PDAResult.Fail;
  5507. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5508. }
  5509. }
  5510. catch (Exception ex)
  5511. {
  5512. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5513. OutputLog.TraceLog(LogPriority.Error,
  5514. this.ToString(),
  5515. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5516. ex.ToString(),
  5517. LocalPath.LogExePath);
  5518. actionResult.Status = (int)Constant.PDAResult.Exception;
  5519. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5520. }
  5521. return actionResult;
  5522. }
  5523. /// <summary>
  5524. /// 获取用户所有菜单权限
  5525. /// </summary>
  5526. /// <param name="accountCode"></param>
  5527. /// <param name="userCode"></param>
  5528. /// <param name="userPassword"></param>
  5529. /// <param name="sessionKey"></param>
  5530. /// <returns></returns>
  5531. public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
  5532. {
  5533. ActionResult actionResult = new ActionResult();
  5534. try
  5535. {
  5536. // 验证请求头信息
  5537. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5538. // 验证失败
  5539. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5540. {
  5541. return actionResult;
  5542. }
  5543. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5544. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5545. actionResult.Result = JsonHelper.ToJson(returnValue);
  5546. actionResult.Status = (int)Constant.PDAResult.Success;
  5547. }
  5548. catch (Exception ex)
  5549. {
  5550. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5551. OutputLog.TraceLog(LogPriority.Error,
  5552. this.ToString(),
  5553. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5554. ex.ToString(),
  5555. LocalPath.LogExePath);
  5556. actionResult.Status = (int)Constant.PDAResult.Exception;
  5557. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5558. }
  5559. return actionResult;
  5560. }
  5561. public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5562. {
  5563. ActionResult actionResult = new ActionResult();
  5564. try
  5565. {
  5566. // 验证请求头信息
  5567. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5568. // 验证失败
  5569. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5570. {
  5571. return actionResult;
  5572. }
  5573. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5574. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5575. if (Convert.ToInt32(returnValue.Result) > 0)
  5576. {
  5577. actionResult.Result = JsonHelper.ToJson(returnValue);
  5578. actionResult.Status = (int)Constant.PDAResult.Success;
  5579. }
  5580. else
  5581. {
  5582. actionResult.Status = (int)Constant.PDAResult.Fail;
  5583. if (Convert.ToInt32(returnValue.Result) == -1)
  5584. actionResult.Message = "无效条码";
  5585. else if (Convert.ToInt32(returnValue.Result) == -2)
  5586. actionResult.Message = "已经生产完成";
  5587. else if (Convert.ToInt32(returnValue.Result) == -3)
  5588. actionResult.Message = "条码已经申请报废";
  5589. else if (Convert.ToInt32(returnValue.Result) == -4)
  5590. actionResult.Message = "此条码当前工序不允许进行撤销";
  5591. else if (Convert.ToInt32(returnValue.Result) == -5)
  5592. actionResult.Message = "此条码没有生产数据";
  5593. else if (Convert.ToInt32(returnValue.Result) == -6)
  5594. actionResult.Message = "没有当前工序权限";
  5595. else if (Convert.ToInt32(returnValue.Result) == -7)
  5596. actionResult.Message = "条码不在生产线上";
  5597. else if (Convert.ToInt32(returnValue.Result) == -8)
  5598. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5599. else if (Convert.ToInt32(returnValue.Result) == -9)
  5600. actionResult.Message = "条码已经是返工状态";
  5601. else if (Convert.ToInt32(returnValue.Result) == -200)
  5602. actionResult.Message = returnValue.Message;
  5603. }
  5604. }
  5605. catch (Exception ex)
  5606. {
  5607. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5608. OutputLog.TraceLog(LogPriority.Error,
  5609. this.ToString(),
  5610. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5611. ex.ToString(),
  5612. LocalPath.LogExePath);
  5613. actionResult.Status = (int)Constant.PDAResult.Exception;
  5614. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5615. }
  5616. return actionResult;
  5617. }
  5618. public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5619. {
  5620. ActionResult actionResult = new ActionResult();
  5621. try
  5622. {
  5623. // 验证请求头信息
  5624. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5625. // 验证失败
  5626. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5627. {
  5628. return actionResult;
  5629. }
  5630. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5631. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5632. if (Convert.ToInt32(returnValue.Result) > 0)
  5633. {
  5634. actionResult.Result = JsonHelper.ToJson(returnValue);
  5635. actionResult.Status = (int)Constant.PDAResult.Success;
  5636. }
  5637. else
  5638. {
  5639. actionResult.Status = (int)Constant.PDAResult.Fail;
  5640. if (Convert.ToInt32(returnValue.Result) == -1)
  5641. actionResult.Message = "无效条码";
  5642. else if (Convert.ToInt32(returnValue.Result) == -2)
  5643. actionResult.Message = "已经生产完成";
  5644. else if (Convert.ToInt32(returnValue.Result) == -3)
  5645. actionResult.Message = "条码已经申请报废";
  5646. else if (Convert.ToInt32(returnValue.Result) == -4)
  5647. actionResult.Message = "此条码当前工序不允许进行撤销";
  5648. else if (Convert.ToInt32(returnValue.Result) == -5)
  5649. actionResult.Message = "此条码没有生产数据";
  5650. else if (Convert.ToInt32(returnValue.Result) == -55)
  5651. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5652. else if (Convert.ToInt32(returnValue.Result) == -6)
  5653. actionResult.Message = "没有任何影响行";
  5654. else if (Convert.ToInt32(returnValue.Result) == -7)
  5655. actionResult.Message = "条码不在生产线上";
  5656. else if (Convert.ToInt32(returnValue.Result) == -8)
  5657. actionResult.Message = "条码已经是返工状态";
  5658. else if (Convert.ToInt32(returnValue.Result) == -200)
  5659. actionResult.Message = returnValue.Message;
  5660. }
  5661. }
  5662. catch (Exception ex)
  5663. {
  5664. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5665. OutputLog.TraceLog(LogPriority.Error,
  5666. this.ToString(),
  5667. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5668. ex.ToString(),
  5669. LocalPath.LogExePath);
  5670. actionResult.Status = (int)Constant.PDAResult.Exception;
  5671. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5672. }
  5673. return actionResult;
  5674. }
  5675. public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  5676. {
  5677. ActionResult actionResult = new ActionResult();
  5678. try
  5679. {
  5680. // 验证请求头信息
  5681. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5682. // 验证失败
  5683. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5684. {
  5685. return actionResult;
  5686. }
  5687. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5688. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5689. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5690. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5691. {
  5692. //DataView dv = returnValue.Tables[0].DefaultView;
  5693. //dv.RowFilter = "ValueFlag=1";
  5694. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5695. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5696. actionResult.Status = (int)Constant.PDAResult.Success;
  5697. }
  5698. }
  5699. catch (Exception ex)
  5700. {
  5701. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5702. OutputLog.TraceLog(LogPriority.Error,
  5703. this.ToString(),
  5704. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5705. ex.ToString(),
  5706. LocalPath.LogExePath);
  5707. actionResult.Status = (int)Constant.PDAResult.Exception;
  5708. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5709. }
  5710. return actionResult;
  5711. }
  5712. /// <summary>
  5713. /// 变更产品商标用
  5714. /// </summary>
  5715. /// <param name="accountCode"></param>
  5716. /// <param name="userCode"></param>
  5717. /// <param name="userPassword"></param>
  5718. /// <param name="sessionKey"></param>
  5719. /// <param name="goodsid"></param>
  5720. /// <returns></returns>
  5721. public ActionResult GetLogoInfoForChange(string accountCode, string userCode, string userPassword, string sessionKey
  5722. , int goodsid)
  5723. {
  5724. ActionResult actionResult = new ActionResult();
  5725. try
  5726. {
  5727. // 验证请求头信息
  5728. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5729. // 验证失败
  5730. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5731. {
  5732. return actionResult;
  5733. }
  5734. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5735. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5736. //() => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5737. () => SystemModuleLogic.GetLogoInfoForChange(sUserInfo, goodsid));
  5738. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5739. {
  5740. //DataView dv = returnValue.Tables[0].DefaultView;
  5741. //dv.RowFilter = "ValueFlag=1";
  5742. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5743. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5744. actionResult.Status = (int)Constant.PDAResult.Success;
  5745. }
  5746. }
  5747. catch (Exception ex)
  5748. {
  5749. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5750. OutputLog.TraceLog(LogPriority.Error,
  5751. this.ToString(),
  5752. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5753. ex.ToString(),
  5754. LocalPath.LogExePath);
  5755. actionResult.Status = (int)Constant.PDAResult.Exception;
  5756. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5757. }
  5758. return actionResult;
  5759. }
  5760. public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5761. {
  5762. ActionResult actionResult = new ActionResult();
  5763. try
  5764. {
  5765. // 验证请求头信息
  5766. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5767. // 验证失败
  5768. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5769. {
  5770. return actionResult;
  5771. }
  5772. int returnValue = ServiceInvoker.Invoke<int>(this,
  5773. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5774. actionResult.Result = JsonHelper.ToJson(returnValue);
  5775. actionResult.Status = (int)Constant.PDAResult.Success;
  5776. }
  5777. catch (Exception ex)
  5778. {
  5779. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5780. OutputLog.TraceLog(LogPriority.Error,
  5781. this.ToString(),
  5782. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5783. ex.ToString(),
  5784. LocalPath.LogExePath);
  5785. actionResult.Status = (int)Constant.PDAResult.Exception;
  5786. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5787. }
  5788. return actionResult;
  5789. }
  5790. public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  5791. {
  5792. ActionResult actionResult = new ActionResult();
  5793. try
  5794. {
  5795. // 验证请求头信息
  5796. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5797. // 验证失败
  5798. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5799. {
  5800. return actionResult;
  5801. }
  5802. int returnValue = ServiceInvoker.Invoke<int>(this,
  5803. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo));
  5804. actionResult.Result = JsonHelper.ToJson(returnValue);
  5805. actionResult.Status = (int)Constant.PDAResult.Success;
  5806. }
  5807. catch (Exception ex)
  5808. {
  5809. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5810. OutputLog.TraceLog(LogPriority.Error,
  5811. this.ToString(),
  5812. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5813. ex.ToString(),
  5814. LocalPath.LogExePath);
  5815. actionResult.Status = (int)Constant.PDAResult.Exception;
  5816. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5817. }
  5818. return actionResult;
  5819. }
  5820. public ActionResult SaveBarCodeLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  5821. string barcode, int logoid, int glazetypeid)
  5822. {
  5823. ActionResult actionResult = new ActionResult();
  5824. try
  5825. {
  5826. // 验证请求头信息
  5827. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5828. // 验证失败
  5829. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5830. {
  5831. return actionResult;
  5832. }
  5833. int returnValue = ServiceInvoker.Invoke<int>(this,
  5834. () => PMModuleLogicDAL.SaveBarCodeLogoAndGlazetype(barcode, logoid, glazetypeid, sUserInfo));
  5835. actionResult.Result = JsonHelper.ToJson(returnValue);
  5836. if (returnValue > 0)
  5837. {
  5838. actionResult.Status = (int)Constant.PDAResult.Success;
  5839. }
  5840. else
  5841. {
  5842. actionResult.Status = (int)Constant.PDAResult.Fail;
  5843. actionResult.Message = "条码不存在";
  5844. }
  5845. }
  5846. catch (Exception ex)
  5847. {
  5848. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5849. OutputLog.TraceLog(LogPriority.Error,
  5850. this.ToString(),
  5851. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5852. ex.ToString(),
  5853. LocalPath.LogExePath);
  5854. actionResult.Status = (int)Constant.PDAResult.Exception;
  5855. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5856. }
  5857. return actionResult;
  5858. }
  5859. public ActionResult SaveBarCodesLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  5860. string barcodes, int logoid, int glazetypeid, int procedureID)
  5861. {
  5862. ActionResult actionResult = new ActionResult();
  5863. try
  5864. {
  5865. // 验证请求头信息
  5866. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5867. // 验证失败
  5868. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5869. {
  5870. return actionResult;
  5871. }
  5872. int returnValue = ServiceInvoker.Invoke<int>(this,
  5873. () => PMModuleLogicDAL.SaveBarCodesLogoAndGlazetype(barcodes, logoid, glazetypeid, procedureID, sUserInfo));
  5874. actionResult.Result = JsonHelper.ToJson(returnValue);
  5875. if (returnValue > 0)
  5876. {
  5877. actionResult.Status = (int)Constant.PDAResult.Success;
  5878. }
  5879. else
  5880. {
  5881. actionResult.Status = (int)Constant.PDAResult.Fail;
  5882. actionResult.Message = "条码不存在";
  5883. }
  5884. }
  5885. catch (Exception ex)
  5886. {
  5887. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5888. OutputLog.TraceLog(LogPriority.Error,
  5889. this.ToString(),
  5890. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5891. ex.ToString(),
  5892. LocalPath.LogExePath);
  5893. actionResult.Status = (int)Constant.PDAResult.Exception;
  5894. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5895. }
  5896. return actionResult;
  5897. }
  5898. public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5899. {
  5900. ActionResult actionResult = new ActionResult();
  5901. try
  5902. {
  5903. // 验证请求头信息
  5904. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5905. // 验证失败
  5906. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5907. {
  5908. return actionResult;
  5909. }
  5910. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5911. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  5912. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5913. {
  5914. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5915. actionResult.Status = (int)Constant.PDAResult.Success;
  5916. }
  5917. }
  5918. catch (Exception ex)
  5919. {
  5920. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5921. OutputLog.TraceLog(LogPriority.Error,
  5922. this.ToString(),
  5923. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5924. ex.ToString(),
  5925. LocalPath.LogExePath);
  5926. actionResult.Status = (int)Constant.PDAResult.Exception;
  5927. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5928. }
  5929. return actionResult;
  5930. }
  5931. /// <summary>
  5932. /// 半检时,入窑前检验获取此条码是否报损为废品
  5933. /// </summary>
  5934. /// <param name="accountCode"></param>
  5935. /// <param name="userCode"></param>
  5936. /// <param name="userPassword"></param>
  5937. /// <param name="sessionKey"></param>
  5938. /// <param name="barcode">产品条码</param>
  5939. /// <returns></returns>
  5940. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5941. {
  5942. ActionResult actionResult = new ActionResult();
  5943. try
  5944. {
  5945. // 验证请求头信息
  5946. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5947. // 验证失败
  5948. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5949. {
  5950. return actionResult;
  5951. }
  5952. int returnValue = ServiceInvoker.Invoke<int>(this,
  5953. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  5954. if (returnValue != -100)
  5955. {
  5956. actionResult.Result = JsonHelper.ToJson(returnValue);
  5957. actionResult.Status = (int)Constant.PDAResult.Success;
  5958. }
  5959. else
  5960. {
  5961. actionResult.Status = (int)Constant.PDAResult.Fail;
  5962. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  5963. }
  5964. }
  5965. catch (Exception ex)
  5966. {
  5967. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5968. OutputLog.TraceLog(LogPriority.Error,
  5969. this.ToString(),
  5970. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5971. ex.ToString(),
  5972. LocalPath.LogExePath);
  5973. actionResult.Status = (int)Constant.PDAResult.Exception;
  5974. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5975. }
  5976. return actionResult;
  5977. }
  5978. /// <summary>
  5979. /// 获取登陆帐户有无入窑前检验数据编辑权限
  5980. /// </summary>
  5981. /// <param name="accountCode"></param>
  5982. /// <param name="userCode"></param>
  5983. /// <param name="userPassword"></param>
  5984. /// <param name="sessionKey"></param>
  5985. /// <param name="usercode">工号编码</param>
  5986. /// <returns></returns>
  5987. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5988. {
  5989. ActionResult actionResult = new ActionResult();
  5990. try
  5991. {
  5992. // 验证请求头信息
  5993. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5994. // 验证失败
  5995. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5996. {
  5997. return actionResult;
  5998. }
  5999. int returnValue = ServiceInvoker.Invoke<int>(this,
  6000. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  6001. actionResult.Result = JsonHelper.ToJson(returnValue);
  6002. actionResult.Status = (int)Constant.PDAResult.Success;
  6003. }
  6004. catch (Exception ex)
  6005. {
  6006. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6007. OutputLog.TraceLog(LogPriority.Error,
  6008. this.ToString(),
  6009. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6010. ex.ToString(),
  6011. LocalPath.LogExePath);
  6012. actionResult.Status = (int)Constant.PDAResult.Exception;
  6013. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6014. }
  6015. return actionResult;
  6016. }
  6017. /// <summary>
  6018. /// 获取登陆帐户有无半检验数据编辑权限
  6019. /// </summary>
  6020. /// <param name="accountCode"></param>
  6021. /// <param name="userCode"></param>
  6022. /// <param name="userPassword"></param>
  6023. /// <param name="sessionKey"></param>
  6024. /// <param name="usercode">工号编码</param>
  6025. /// <returns></returns>
  6026. public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6027. {
  6028. ActionResult actionResult = new ActionResult();
  6029. try
  6030. {
  6031. // 验证请求头信息
  6032. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6033. // 验证失败
  6034. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6035. {
  6036. return actionResult;
  6037. }
  6038. int returnValue = ServiceInvoker.Invoke<int>(this,
  6039. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  6040. actionResult.Result = JsonHelper.ToJson(returnValue);
  6041. actionResult.Status = (int)Constant.PDAResult.Success;
  6042. }
  6043. catch (Exception ex)
  6044. {
  6045. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6046. OutputLog.TraceLog(LogPriority.Error,
  6047. this.ToString(),
  6048. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6049. ex.ToString(),
  6050. LocalPath.LogExePath);
  6051. actionResult.Status = (int)Constant.PDAResult.Exception;
  6052. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6053. }
  6054. return actionResult;
  6055. }
  6056. /// <summary>
  6057. /// 获取缺陷扣罚管理的全部数据
  6058. /// </summary>
  6059. /// <param name="accountCode"></param>
  6060. /// <param name="userCode"></param>
  6061. /// <param name="userPassword"></param>
  6062. /// <param name="sessionKey"></param>
  6063. /// <returns></returns>
  6064. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  6065. {
  6066. ActionResult actionResult = new ActionResult();
  6067. try
  6068. {
  6069. // 验证请求头信息
  6070. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6071. // 验证失败
  6072. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6073. {
  6074. return actionResult;
  6075. }
  6076. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6077. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  6078. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6079. {
  6080. DataView dv = ds.Tables[0].DefaultView;
  6081. dv.RowFilter = "valueflag=1";
  6082. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6083. actionResult.Status = (int)Constant.PDAResult.Success;
  6084. }
  6085. else
  6086. {
  6087. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6088. actionResult.Status = (int)Constant.PDAResult.Success;
  6089. }
  6090. }
  6091. catch (Exception ex)
  6092. {
  6093. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6094. OutputLog.TraceLog(LogPriority.Error,
  6095. this.ToString(),
  6096. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6097. ex.ToString(),
  6098. LocalPath.LogExePath);
  6099. actionResult.Status = (int)Constant.PDAResult.Exception;
  6100. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6101. }
  6102. return actionResult;
  6103. }
  6104. /// <summary>
  6105. /// 获取缺陷扣除数管理的全部数据
  6106. /// </summary>
  6107. /// <param name="accountCode"></param>
  6108. /// <param name="userCode"></param>
  6109. /// <param name="userPassword"></param>
  6110. /// <param name="sessionKey"></param>
  6111. /// <returns></returns>
  6112. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  6113. {
  6114. ActionResult actionResult = new ActionResult();
  6115. try
  6116. {
  6117. // 验证请求头信息
  6118. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6119. // 验证失败
  6120. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6121. {
  6122. return actionResult;
  6123. }
  6124. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6125. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  6126. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6127. {
  6128. DataView dv = ds.Tables[0].DefaultView;
  6129. dv.RowFilter = "valueflag=1";
  6130. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6131. actionResult.Status = (int)Constant.PDAResult.Success;
  6132. }
  6133. else
  6134. {
  6135. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6136. actionResult.Status = (int)Constant.PDAResult.Success;
  6137. }
  6138. }
  6139. catch (Exception ex)
  6140. {
  6141. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6142. OutputLog.TraceLog(LogPriority.Error,
  6143. this.ToString(),
  6144. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6145. ex.ToString(),
  6146. LocalPath.LogExePath);
  6147. actionResult.Status = (int)Constant.PDAResult.Exception;
  6148. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6149. }
  6150. return actionResult;
  6151. }
  6152. /// <summary>
  6153. /// 获取缺陷扣罚关系管理的全部数据
  6154. /// </summary>
  6155. /// <param name="accountCode"></param>
  6156. /// <param name="userCode"></param>
  6157. /// <param name="userPassword"></param>
  6158. /// <param name="sessionKey"></param>
  6159. /// <returns></returns>
  6160. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6161. {
  6162. ActionResult actionResult = new ActionResult();
  6163. try
  6164. {
  6165. // 验证请求头信息
  6166. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6167. // 验证失败
  6168. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6169. {
  6170. return actionResult;
  6171. }
  6172. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6173. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  6174. DataTable dt = new DataTable();
  6175. dt.Columns.Add("DefectID");
  6176. dt.Columns.Add("DefectFineID");
  6177. DataView dv = ds.Tables[0].DefaultView;
  6178. DataTable dtFor = dv.ToTable("defectid", true);
  6179. for (int i = 0; i < dtFor.Rows.Count; i++)
  6180. {
  6181. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6182. string substring = "";
  6183. foreach (DataRow r1 in r)
  6184. {
  6185. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  6186. }
  6187. if (substring != "")
  6188. {
  6189. DataRow drnew = dt.NewRow();
  6190. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6191. drnew["DefectFineID"] = substring.TrimEnd(',');
  6192. dt.Rows.Add(drnew);
  6193. }
  6194. }
  6195. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6196. actionResult.Status = (int)Constant.PDAResult.Success;
  6197. }
  6198. catch (Exception ex)
  6199. {
  6200. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6201. OutputLog.TraceLog(LogPriority.Error,
  6202. this.ToString(),
  6203. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6204. ex.ToString(),
  6205. LocalPath.LogExePath);
  6206. actionResult.Status = (int)Constant.PDAResult.Exception;
  6207. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6208. }
  6209. return actionResult;
  6210. }
  6211. /// <summary>
  6212. /// 获取缺陷扣除数关系管理的全部数据
  6213. /// </summary>
  6214. /// <param name="accountCode"></param>
  6215. /// <param name="userCode"></param>
  6216. /// <param name="userPassword"></param>
  6217. /// <param name="sessionKey"></param>
  6218. /// <returns></returns>
  6219. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6220. {
  6221. ActionResult actionResult = new ActionResult();
  6222. try
  6223. {
  6224. // 验证请求头信息
  6225. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6226. // 验证失败
  6227. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6228. {
  6229. return actionResult;
  6230. }
  6231. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6232. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6233. DataTable dt = new DataTable();
  6234. dt.Columns.Add("DefectID");
  6235. dt.Columns.Add("DefectDeductionNum");
  6236. DataView dv = ds.Tables[0].DefaultView;
  6237. DataTable dtFor = dv.ToTable("defectid", true);
  6238. for (int i = 0; i < dtFor.Rows.Count; i++)
  6239. {
  6240. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6241. string substring = "";
  6242. foreach (DataRow r1 in r)
  6243. {
  6244. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6245. }
  6246. if (substring != "")
  6247. {
  6248. DataRow drnew = dt.NewRow();
  6249. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6250. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6251. dt.Rows.Add(drnew);
  6252. }
  6253. }
  6254. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6255. actionResult.Status = (int)Constant.PDAResult.Success;
  6256. }
  6257. catch (Exception ex)
  6258. {
  6259. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6260. OutputLog.TraceLog(LogPriority.Error,
  6261. this.ToString(),
  6262. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6263. ex.ToString(),
  6264. LocalPath.LogExePath);
  6265. actionResult.Status = (int)Constant.PDAResult.Exception;
  6266. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6267. }
  6268. return actionResult;
  6269. }
  6270. /// <summary>
  6271. /// 获取盘点单明细
  6272. /// </summary>
  6273. /// <param name="sUserInfo"></param>
  6274. /// <returns></returns>
  6275. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6276. {
  6277. ActionResult actionResult = new ActionResult();
  6278. try
  6279. {
  6280. // 验证请求头信息
  6281. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6282. // 验证失败
  6283. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6284. {
  6285. return actionResult;
  6286. }
  6287. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6288. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6289. actionResult.Result = JsonHelper.ToJson(ds);
  6290. actionResult.Status = (int)Constant.PDAResult.Success;
  6291. }
  6292. catch (Exception ex)
  6293. {
  6294. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6295. OutputLog.TraceLog(LogPriority.Error,
  6296. this.ToString(),
  6297. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6298. ex.ToString(),
  6299. LocalPath.LogExePath);
  6300. actionResult.Status = (int)Constant.PDAResult.Exception;
  6301. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6302. }
  6303. return actionResult;
  6304. }
  6305. /// <summary>
  6306. /// 半检检验条码
  6307. /// </summary>
  6308. /// <param name="sUserInfo"></param>
  6309. /// <returns></returns>
  6310. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6311. {
  6312. ActionResult actionResult = new ActionResult();
  6313. try
  6314. {
  6315. // 验证请求头信息
  6316. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6317. // 验证失败
  6318. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6319. {
  6320. return actionResult;
  6321. }
  6322. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6323. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6324. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6325. if (Convert.ToInt32(resultEntity.Result) < 0)
  6326. {
  6327. actionResult.Status = (int)Constant.PDAResult.Fail;
  6328. }
  6329. else
  6330. {
  6331. actionResult.Status = (int)Constant.PDAResult.Success;
  6332. }
  6333. actionResult.Message = resultEntity.Message;
  6334. }
  6335. catch (Exception ex)
  6336. {
  6337. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6338. OutputLog.TraceLog(LogPriority.Error,
  6339. this.ToString(),
  6340. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6341. ex.ToString(),
  6342. LocalPath.LogExePath);
  6343. actionResult.Status = (int)Constant.PDAResult.Exception;
  6344. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6345. }
  6346. return actionResult;
  6347. }
  6348. /// <summary>
  6349. /// 根据条码获取经过的工序,用于绑定返工工序
  6350. /// </summary>
  6351. /// <param name="sUserInfo"></param>
  6352. /// <returns></returns>
  6353. public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6354. {
  6355. ActionResult actionResult = new ActionResult();
  6356. try
  6357. {
  6358. // 验证请求头信息
  6359. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6360. // 验证失败
  6361. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6362. {
  6363. return actionResult;
  6364. }
  6365. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6366. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6367. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6368. actionResult.Status = (int)Constant.PDAResult.Success;
  6369. }
  6370. catch (Exception ex)
  6371. {
  6372. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6373. OutputLog.TraceLog(LogPriority.Error,
  6374. this.ToString(),
  6375. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6376. ex.ToString(),
  6377. LocalPath.LogExePath);
  6378. actionResult.Status = (int)Constant.PDAResult.Exception;
  6379. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6380. }
  6381. return actionResult;
  6382. }
  6383. /// <summary>
  6384. /// 获取登陆帐户有无半检状态权限
  6385. /// </summary>
  6386. /// <param name="sUserInfo"></param>
  6387. /// <returns></returns>
  6388. public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6389. {
  6390. ActionResult actionResult = new ActionResult();
  6391. try
  6392. {
  6393. // 验证请求头信息
  6394. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6395. // 验证失败
  6396. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6397. {
  6398. return actionResult;
  6399. }
  6400. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6401. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6402. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6403. actionResult.Status = (int)Constant.PDAResult.Success;
  6404. }
  6405. catch (Exception ex)
  6406. {
  6407. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6408. OutputLog.TraceLog(LogPriority.Error,
  6409. this.ToString(),
  6410. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6411. ex.ToString(),
  6412. LocalPath.LogExePath);
  6413. actionResult.Status = (int)Constant.PDAResult.Exception;
  6414. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6415. }
  6416. return actionResult;
  6417. }
  6418. /// <summary>
  6419. /// 复检状态数据源
  6420. /// </summary>
  6421. /// <param name="sUserInfo"></param>
  6422. /// <returns></returns>
  6423. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6424. {
  6425. ActionResult actionResult = new ActionResult();
  6426. try
  6427. {
  6428. // 验证请求头信息
  6429. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6430. // 验证失败
  6431. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6432. {
  6433. return actionResult;
  6434. }
  6435. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6436. () => SystemModuleLogic.GetSemiCheckType());
  6437. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6438. actionResult.Status = (int)Constant.PDAResult.Success;
  6439. }
  6440. catch (Exception ex)
  6441. {
  6442. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6443. OutputLog.TraceLog(LogPriority.Error,
  6444. this.ToString(),
  6445. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6446. ex.ToString(),
  6447. LocalPath.LogExePath);
  6448. actionResult.Status = (int)Constant.PDAResult.Exception;
  6449. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6450. }
  6451. return actionResult;
  6452. }
  6453. /// <summary>
  6454. /// 根据半成品检验数据ID,显示半成品数据信息
  6455. /// </summary>
  6456. /// <param name="sUserInfo"></param>
  6457. /// <returns></returns>
  6458. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6459. {
  6460. ActionResult actionResult = new ActionResult();
  6461. try
  6462. {
  6463. // 验证请求头信息
  6464. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6465. // 验证失败
  6466. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6467. {
  6468. return actionResult;
  6469. }
  6470. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6471. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6472. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6473. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6474. {
  6475. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6476. {
  6477. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6478. {
  6479. SemiCheckEntity productionData = new SemiCheckEntity();
  6480. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6481. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6482. {
  6483. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6484. }
  6485. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6486. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6487. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6488. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6489. productionData.ReFine = 0;
  6490. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6491. {
  6492. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6493. }
  6494. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6495. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6496. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6497. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6498. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6499. {
  6500. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6501. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6502. }
  6503. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6504. {
  6505. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6506. }
  6507. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6508. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6509. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6510. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6511. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6512. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6513. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6514. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6515. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6516. {
  6517. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6518. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6519. }
  6520. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6521. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6522. {
  6523. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6524. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6525. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6526. }
  6527. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6528. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6529. {
  6530. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6531. }
  6532. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6533. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6534. DataTable dtDefect = dvDefect.ToTable();
  6535. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6536. {
  6537. // 产品缺陷
  6538. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6539. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6540. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6541. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6542. //{
  6543. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6544. //}
  6545. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6546. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6547. {
  6548. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6549. }
  6550. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6551. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6552. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6553. {
  6554. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6555. }
  6556. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6557. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6558. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6559. {
  6560. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6561. }
  6562. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6563. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6564. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6565. {
  6566. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6567. }
  6568. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6569. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6570. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6571. //{
  6572. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6573. //}
  6574. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6575. //{
  6576. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6577. //}
  6578. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6579. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6580. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6581. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6582. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6583. {
  6584. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6585. }
  6586. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6587. {
  6588. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6589. }
  6590. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6591. //{
  6592. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6593. //}
  6594. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6595. //--------责任员工-------------------
  6596. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6597. if (drRow.Length > Constant.INT_IS_ZERO)
  6598. {
  6599. if (defect.DefectResponsibles == null)
  6600. {
  6601. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6602. }
  6603. foreach (DataRow r in drRow)
  6604. {
  6605. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6606. if (r["SemiCheckDefectID"].ToString() != "")
  6607. {
  6608. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6609. }
  6610. if (r["StaffID"].ToString() != "")
  6611. {
  6612. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6613. }
  6614. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6615. defectResponsible.StaffName = r["StaffName"].ToString();
  6616. if (r["StaffStatus"].ToString() != "")
  6617. {
  6618. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6619. }
  6620. if (r["UJobsID"].ToString() != "")
  6621. {
  6622. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6623. }
  6624. if (r["SJobsID"].ToString() != "")
  6625. {
  6626. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6627. }
  6628. defect.DefectResponsibles.Add(defectResponsible);
  6629. }
  6630. }
  6631. //------------------------------
  6632. if (productionData.SemiCheckDefects == null)
  6633. {
  6634. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6635. }
  6636. productionData.SemiCheckDefects.Add(defect);
  6637. }
  6638. //if (productionDatas.PDAProductionData == null)
  6639. //{
  6640. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6641. //}
  6642. productionDatas[0] = productionData;
  6643. //---------------------------------------------------------------------------------
  6644. }
  6645. }
  6646. }
  6647. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6648. actionResult.Status = (int)Constant.PDAResult.Success;
  6649. }
  6650. catch (Exception ex)
  6651. {
  6652. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6653. OutputLog.TraceLog(LogPriority.Error,
  6654. this.ToString(),
  6655. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6656. ex.ToString(),
  6657. LocalPath.LogExePath);
  6658. actionResult.Status = (int)Constant.PDAResult.Exception;
  6659. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6660. }
  6661. return actionResult;
  6662. }
  6663. /// <summary>
  6664. /// 保存半检登记
  6665. /// </summary>
  6666. /// <param name="accountCode">帐套code</param>
  6667. /// <param name="userCode">用户code</param>
  6668. /// <param name="userPassword">用户密码</param>
  6669. /// <param name="sessionKey">本次登陆密钥</param>
  6670. /// <param name="entity">半检实体类</param>
  6671. /// <param name="sUserInfo">用户基本信息</param>
  6672. /// <returns></returns>
  6673. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6674. {
  6675. ActionResult actionResult = new ActionResult();
  6676. try
  6677. {
  6678. // 验证请求头信息
  6679. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6680. // 验证失败
  6681. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6682. {
  6683. return actionResult;
  6684. }
  6685. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6686. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6687. string err = string.Empty;
  6688. err = resultEntity.Message;
  6689. if (err == null)
  6690. {
  6691. err = "";
  6692. }
  6693. SemiCheckEntity entity = entityobj[0];
  6694. if (entity.SemiCheckCategory == 1) // 半检登记
  6695. {
  6696. }
  6697. else if (entity.SemiCheckCategory == 2)// 复检登记
  6698. {
  6699. err = JsonHelper.ToJson(err);
  6700. }
  6701. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6702. {
  6703. err = JsonHelper.ToJson(err);
  6704. }
  6705. //actionResult.Result = JsonHelper.ToJson(err);
  6706. actionResult.Result = err;//JsonHelper.ToJson(err);
  6707. actionResult.Status = (int)Constant.PDAResult.Success;
  6708. }
  6709. catch (Exception ex)
  6710. {
  6711. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6712. OutputLog.TraceLog(LogPriority.Error,
  6713. this.ToString(),
  6714. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6715. ex.ToString(),
  6716. LocalPath.LogExePath);
  6717. actionResult.Status = (int)Constant.PDAResult.Exception;
  6718. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6719. }
  6720. return actionResult;
  6721. }
  6722. /// <summary>
  6723. /// 根据所选工号,查出缺陷责任员工
  6724. /// </summary>
  6725. /// <param name="sUserInfo"></param>
  6726. /// <returns></returns>
  6727. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6728. {
  6729. ActionResult actionResult = new ActionResult();
  6730. try
  6731. {
  6732. // 验证请求头信息
  6733. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6734. // 验证失败
  6735. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6736. {
  6737. return actionResult;
  6738. }
  6739. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6740. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  6741. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6742. actionResult.Status = (int)Constant.PDAResult.Success;
  6743. }
  6744. catch (Exception ex)
  6745. {
  6746. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6747. OutputLog.TraceLog(LogPriority.Error,
  6748. this.ToString(),
  6749. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6750. ex.ToString(),
  6751. LocalPath.LogExePath);
  6752. actionResult.Status = (int)Constant.PDAResult.Exception;
  6753. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6754. }
  6755. return actionResult;
  6756. }
  6757. /// <summary>
  6758. /// 获取半成品缺陷管理的全部数据
  6759. /// </summary>
  6760. /// <param name="sUserInfo"></param>
  6761. /// <returns></returns>
  6762. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  6763. {
  6764. ActionResult actionResult = new ActionResult();
  6765. try
  6766. {
  6767. // 验证请求头信息
  6768. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6769. // 验证失败
  6770. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6771. {
  6772. return actionResult;
  6773. }
  6774. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6775. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  6776. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6777. actionResult.Status = (int)Constant.PDAResult.Success;
  6778. }
  6779. catch (Exception ex)
  6780. {
  6781. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6782. OutputLog.TraceLog(LogPriority.Error,
  6783. this.ToString(),
  6784. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6785. ex.ToString(),
  6786. LocalPath.LogExePath);
  6787. actionResult.Status = (int)Constant.PDAResult.Exception;
  6788. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6789. }
  6790. return actionResult;
  6791. }
  6792. /// <summary>
  6793. /// 获取半成品缺陷位置管理的全部数据
  6794. /// </summary>
  6795. /// <param name="sUserInfo"></param>
  6796. /// <returns></returns>
  6797. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  6798. {
  6799. ActionResult actionResult = new ActionResult();
  6800. try
  6801. {
  6802. // 验证请求头信息
  6803. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6804. // 验证失败
  6805. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6806. {
  6807. return actionResult;
  6808. }
  6809. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6810. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  6811. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6812. actionResult.Status = (int)Constant.PDAResult.Success;
  6813. }
  6814. catch (Exception ex)
  6815. {
  6816. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6817. OutputLog.TraceLog(LogPriority.Error,
  6818. this.ToString(),
  6819. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6820. ex.ToString(),
  6821. LocalPath.LogExePath);
  6822. actionResult.Status = (int)Constant.PDAResult.Exception;
  6823. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6824. }
  6825. return actionResult;
  6826. }
  6827. /// <summary>
  6828. /// 复检验条码
  6829. /// </summary>
  6830. /// <param name="sUserInfo"></param>
  6831. /// <returns></returns>
  6832. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  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. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6845. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  6846. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6847. if (Convert.ToInt32(resultEntity.Result) < 0)
  6848. {
  6849. actionResult.Status = (int)Constant.PDAResult.Fail;
  6850. }
  6851. else
  6852. {
  6853. actionResult.Status = (int)Constant.PDAResult.Success;
  6854. }
  6855. actionResult.Message = resultEntity.Message;
  6856. }
  6857. catch (Exception ex)
  6858. {
  6859. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6860. OutputLog.TraceLog(LogPriority.Error,
  6861. this.ToString(),
  6862. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6863. ex.ToString(),
  6864. LocalPath.LogExePath);
  6865. actionResult.Status = (int)Constant.PDAResult.Exception;
  6866. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6867. }
  6868. return actionResult;
  6869. }
  6870. /// <summary>
  6871. /// 撤销复检验条码
  6872. /// </summary>
  6873. /// <param name="sUserInfo"></param>
  6874. /// <returns></returns>
  6875. public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6876. {
  6877. ActionResult actionResult = new ActionResult();
  6878. try
  6879. {
  6880. // 验证请求头信息
  6881. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6882. // 验证失败
  6883. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6884. {
  6885. return actionResult;
  6886. }
  6887. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6888. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  6889. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6890. if (Convert.ToInt32(resultEntity.Result) < 0)
  6891. {
  6892. actionResult.Status = (int)Constant.PDAResult.Fail;
  6893. }
  6894. else
  6895. {
  6896. actionResult.Status = (int)Constant.PDAResult.Success;
  6897. }
  6898. actionResult.Message = resultEntity.Message;
  6899. }
  6900. catch (Exception ex)
  6901. {
  6902. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6903. OutputLog.TraceLog(LogPriority.Error,
  6904. this.ToString(),
  6905. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6906. ex.ToString(),
  6907. LocalPath.LogExePath);
  6908. actionResult.Status = (int)Constant.PDAResult.Exception;
  6909. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6910. }
  6911. return actionResult;
  6912. }
  6913. /// <summary>
  6914. /// 恢复数据
  6915. /// </summary>
  6916. /// <param name="sUserInfo"></param>
  6917. /// <returns></returns>
  6918. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6919. {
  6920. ActionResult actionResult = new ActionResult();
  6921. try
  6922. {
  6923. // 验证请求头信息
  6924. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6925. // 验证失败
  6926. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6927. {
  6928. return actionResult;
  6929. }
  6930. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6931. () => PMModuleLogicDAL.ResetBarCode(barcode));
  6932. if (resultEntity > 0)
  6933. {
  6934. actionResult.Status = (int)Constant.PDAResult.Success;
  6935. actionResult.Message = "恢复数据成功";
  6936. }
  6937. else
  6938. {
  6939. actionResult.Status = (int)Constant.PDAResult.Fail;
  6940. if (resultEntity == -1)
  6941. {
  6942. actionResult.Message = "此条码没有清除,不能恢复";
  6943. }
  6944. else if (resultEntity == 0)
  6945. {
  6946. actionResult.Message = "没有可恢复的数据";
  6947. }
  6948. }
  6949. }
  6950. catch (Exception ex)
  6951. {
  6952. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6953. OutputLog.TraceLog(LogPriority.Error,
  6954. this.ToString(),
  6955. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6956. ex.ToString(),
  6957. LocalPath.LogExePath);
  6958. actionResult.Status = (int)Constant.PDAResult.Exception;
  6959. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6960. }
  6961. return actionResult;
  6962. }
  6963. /// <summary>
  6964. /// 通过SettingCode获取系统参数管理的数据
  6965. /// </summary>
  6966. /// <param name="accountCode"></param>
  6967. /// <param name="userCode"></param>
  6968. /// <param name="userPassword"></param>
  6969. /// <param name="sessionKey"></param>
  6970. /// <param name="settingcode">设置编码</param>
  6971. /// <returns></returns>
  6972. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  6973. {
  6974. ActionResult actionResult = new ActionResult();
  6975. try
  6976. {
  6977. // 验证请求头信息
  6978. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6979. // 验证失败
  6980. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6981. {
  6982. return actionResult;
  6983. }
  6984. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6985. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  6986. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6987. actionResult.Status = (int)Constant.PDAResult.Success;
  6988. }
  6989. catch (Exception ex)
  6990. {
  6991. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6992. OutputLog.TraceLog(LogPriority.Error,
  6993. this.ToString(),
  6994. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6995. ex.ToString(),
  6996. LocalPath.LogExePath);
  6997. actionResult.Status = (int)Constant.PDAResult.Exception;
  6998. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6999. }
  7000. return actionResult;
  7001. }
  7002. /// <summary>
  7003. /// 校验条码是否允许撤销,如果不允许提示错误消息
  7004. /// </summary>
  7005. /// <param name="accountCode"></param>
  7006. /// <param name="userCode"></param>
  7007. /// <param name="userPassword"></param>
  7008. /// <param name="sessionKey"></param>
  7009. /// <param name="orgTime">原时间</param>
  7010. /// <param name="days">允许撤销天数</param>
  7011. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  7012. /// <returns></returns>
  7013. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  7014. {
  7015. ActionResult actionResult = new ActionResult();
  7016. try
  7017. {
  7018. // 验证请求头信息
  7019. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7020. // 验证失败
  7021. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7022. {
  7023. return actionResult;
  7024. }
  7025. string[] subOrgTime = orgTime.Split('-');
  7026. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  7027. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7028. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  7029. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7030. if (Convert.ToInt32(resultEntity.Result) < 0)
  7031. {
  7032. actionResult.Status = (int)Constant.PDAResult.Fail;
  7033. }
  7034. else
  7035. {
  7036. actionResult.Status = (int)Constant.PDAResult.Success;
  7037. }
  7038. actionResult.Message = resultEntity.Message;
  7039. }
  7040. catch (Exception ex)
  7041. {
  7042. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7043. OutputLog.TraceLog(LogPriority.Error,
  7044. this.ToString(),
  7045. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7046. ex.ToString(),
  7047. LocalPath.LogExePath);
  7048. actionResult.Status = (int)Constant.PDAResult.Exception;
  7049. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7050. }
  7051. return actionResult;
  7052. }
  7053. /// <summary>
  7054. /// 获取生产订单管理的全部数据
  7055. /// </summary>
  7056. /// <param name="sUserInfo"></param>
  7057. /// <returns></returns>
  7058. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  7059. {
  7060. ActionResult actionResult = new ActionResult();
  7061. try
  7062. {
  7063. // 验证请求头信息
  7064. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7065. // 验证失败
  7066. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7067. {
  7068. return actionResult;
  7069. }
  7070. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7071. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  7072. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7073. actionResult.Status = (int)Constant.PDAResult.Success;
  7074. }
  7075. catch (Exception ex)
  7076. {
  7077. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7078. OutputLog.TraceLog(LogPriority.Error,
  7079. this.ToString(),
  7080. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7081. ex.ToString(),
  7082. LocalPath.LogExePath);
  7083. actionResult.Status = (int)Constant.PDAResult.Exception;
  7084. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7085. }
  7086. return actionResult;
  7087. }
  7088. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7089. {
  7090. ActionResult actionResult = new ActionResult();
  7091. try
  7092. {
  7093. // 验证请求头信息
  7094. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7095. // 验证失败
  7096. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7097. {
  7098. return actionResult;
  7099. }
  7100. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7101. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  7102. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7103. if (Convert.ToInt32(resultEntity.Result) < 0)
  7104. {
  7105. actionResult.Status = (int)Constant.PDAResult.Fail;
  7106. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  7107. }
  7108. else
  7109. {
  7110. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  7111. actionResult.Status = (int)Constant.PDAResult.Success;
  7112. }
  7113. actionResult.Message = resultEntity.Message;
  7114. }
  7115. catch (Exception ex)
  7116. {
  7117. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7118. OutputLog.TraceLog(LogPriority.Error,
  7119. this.ToString(),
  7120. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7121. ex.ToString(),
  7122. LocalPath.LogExePath);
  7123. actionResult.Status = (int)Constant.PDAResult.Exception;
  7124. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7125. }
  7126. return actionResult;
  7127. }
  7128. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  7129. {
  7130. ActionResult actionResult = new ActionResult();
  7131. try
  7132. {
  7133. // 验证请求头信息
  7134. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7135. // 验证失败
  7136. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7137. {
  7138. return actionResult;
  7139. }
  7140. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7141. () => SystemModuleLogic.GetSystemData(sUserInfo));
  7142. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7143. actionResult.Status = (int)Constant.PDAResult.Success;
  7144. }
  7145. catch (Exception ex)
  7146. {
  7147. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7148. OutputLog.TraceLog(LogPriority.Error,
  7149. this.ToString(),
  7150. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7151. ex.ToString(),
  7152. LocalPath.LogExePath);
  7153. actionResult.Status = (int)Constant.PDAResult.Exception;
  7154. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7155. }
  7156. return actionResult;
  7157. }
  7158. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  7159. {
  7160. ActionResult actionResult = new ActionResult();
  7161. try
  7162. {
  7163. // 验证请求头信息
  7164. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7165. // 验证失败
  7166. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7167. {
  7168. return actionResult;
  7169. }
  7170. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  7171. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7172. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  7173. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7174. if (Convert.ToInt32(resultEntity.Result) < 0)
  7175. {
  7176. actionResult.Status = (int)Constant.PDAResult.Fail;
  7177. }
  7178. else
  7179. {
  7180. actionResult.Status = (int)Constant.PDAResult.Success;
  7181. }
  7182. actionResult.Message = resultEntity.Message;
  7183. }
  7184. catch (Exception ex)
  7185. {
  7186. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7187. OutputLog.TraceLog(LogPriority.Error,
  7188. this.ToString(),
  7189. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7190. ex.ToString(),
  7191. LocalPath.LogExePath);
  7192. actionResult.Status = (int)Constant.PDAResult.Exception;
  7193. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7194. }
  7195. return actionResult;
  7196. }
  7197. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7198. {
  7199. ActionResult actionResult = new ActionResult();
  7200. try
  7201. {
  7202. // 验证请求头信息
  7203. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7204. // 验证失败
  7205. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7206. {
  7207. return actionResult;
  7208. }
  7209. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7210. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7211. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7212. if (Convert.ToInt32(resultEntity.Result) < 0)
  7213. {
  7214. actionResult.Status = (int)Constant.PDAResult.Fail;
  7215. }
  7216. else
  7217. {
  7218. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7219. actionResult.Status = (int)Constant.PDAResult.Success;
  7220. }
  7221. actionResult.Message = resultEntity.Message;
  7222. }
  7223. catch (Exception ex)
  7224. {
  7225. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7226. OutputLog.TraceLog(LogPriority.Error,
  7227. this.ToString(),
  7228. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7229. ex.ToString(),
  7230. LocalPath.LogExePath);
  7231. actionResult.Status = (int)Constant.PDAResult.Exception;
  7232. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7233. }
  7234. return actionResult;
  7235. }
  7236. public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7237. {
  7238. ActionResult actionResult = new ActionResult();
  7239. try
  7240. {
  7241. // 验证请求头信息
  7242. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7243. // 验证失败
  7244. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7245. {
  7246. return actionResult;
  7247. }
  7248. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7249. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7250. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7251. if (Convert.ToInt32(resultEntity.Result) < 0)
  7252. {
  7253. actionResult.Status = (int)Constant.PDAResult.Fail;
  7254. }
  7255. else
  7256. {
  7257. actionResult.Status = (int)Constant.PDAResult.Success;
  7258. }
  7259. actionResult.Message = resultEntity.Message;
  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. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7275. {
  7276. ActionResult actionResult = new ActionResult();
  7277. try
  7278. {
  7279. // 验证请求头信息
  7280. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7281. // 验证失败
  7282. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7283. {
  7284. return actionResult;
  7285. }
  7286. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7287. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7288. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7289. if (Convert.ToInt32(resultEntity.Result) < 0)
  7290. {
  7291. actionResult.Status = (int)Constant.PDAResult.Fail;
  7292. }
  7293. else
  7294. {
  7295. actionResult.Status = (int)Constant.PDAResult.Success;
  7296. }
  7297. actionResult.Message = resultEntity.Message;
  7298. }
  7299. catch (Exception ex)
  7300. {
  7301. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7302. OutputLog.TraceLog(LogPriority.Error,
  7303. this.ToString(),
  7304. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7305. ex.ToString(),
  7306. LocalPath.LogExePath);
  7307. actionResult.Status = (int)Constant.PDAResult.Exception;
  7308. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7309. }
  7310. return actionResult;
  7311. }
  7312. #region PDA条码打印
  7313. /// <summary>
  7314. /// 获取条码打印机
  7315. /// </summary>
  7316. /// <param name="accountCode"></param>
  7317. /// <param name="userCode"></param>
  7318. /// <param name="userPassword"></param>
  7319. /// <param name="sessionKey"></param>
  7320. /// <returns></returns>
  7321. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printType=0)
  7322. {
  7323. ActionResult actionResult = new ActionResult();
  7324. try
  7325. {
  7326. // 验证请求头信息
  7327. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7328. // 验证失败
  7329. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7330. {
  7331. return actionResult;
  7332. }
  7333. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType);
  7334. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7335. actionResult.Status = (int)Constant.PDAResult.Success;
  7336. }
  7337. catch (Exception ex)
  7338. {
  7339. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7340. OutputLog.TraceLog(LogPriority.Error,
  7341. this.ToString(),
  7342. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7343. ex.ToString(),
  7344. LocalPath.LogExePath);
  7345. actionResult.Status = (int)Constant.PDAResult.Exception;
  7346. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7347. }
  7348. return actionResult;
  7349. }
  7350. /// <summary>
  7351. /// 打印条码样式(补打)
  7352. /// </summary>
  7353. /// <param name="accountCode"></param>
  7354. /// <param name="userCode"></param>
  7355. /// <param name="userPassword"></param>
  7356. /// <param name="sessionKey"></param>
  7357. /// <returns></returns>
  7358. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey,
  7359. string barcode, int copies, int printerID, int printWay=2)
  7360. {
  7361. ActionResult actionResult = new ActionResult();
  7362. try
  7363. {
  7364. // 验证请求头信息
  7365. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7366. // 验证失败
  7367. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7368. {
  7369. return actionResult;
  7370. }
  7371. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7372. // copies, printerID, sUserInfo);
  7373. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(barcode,
  7374. copies, printerID, sUserInfo, printWay);
  7375. if (sre.Status != Constant.ServiceResultStatus.Success)
  7376. {
  7377. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7378. actionResult.Message = sre.Message;
  7379. return actionResult;
  7380. }
  7381. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7382. actionResult.Status = (int)Constant.PDAResult.Success;
  7383. }
  7384. catch (Exception ex)
  7385. {
  7386. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7387. OutputLog.TraceLog(LogPriority.Error,
  7388. this.ToString(),
  7389. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7390. ex.ToString(),
  7391. LocalPath.LogExePath);
  7392. actionResult.Status = (int)Constant.PDAResult.Exception;
  7393. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7394. }
  7395. return actionResult;
  7396. }
  7397. #endregion PDA条码打印
  7398. #region 统计报表
  7399. /// <summary>
  7400. /// 成型结算报表
  7401. /// </summary>
  7402. /// <param name="accountCode"></param>
  7403. /// <param name="userCode"></param>
  7404. /// <param name="userPassword"></param>
  7405. /// <param name="sessionKey"></param>
  7406. /// <returns></returns>
  7407. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7408. int currentMonth)
  7409. {
  7410. ActionResult actionResult = new ActionResult();
  7411. try
  7412. {
  7413. // 验证请求头信息
  7414. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7415. // 验证失败
  7416. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7417. {
  7418. return actionResult;
  7419. }
  7420. DateTime date = DateTime.Now;
  7421. if (currentMonth != 1)
  7422. {
  7423. date = date.AddMonths(-1);
  7424. }
  7425. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7426. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7427. if (resultEntity == null || resultEntity.Data == null)
  7428. {
  7429. actionResult.Status = (int)Constant.PDAResult.Fail;
  7430. actionResult.Message = "查询失败";
  7431. return actionResult;
  7432. }
  7433. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7434. {
  7435. actionResult.Status = (int)Constant.PDAResult.Fail;
  7436. actionResult.Message = resultEntity.Message;
  7437. return actionResult;
  7438. }
  7439. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7440. actionResult.Status = (int)Constant.PDAResult.Success;
  7441. }
  7442. catch (Exception ex)
  7443. {
  7444. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7445. OutputLog.TraceLog(LogPriority.Error,
  7446. this.ToString(),
  7447. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7448. ex.ToString(),
  7449. LocalPath.LogExePath);
  7450. actionResult.Status = (int)Constant.PDAResult.Exception;
  7451. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7452. }
  7453. return actionResult;
  7454. }
  7455. #endregion
  7456. #region 设置当期用户默认打印机配置
  7457. /// <summary>
  7458. /// 设置当期用户默认打印机配置
  7459. /// </summary>
  7460. /// <param name="accountCode"></param>
  7461. /// <param name="userCode"></param>
  7462. /// <param name="userPassword"></param>
  7463. /// <param name="sessionKey"></param>
  7464. /// <param name="printerID"></param>
  7465. /// <returns></returns>
  7466. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7467. int printerID)
  7468. {
  7469. ActionResult actionResult = new ActionResult();
  7470. try
  7471. {
  7472. // 验证请求头信息
  7473. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7474. // 验证失败
  7475. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7476. {
  7477. return actionResult;
  7478. }
  7479. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7480. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7481. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7482. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7483. {
  7484. actionResult.Status = (int)Constant.PDAResult.Fail;
  7485. }
  7486. else
  7487. {
  7488. actionResult.Status = (int)Constant.PDAResult.Success;
  7489. }
  7490. actionResult.Message = resultEntity.Message;
  7491. }
  7492. catch (Exception ex)
  7493. {
  7494. OutputLog.TraceLog(LogPriority.Error,
  7495. this.ToString(),
  7496. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7497. ex.ToString(),
  7498. LocalPath.LogExePath);
  7499. actionResult.Status = (int)Constant.PDAResult.Exception;
  7500. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7501. }
  7502. return actionResult;
  7503. }
  7504. /// <summary>
  7505. /// 校验产品条码是否可以进行回收
  7506. /// </summary>
  7507. /// <param name="accountCode">帐套code</param>
  7508. /// <param name="userCode">用户code</param>
  7509. /// <param name="userPassword">用户密码</param>
  7510. /// <param name="sessionKey">本次登陆密钥</param>
  7511. /// <param name="procedureID">工序ID</param>
  7512. /// <param name="barcode">条码</param>
  7513. /// <returns></returns>
  7514. /// <remarks>
  7515. /// 王鑫 2017.7.21 新建
  7516. /// </remarks>
  7517. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7518. {
  7519. ActionResult actionResult = new ActionResult();
  7520. try
  7521. {
  7522. // 验证请求头信息
  7523. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7524. // 验证失败
  7525. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7526. {
  7527. return actionResult;
  7528. }
  7529. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7530. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7531. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7532. {
  7533. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7534. actionResult.Status = (int)Constant.PDAResult.Success;
  7535. }
  7536. else
  7537. {
  7538. actionResult.Status = (int)Constant.PDAResult.Fail;
  7539. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7540. }
  7541. }
  7542. catch (Exception ex)
  7543. {
  7544. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7545. OutputLog.TraceLog(LogPriority.Error,
  7546. this.ToString(),
  7547. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7548. ex.ToString(),
  7549. LocalPath.LogExePath);
  7550. actionResult.Status = (int)Constant.PDAResult.Exception;
  7551. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7552. }
  7553. return actionResult;
  7554. }
  7555. /// <summary>
  7556. /// 获取回收标识
  7557. /// </summary>
  7558. /// <param name="accountCode"></param>
  7559. /// <param name="userCode"></param>
  7560. /// <param name="userPassword"></param>
  7561. /// <param name="sessionKey"></param>
  7562. /// <param name="usercode">工号编码</param>
  7563. /// <returns></returns>
  7564. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7565. {
  7566. ActionResult actionResult = new ActionResult();
  7567. try
  7568. {
  7569. // 验证请求头信息
  7570. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7571. // 验证失败
  7572. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7573. {
  7574. return actionResult;
  7575. }
  7576. int returnValue = ServiceInvoker.Invoke<int>(this,
  7577. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7578. actionResult.Result = JsonHelper.ToJson(returnValue);
  7579. actionResult.Status = (int)Constant.PDAResult.Success;
  7580. }
  7581. catch (Exception ex)
  7582. {
  7583. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7584. OutputLog.TraceLog(LogPriority.Error,
  7585. this.ToString(),
  7586. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7587. ex.ToString(),
  7588. LocalPath.LogExePath);
  7589. actionResult.Status = (int)Constant.PDAResult.Exception;
  7590. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7591. }
  7592. return actionResult;
  7593. }
  7594. #endregion
  7595. #region 注浆盘点
  7596. /// <summary>
  7597. /// 获取注浆盘点单列表
  7598. /// </summary>
  7599. /// <param name="sUserInfo"></param>
  7600. /// <returns></returns>
  7601. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7602. {
  7603. ActionResult actionResult = new ActionResult();
  7604. try
  7605. {
  7606. // 验证请求头信息
  7607. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7608. // 验证失败
  7609. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7610. {
  7611. return actionResult;
  7612. }
  7613. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7614. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7615. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7616. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7617. actionResult.Result = JsonHelper.ToJson(ds);
  7618. actionResult.Status = (int)Constant.PDAResult.Success;
  7619. }
  7620. catch (Exception ex)
  7621. {
  7622. string json = JsonHelper.ToJson(entity);
  7623. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7624. OutputLog.TraceLog(LogPriority.Error,
  7625. this.ToString(),
  7626. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  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="accountCode"></param>
  7638. /// <param name="userCode"></param>
  7639. /// <param name="userPassword"></param>
  7640. /// <param name="sessionKey"></param>
  7641. /// <param name="InCheckedID">盘点单ID</param>
  7642. /// <param name="BarCode">产品条码</param>
  7643. /// <returns></returns>
  7644. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7645. {
  7646. ActionResult actionResult = new ActionResult();
  7647. try
  7648. {
  7649. // 验证请求头信息
  7650. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7651. // 验证失败
  7652. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7653. {
  7654. return actionResult;
  7655. }
  7656. ClientRequestEntity cre = new ClientRequestEntity();
  7657. cre.Properties["CheckedID"] = CheckedID;
  7658. cre.Properties["Barcode"] = BarCode;
  7659. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7660. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7661. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7662. {
  7663. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7664. actionResult.Status = (int)Constant.PDAResult.Success;
  7665. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7666. }
  7667. else
  7668. {
  7669. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7670. actionResult.Status = (int)Constant.PDAResult.Fail;
  7671. actionResult.Message = returnValue.Message;
  7672. }
  7673. }
  7674. catch (Exception ex)
  7675. {
  7676. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7677. OutputLog.TraceLog(LogPriority.Error,
  7678. this.ToString(),
  7679. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7680. ex.ToString(),
  7681. LocalPath.LogExePath);
  7682. actionResult.Status = (int)Constant.PDAResult.Exception;
  7683. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7684. }
  7685. return actionResult;
  7686. }
  7687. /// <summary>
  7688. /// 获取盘点单明细
  7689. /// </summary>
  7690. /// <param name="sUserInfo"></param>
  7691. /// <returns></returns>
  7692. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7693. {
  7694. ActionResult actionResult = new ActionResult();
  7695. try
  7696. {
  7697. // 验证请求头信息
  7698. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7699. // 验证失败
  7700. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7701. {
  7702. return actionResult;
  7703. }
  7704. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7705. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  7706. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  7707. actionResult.Result = JsonHelper.ToJson(ds);
  7708. actionResult.Status = (int)Constant.PDAResult.Success;
  7709. }
  7710. catch (Exception ex)
  7711. {
  7712. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7713. OutputLog.TraceLog(LogPriority.Error,
  7714. this.ToString(),
  7715. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7716. ex.ToString(),
  7717. LocalPath.LogExePath);
  7718. actionResult.Status = (int)Constant.PDAResult.Exception;
  7719. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7720. }
  7721. return actionResult;
  7722. }
  7723. #endregion
  7724. #region 模具盘点
  7725. /// <summary>
  7726. /// 获取模具盘点单列表
  7727. /// </summary>
  7728. /// <param name="sUserInfo"></param>
  7729. /// <returns></returns>
  7730. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7731. {
  7732. ActionResult actionResult = new ActionResult();
  7733. try
  7734. {
  7735. // 验证请求头信息
  7736. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7737. // 验证失败
  7738. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7739. {
  7740. return actionResult;
  7741. }
  7742. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7743. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7744. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7745. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  7746. actionResult.Result = JsonHelper.ToJson(ds);
  7747. actionResult.Status = (int)Constant.PDAResult.Success;
  7748. }
  7749. catch (Exception ex)
  7750. {
  7751. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7752. OutputLog.TraceLog(LogPriority.Error,
  7753. this.ToString(),
  7754. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7755. ex.ToString(),
  7756. LocalPath.LogExePath);
  7757. actionResult.Status = (int)Constant.PDAResult.Exception;
  7758. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7759. }
  7760. return actionResult;
  7761. }
  7762. /// <summary>
  7763. /// 进行盘点操作
  7764. /// </summary>
  7765. /// <param name="accountCode"></param>
  7766. /// <param name="userCode"></param>
  7767. /// <param name="userPassword"></param>
  7768. /// <param name="sessionKey"></param>
  7769. /// <param name="InCheckedID">盘点单ID</param>
  7770. /// <param name="BarCode">产品条码</param>
  7771. /// <returns></returns>
  7772. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7773. {
  7774. ActionResult actionResult = new ActionResult();
  7775. try
  7776. {
  7777. // 验证请求头信息
  7778. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7779. // 验证失败
  7780. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7781. {
  7782. return actionResult;
  7783. }
  7784. ClientRequestEntity cre = new ClientRequestEntity();
  7785. cre.Properties["CheckedID"] = CheckedID;
  7786. cre.Properties["Barcode"] = BarCode;
  7787. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7788. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  7789. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7790. {
  7791. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7792. actionResult.Status = (int)Constant.PDAResult.Success;
  7793. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7794. }
  7795. else
  7796. {
  7797. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7798. actionResult.Status = (int)Constant.PDAResult.Fail;
  7799. actionResult.Message = returnValue.Message;
  7800. }
  7801. }
  7802. catch (Exception ex)
  7803. {
  7804. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7805. OutputLog.TraceLog(LogPriority.Error,
  7806. this.ToString(),
  7807. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7808. ex.ToString(),
  7809. LocalPath.LogExePath);
  7810. actionResult.Status = (int)Constant.PDAResult.Exception;
  7811. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7812. }
  7813. return actionResult;
  7814. }
  7815. /// <summary>
  7816. /// 获取盘点单明细
  7817. /// </summary>
  7818. /// <param name="sUserInfo"></param>
  7819. /// <returns></returns>
  7820. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7821. {
  7822. ActionResult actionResult = new ActionResult();
  7823. try
  7824. {
  7825. // 验证请求头信息
  7826. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7827. // 验证失败
  7828. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7829. {
  7830. return actionResult;
  7831. }
  7832. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7833. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  7834. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  7835. actionResult.Result = JsonHelper.ToJson(ds);
  7836. actionResult.Status = (int)Constant.PDAResult.Success;
  7837. }
  7838. catch (Exception ex)
  7839. {
  7840. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7841. OutputLog.TraceLog(LogPriority.Error,
  7842. this.ToString(),
  7843. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7844. ex.ToString(),
  7845. LocalPath.LogExePath);
  7846. actionResult.Status = (int)Constant.PDAResult.Exception;
  7847. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7848. }
  7849. return actionResult;
  7850. }
  7851. #endregion
  7852. #region 通用接口
  7853. /// <summary>
  7854. /// PDA调用通用接口
  7855. /// </summary>
  7856. /// <param name="accountCode"></param>
  7857. /// <param name="userCode"></param>
  7858. /// <param name="userPassword"></param>
  7859. /// <param name="sessionKey"></param>
  7860. /// <param name="module"></param>
  7861. /// <param name="action"></param>
  7862. /// <param name="data"></param>
  7863. /// <returns></returns>
  7864. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  7865. string module, string action, string jsonData)
  7866. {
  7867. ActionResult actionResult = null;
  7868. try
  7869. {
  7870. // 验证请求头信息
  7871. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7872. // 验证失败
  7873. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7874. {
  7875. return actionResult;
  7876. }
  7877. actionResult.Status = (int)Constant.PDAResult.Fail;
  7878. Dictionary<string, object> data = null;
  7879. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  7880. {
  7881. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  7882. }
  7883. #region PDA报表
  7884. if (module == "Report")
  7885. {
  7886. // 成型月度结算
  7887. if (action == "GetGroutingSettlementInfo")
  7888. {
  7889. DateTime month = DateTime.Now;
  7890. month = new DateTime(month.Year, month.Month, 1);
  7891. //month = new DateTime(2017, 6, 1);
  7892. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7893. if (currentMonth != 1)
  7894. {
  7895. month = month.AddMonths(-1);
  7896. }
  7897. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  7898. if (sre.Status == Constant.ServiceResultStatus.Success)
  7899. {
  7900. actionResult.Status = (int)Constant.PDAResult.Success;
  7901. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7902. }
  7903. else
  7904. {
  7905. actionResult.Status = (int)Constant.PDAResult.Fail;
  7906. actionResult.Message = sre.Message;
  7907. }
  7908. return actionResult;
  7909. }
  7910. // 成型月度结算-明细
  7911. if (action == "GetGroutingSettlementDetail")
  7912. {
  7913. DateTime month = DateTime.Now;
  7914. month = new DateTime(month.Year, month.Month, 1);
  7915. //month = new DateTime(2017, 6, 1);
  7916. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7917. if (currentMonth != 1)
  7918. {
  7919. month = month.AddMonths(-1);
  7920. }
  7921. string goodsCode = data["GoodsCode"].ToString();
  7922. string detailDate = data["DetailDate"].ToString();
  7923. DateTime? date = null;
  7924. if (detailDate != "合计")
  7925. {
  7926. date = DateTime.Parse(detailDate);
  7927. }
  7928. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  7929. if (sre.Status == Constant.ServiceResultStatus.Success)
  7930. {
  7931. actionResult.Status = (int)Constant.PDAResult.Success;
  7932. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7933. }
  7934. else
  7935. {
  7936. actionResult.Status = (int)Constant.PDAResult.Fail;
  7937. actionResult.Message = sre.Message;
  7938. }
  7939. return actionResult;
  7940. }
  7941. // 产成品交接汇总
  7942. if (action == "GetFinishedProductHandoverSum")
  7943. {
  7944. DateTime date = DateTime.Parse(data["date"].ToString());
  7945. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  7946. data["goodscode"] as string, sUserInfo);
  7947. if (sre.Status == Constant.ServiceResultStatus.Success)
  7948. {
  7949. actionResult.Status = (int)Constant.PDAResult.Success;
  7950. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7951. }
  7952. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  7953. {
  7954. actionResult.Status = (int)Constant.PDAResult.Success;
  7955. }
  7956. else
  7957. {
  7958. actionResult.Status = (int)Constant.PDAResult.Fail;
  7959. actionResult.Message = sre.Message;
  7960. }
  7961. return actionResult;
  7962. }
  7963. //xuwei add 2019-10-21
  7964. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  7965. if (action == "GetSemiReworkDayCount")
  7966. {
  7967. //不指定参数查询当天
  7968. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  7969. //dateStr = "2019-10-17";
  7970. //指定参数查询特定日期
  7971. if(data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  7972. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  7973. if (sre.Status == Constant.ServiceResultStatus.Success)
  7974. {
  7975. actionResult.Status = (int)Constant.PDAResult.Success;
  7976. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7977. }
  7978. else
  7979. {
  7980. actionResult.Status = (int)Constant.PDAResult.Fail;
  7981. actionResult.Message = sre.Message;
  7982. }
  7983. return actionResult;
  7984. }
  7985. //xuwe end
  7986. return actionResult;
  7987. }
  7988. #endregion
  7989. #region 模具管理
  7990. if (module == "PC_Mould")
  7991. {
  7992. #region 模具新建画面数据初始化
  7993. if (action == "GetMouldAddInit")
  7994. {
  7995. ClientRequestEntity cre = new ClientRequestEntity();
  7996. cre.Properties["MouldID"] = 0;
  7997. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  7998. if (sre.Status == Constant.ServiceResultStatus.Success)
  7999. {
  8000. actionResult.Status = (int)Constant.PDAResult.Success;
  8001. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8002. }
  8003. else
  8004. {
  8005. actionResult.Status = (int)Constant.PDAResult.Fail;
  8006. actionResult.Message = sre.Message;
  8007. }
  8008. return actionResult;
  8009. }
  8010. #endregion
  8011. #region 验证模具产品型号
  8012. if (action == "CheckGoodsCodeOnMould")
  8013. {
  8014. ClientRequestEntity cre = new ClientRequestEntity();
  8015. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8016. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  8017. if (sre.Status == Constant.ServiceResultStatus.Success &&
  8018. sre.Data.Tables[0].Rows.Count > 0)
  8019. {
  8020. actionResult.Status = (int)Constant.PDAResult.Success;
  8021. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8022. }
  8023. else
  8024. {
  8025. actionResult.Status = (int)Constant.PDAResult.Fail;
  8026. actionResult.Message = "无效产品型号";
  8027. }
  8028. return actionResult;
  8029. }
  8030. #endregion
  8031. #region 验证模具生产工号
  8032. if (action == "CheckUserCodeOnMould")
  8033. {
  8034. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  8035. if (sre != null && sre.Rows.Count > 0)
  8036. {
  8037. actionResult.Status = (int)Constant.PDAResult.Success;
  8038. actionResult.Result = JsonHelper.ToJson(sre);
  8039. }
  8040. else
  8041. {
  8042. actionResult.Status = (int)Constant.PDAResult.Fail;
  8043. actionResult.Message = "无效生产工号";
  8044. }
  8045. return actionResult;
  8046. }
  8047. #endregion
  8048. #region 新建保存
  8049. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  8050. {
  8051. ClientRequestEntity cre = new ClientRequestEntity();
  8052. foreach (string item in data.Keys)
  8053. {
  8054. if (item == "ProductionDate")
  8055. {
  8056. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  8057. }
  8058. else
  8059. {
  8060. cre.Properties.Add(item, data[item]);
  8061. }
  8062. }
  8063. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  8064. if (sre.Status == Constant.ServiceResultStatus.Success)
  8065. {
  8066. actionResult.Status = (int)Constant.PDAResult.Success;
  8067. }
  8068. else
  8069. {
  8070. actionResult.Status = (int)Constant.PDAResult.Fail;
  8071. actionResult.Result = sre.OtherStatus;
  8072. actionResult.Message = sre.Message;
  8073. }
  8074. return actionResult;
  8075. }
  8076. #endregion
  8077. #region 模具编辑画面数据初始化
  8078. if (action == "GetMouldEditInfo")
  8079. {
  8080. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  8081. if (sre != null && sre.Rows.Count > 0)
  8082. {
  8083. actionResult.Status = (int)Constant.PDAResult.Success;
  8084. actionResult.Result = JsonHelper.ToJson(sre);
  8085. }
  8086. else
  8087. {
  8088. actionResult.Status = (int)Constant.PDAResult.Fail;
  8089. actionResult.Message = "无效模具条码";
  8090. }
  8091. return actionResult;
  8092. }
  8093. #endregion
  8094. #region 模具操作-画面初始化
  8095. if (action == "GetMouldOperationInit")
  8096. {
  8097. ClientRequestEntity cre = new ClientRequestEntity();
  8098. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8099. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8100. if (sre.Status == Constant.ServiceResultStatus.Success)
  8101. {
  8102. actionResult.Status = (int)Constant.PDAResult.Success;
  8103. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8104. }
  8105. else
  8106. {
  8107. actionResult.Status = (int)Constant.PDAResult.Fail;
  8108. actionResult.Result = sre.OtherStatus;
  8109. actionResult.Message = sre.Message;
  8110. }
  8111. return actionResult;
  8112. }
  8113. #endregion
  8114. #region 模具操作-验证模具条码
  8115. if (action == "CheckMouldBarcode")
  8116. {
  8117. ClientRequestEntity cre = new ClientRequestEntity();
  8118. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8119. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8120. if (sre.Status == Constant.ServiceResultStatus.Success)
  8121. {
  8122. if (sre.Data.Tables[0].Rows.Count == 0)
  8123. {
  8124. actionResult.Status = (int)Constant.PDAResult.Fail;
  8125. actionResult.Result = -1;
  8126. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8127. return actionResult;
  8128. }
  8129. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8130. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8131. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8132. #region 报损
  8133. if (mouldOperationType == 2)
  8134. {
  8135. if (mouldStatusID == 1 || mouldStatusID == 3)
  8136. {
  8137. actionResult.Status = (int)Constant.PDAResult.Success;
  8138. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8139. }
  8140. else
  8141. {
  8142. actionResult.Status = (int)Constant.PDAResult.Fail;
  8143. actionResult.Result = -2;
  8144. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8145. }
  8146. return actionResult;
  8147. }
  8148. #endregion
  8149. #region 撤销
  8150. if (mouldOperationType == 3)
  8151. {
  8152. if (mouldStatusID == 4)
  8153. {
  8154. actionResult.Status = (int)Constant.PDAResult.Success;
  8155. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8156. }
  8157. else
  8158. {
  8159. actionResult.Status = (int)Constant.PDAResult.Fail;
  8160. actionResult.Result = -2;
  8161. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  8162. }
  8163. return actionResult;
  8164. }
  8165. #endregion
  8166. #region 领用
  8167. if (mouldOperationType == 4)
  8168. {
  8169. if (mouldStatusID == 1)
  8170. {
  8171. actionResult.Status = (int)Constant.PDAResult.Success;
  8172. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8173. }
  8174. else
  8175. {
  8176. actionResult.Status = (int)Constant.PDAResult.Fail;
  8177. actionResult.Result = -2;
  8178. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  8179. }
  8180. return actionResult;
  8181. }
  8182. #endregion
  8183. #region 回收
  8184. if (mouldOperationType == 5)
  8185. {
  8186. if (mouldStatusID == 3)
  8187. {
  8188. actionResult.Status = (int)Constant.PDAResult.Success;
  8189. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8190. }
  8191. else
  8192. {
  8193. actionResult.Status = (int)Constant.PDAResult.Fail;
  8194. actionResult.Result = -2;
  8195. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  8196. }
  8197. return actionResult;
  8198. }
  8199. #endregion
  8200. #region 变更型号
  8201. if (mouldOperationType == -1)
  8202. {
  8203. if (mouldStatusID != 4)
  8204. {
  8205. actionResult.Status = (int)Constant.PDAResult.Success;
  8206. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8207. }
  8208. else
  8209. {
  8210. actionResult.Status = (int)Constant.PDAResult.Fail;
  8211. actionResult.Result = -2;
  8212. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  8213. }
  8214. return actionResult;
  8215. }
  8216. #endregion
  8217. #region 替换条码
  8218. if (mouldOperationType == -2)
  8219. {
  8220. actionResult.Status = (int)Constant.PDAResult.Success;
  8221. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8222. return actionResult;
  8223. }
  8224. #endregion
  8225. return actionResult;
  8226. }
  8227. }
  8228. #endregion
  8229. #region 模具操作-保存
  8230. if (action == "SetMouldOperation")
  8231. {
  8232. ClientRequestEntity cre = new ClientRequestEntity();
  8233. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8234. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8235. cre.Properties["Remarks"] = data["Remarks"];
  8236. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8237. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8238. {
  8239. cre.Properties["GoodsID"] = data["GoodsID"];
  8240. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8241. }
  8242. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8243. {
  8244. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8245. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8246. }
  8247. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8248. if (sre.Status == Constant.ServiceResultStatus.Success)
  8249. {
  8250. actionResult.Status = (int)Constant.PDAResult.Success;
  8251. }
  8252. else
  8253. {
  8254. actionResult.Status = (int)Constant.PDAResult.Fail;
  8255. }
  8256. return actionResult;
  8257. }
  8258. #endregion
  8259. #region 模具操作-替换条码
  8260. if (action == "ChangedMouldBarcode")
  8261. {
  8262. ClientRequestEntity cre = new ClientRequestEntity();
  8263. cre.Properties["MouldID"] = data["MouldID"];
  8264. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8265. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8266. cre.Properties["Remarks"] = data["Remarks"];
  8267. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8268. if (sre.Status == Constant.ServiceResultStatus.Success)
  8269. {
  8270. actionResult.Status = (int)Constant.PDAResult.Success;
  8271. }
  8272. else
  8273. {
  8274. actionResult.Status = (int)Constant.PDAResult.Fail;
  8275. actionResult.Result = sre.OtherStatus;
  8276. actionResult.Message = sre.Message;
  8277. }
  8278. return actionResult;
  8279. }
  8280. #endregion
  8281. #region 模具跟踪表
  8282. if (action == "GetMoldTracking")
  8283. {
  8284. ClientRequestEntity cre = new ClientRequestEntity();
  8285. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8286. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8287. if (sre.Status == Constant.ServiceResultStatus.Success)
  8288. {
  8289. actionResult.Status = (int)Constant.PDAResult.Success;
  8290. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8291. }
  8292. else
  8293. {
  8294. actionResult.Status = (int)Constant.PDAResult.Fail;
  8295. actionResult.Message = "此模具条码不存在";
  8296. }
  8297. return actionResult;
  8298. }
  8299. #endregion
  8300. return actionResult;
  8301. }
  8302. #endregion
  8303. #region 成型线模具管理
  8304. if (module == "PC_GroutingLineMould")
  8305. {
  8306. #region 获取当前用户成型线模具管理权限
  8307. if (action == "GetGMouldStatusRight")
  8308. {
  8309. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8310. actionResult.Status = (int)Constant.PDAResult.Success;
  8311. if (right != null && right.Rows.Count > 0)
  8312. {
  8313. actionResult.Result = JsonHelper.ToJson(right);
  8314. }
  8315. return actionResult;
  8316. }
  8317. #endregion
  8318. #region 获取成型线状态等信息,和成型模具信息
  8319. if (action == "GetGroutingLineMould")
  8320. {
  8321. int? groutingLineID = null;
  8322. string groutingLineCode = null;
  8323. if (data.ContainsKey("GroutingLineID"))
  8324. {
  8325. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8326. }
  8327. else
  8328. {
  8329. groutingLineCode = data["GroutingLineCode"] + "";
  8330. }
  8331. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8332. if (lineInfo == null)
  8333. {
  8334. actionResult.Status = (int)Constant.PDAResult.Fail;
  8335. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8336. }
  8337. else
  8338. {
  8339. actionResult.Status = (int)Constant.PDAResult.Success;
  8340. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8341. }
  8342. return actionResult;
  8343. }
  8344. #endregion
  8345. #region 模具操作-画面初始化
  8346. if (action == "GetMouldOperationInit")
  8347. {
  8348. ClientRequestEntity cre = new ClientRequestEntity();
  8349. cre.Properties["MouldOperationType"] = 2;
  8350. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8351. if (sre.Status == Constant.ServiceResultStatus.Success)
  8352. {
  8353. actionResult.Status = (int)Constant.PDAResult.Success;
  8354. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8355. }
  8356. else
  8357. {
  8358. actionResult.Status = (int)Constant.PDAResult.Fail;
  8359. actionResult.Result = sre.OtherStatus;
  8360. actionResult.Message = sre.Message;
  8361. }
  8362. return actionResult;
  8363. }
  8364. #endregion
  8365. #region 成型模具操作-画面初始化
  8366. if (action == "GetGroutingMouldOperationInit")
  8367. {
  8368. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8369. if (initData != null && initData.Rows.Count > 0)
  8370. {
  8371. actionResult.Status = (int)Constant.PDAResult.Success;
  8372. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8373. foreach (DataRow item in initData.Rows)
  8374. {
  8375. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8376. }
  8377. actionResult.Result = JsonHelper.ToJson(syssetting);
  8378. }
  8379. else
  8380. {
  8381. actionResult.Status = (int)Constant.PDAResult.Fail;
  8382. }
  8383. return actionResult;
  8384. }
  8385. #endregion
  8386. #region 模具操作-验证模具条码
  8387. if (action == "CheckMouldBarcode")
  8388. {
  8389. ClientRequestEntity cre = new ClientRequestEntity();
  8390. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8391. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8392. if (sre.Status == Constant.ServiceResultStatus.Success)
  8393. {
  8394. if (sre.Data.Tables[0].Rows.Count == 0)
  8395. {
  8396. actionResult.Status = (int)Constant.PDAResult.Fail;
  8397. actionResult.Result = -1;
  8398. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8399. return actionResult;
  8400. }
  8401. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8402. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8403. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8404. #region 上线
  8405. if (mouldOperationType == 6)
  8406. {
  8407. if (mouldStatusID == 1 || mouldStatusID == 3)
  8408. {
  8409. if (data.ContainsKey("GoodsID"))
  8410. {
  8411. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8412. {
  8413. actionResult.Status = (int)Constant.PDAResult.Fail;
  8414. actionResult.Result = -3;
  8415. actionResult.Message =
  8416. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8417. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8418. "】与当前不一致";
  8419. return actionResult;
  8420. }
  8421. }
  8422. actionResult.Status = (int)Constant.PDAResult.Success;
  8423. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8424. }
  8425. else
  8426. {
  8427. actionResult.Status = (int)Constant.PDAResult.Fail;
  8428. actionResult.Result = -2;
  8429. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8430. }
  8431. return actionResult;
  8432. }
  8433. #endregion
  8434. return actionResult;
  8435. }
  8436. }
  8437. #endregion
  8438. #region 停用
  8439. if (action == "StopGroutingLineDetail")
  8440. {
  8441. if (data == null || !data.ContainsKey("Details"))
  8442. {
  8443. actionResult.Status = (int)Constant.PDAResult.Fail;
  8444. actionResult.Message = "参数错误";
  8445. return actionResult;
  8446. }
  8447. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8448. DataTable gTable = new DataTable();
  8449. gTable.Columns.Add("GroutingLineID", typeof(int));
  8450. gTable.Columns.Add("GroutingLineCode");
  8451. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8452. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8453. gTable.Columns.Add("GroutingMouldCode");
  8454. gTable.Columns.Add("RecordRemarks");
  8455. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8456. gTable.Columns.Add("MouldID", typeof(int));
  8457. gTable.Columns.Add("MouldCode");
  8458. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8459. string groutingLineCode = data["GroutingLineCode"] + "";
  8460. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8461. foreach (Dictionary<string, object> item in details)
  8462. {
  8463. int? mouldID = null;
  8464. if (item.ContainsKey("MouldID"))
  8465. {
  8466. mouldID = Convert.ToInt32(item["MouldID"]);
  8467. if (mouldID == 0)
  8468. {
  8469. mouldID = null;
  8470. }
  8471. }
  8472. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8473. item["GLineDetailID"], item["GLineDetailCode"],
  8474. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8475. mouldID, item["MouldCode"]);
  8476. }
  8477. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8478. if (result > 0)
  8479. {
  8480. actionResult.Status = (int)Constant.PDAResult.Success;
  8481. }
  8482. else
  8483. {
  8484. actionResult.Status = (int)Constant.PDAResult.Fail;
  8485. actionResult.Result = result;
  8486. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8487. return actionResult;
  8488. }
  8489. return actionResult;
  8490. }
  8491. #endregion
  8492. #region 启用
  8493. if (action == "StartGroutingLineDetail")
  8494. {
  8495. if (data == null || !data.ContainsKey("Details"))
  8496. {
  8497. actionResult.Status = (int)Constant.PDAResult.Fail;
  8498. actionResult.Message = "参数错误";
  8499. return actionResult;
  8500. }
  8501. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8502. DataTable gTable = new DataTable();
  8503. gTable.Columns.Add("GroutingLineID", typeof(int));
  8504. gTable.Columns.Add("GroutingLineCode");
  8505. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8506. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8507. gTable.Columns.Add("GroutingMouldCode");
  8508. gTable.Columns.Add("RecordRemarks");
  8509. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8510. gTable.Columns.Add("MouldID", typeof(int));
  8511. gTable.Columns.Add("MouldCode");
  8512. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8513. string groutingLineCode = data["GroutingLineCode"] + "";
  8514. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8515. foreach (Dictionary<string, object> item in details)
  8516. {
  8517. int? mouldID = null;
  8518. if (item.ContainsKey("MouldID"))
  8519. {
  8520. mouldID = Convert.ToInt32(item["MouldID"]);
  8521. if (mouldID == 0)
  8522. {
  8523. mouldID = null;
  8524. }
  8525. }
  8526. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8527. item["GLineDetailID"], item["GLineDetailCode"],
  8528. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8529. mouldID, item["MouldCode"]);
  8530. }
  8531. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8532. if (result > 0)
  8533. {
  8534. actionResult.Status = (int)Constant.PDAResult.Success;
  8535. }
  8536. else
  8537. {
  8538. actionResult.Status = (int)Constant.PDAResult.Fail;
  8539. actionResult.Result = result;
  8540. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8541. return actionResult;
  8542. }
  8543. return actionResult;
  8544. }
  8545. #endregion
  8546. #region 维修
  8547. if (action == "RepairStartGroutingLineDetail")
  8548. {
  8549. if (data == null || !data.ContainsKey("Details"))
  8550. {
  8551. actionResult.Status = (int)Constant.PDAResult.Fail;
  8552. actionResult.Message = "参数错误";
  8553. return actionResult;
  8554. }
  8555. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8556. DataTable gTable = new DataTable();
  8557. gTable.Columns.Add("GroutingLineID", typeof(int));
  8558. gTable.Columns.Add("GroutingLineCode");
  8559. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8560. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8561. gTable.Columns.Add("GroutingMouldCode");
  8562. gTable.Columns.Add("RecordRemarks");
  8563. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8564. gTable.Columns.Add("MouldID", typeof(int));
  8565. gTable.Columns.Add("MouldCode");
  8566. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8567. string groutingLineCode = data["GroutingLineCode"] + "";
  8568. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8569. foreach (Dictionary<string, object> item in details)
  8570. {
  8571. int? mouldID = null;
  8572. if (item.ContainsKey("MouldID"))
  8573. {
  8574. mouldID = Convert.ToInt32(item["MouldID"]);
  8575. if (mouldID == 0)
  8576. {
  8577. mouldID = null;
  8578. }
  8579. }
  8580. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8581. item["GLineDetailID"], item["GLineDetailCode"],
  8582. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8583. mouldID, item["MouldCode"]);
  8584. }
  8585. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8586. if (result > 0)
  8587. {
  8588. actionResult.Status = (int)Constant.PDAResult.Success;
  8589. }
  8590. else
  8591. {
  8592. actionResult.Status = (int)Constant.PDAResult.Fail;
  8593. actionResult.Result = result;
  8594. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8595. return actionResult;
  8596. }
  8597. return actionResult;
  8598. }
  8599. #endregion
  8600. #region 结束维修
  8601. if (action == "RepairEndGroutingLineDetail")
  8602. {
  8603. if (data == null || !data.ContainsKey("Details"))
  8604. {
  8605. actionResult.Status = (int)Constant.PDAResult.Fail;
  8606. actionResult.Message = "参数错误";
  8607. return actionResult;
  8608. }
  8609. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8610. DataTable gTable = new DataTable();
  8611. gTable.Columns.Add("GroutingLineID", typeof(int));
  8612. gTable.Columns.Add("GroutingLineCode");
  8613. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8614. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8615. gTable.Columns.Add("GroutingMouldCode");
  8616. gTable.Columns.Add("RecordRemarks");
  8617. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8618. gTable.Columns.Add("MouldID", typeof(int));
  8619. gTable.Columns.Add("MouldCode");
  8620. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8621. string groutingLineCode = data["GroutingLineCode"] + "";
  8622. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8623. foreach (Dictionary<string, object> item in details)
  8624. {
  8625. int? mouldID = null;
  8626. if (item.ContainsKey("MouldID"))
  8627. {
  8628. mouldID = Convert.ToInt32(item["MouldID"]);
  8629. if (mouldID == 0)
  8630. {
  8631. mouldID = null;
  8632. }
  8633. }
  8634. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8635. item["GLineDetailID"], item["GLineDetailCode"],
  8636. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8637. mouldID, item["MouldCode"]);
  8638. }
  8639. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8640. if (result > 0)
  8641. {
  8642. actionResult.Status = (int)Constant.PDAResult.Success;
  8643. }
  8644. else
  8645. {
  8646. actionResult.Status = (int)Constant.PDAResult.Fail;
  8647. actionResult.Result = result;
  8648. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8649. return actionResult;
  8650. }
  8651. return actionResult;
  8652. }
  8653. #endregion
  8654. #region 换模
  8655. if (action == "ChangeGMouldStartGroutingLineDetail")
  8656. {
  8657. if (data == null || !data.ContainsKey("Details"))
  8658. {
  8659. actionResult.Status = (int)Constant.PDAResult.Fail;
  8660. actionResult.Message = "参数错误";
  8661. return actionResult;
  8662. }
  8663. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8664. DataTable gTable = new DataTable();
  8665. gTable.Columns.Add("GroutingLineID", typeof(int));
  8666. gTable.Columns.Add("GroutingLineCode");
  8667. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8668. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8669. gTable.Columns.Add("GroutingMouldCode");
  8670. gTable.Columns.Add("RecordRemarks");
  8671. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8672. gTable.Columns.Add("MouldID", typeof(int));
  8673. gTable.Columns.Add("MouldCode");
  8674. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8675. gTable.Columns.Add("MouldStatus", typeof(int));
  8676. gTable.Columns.Add("ScrapReason", typeof(int));
  8677. gTable.Columns.Add("ScrapResponsibility");
  8678. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8679. string groutingLineCode = data["GroutingLineCode"] + "";
  8680. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8681. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8682. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8683. string scrapResponsibility = data["ScrapRemarks"] + "";
  8684. foreach (Dictionary<string, object> item in details)
  8685. {
  8686. int? mouldID = null;
  8687. if (item.ContainsKey("MouldID"))
  8688. {
  8689. mouldID = Convert.ToInt32(item["MouldID"]);
  8690. if (mouldID == 0)
  8691. {
  8692. mouldID = null;
  8693. }
  8694. }
  8695. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8696. item["GLineDetailID"], item["GLineDetailCode"],
  8697. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8698. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8699. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8700. }
  8701. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  8702. if (result > 0)
  8703. {
  8704. actionResult.Status = (int)Constant.PDAResult.Success;
  8705. }
  8706. else
  8707. {
  8708. actionResult.Status = (int)Constant.PDAResult.Fail;
  8709. actionResult.Result = result;
  8710. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8711. return actionResult;
  8712. }
  8713. return actionResult;
  8714. }
  8715. #endregion
  8716. #region 变产
  8717. if (action == "UpdateLineStartGroutingLineDetail")
  8718. {
  8719. if (data == null || !data.ContainsKey("Details"))
  8720. {
  8721. actionResult.Status = (int)Constant.PDAResult.Fail;
  8722. actionResult.Message = "参数错误";
  8723. return actionResult;
  8724. }
  8725. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8726. DataTable gTable = new DataTable();
  8727. gTable.Columns.Add("GroutingLineID", typeof(int));
  8728. gTable.Columns.Add("GroutingLineCode");
  8729. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8730. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8731. gTable.Columns.Add("GroutingMouldCode");
  8732. gTable.Columns.Add("RecordRemarks");
  8733. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8734. gTable.Columns.Add("MouldID", typeof(int));
  8735. gTable.Columns.Add("MouldCode");
  8736. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8737. gTable.Columns.Add("MouldStatus", typeof(int));
  8738. gTable.Columns.Add("ScrapReason", typeof(int));
  8739. gTable.Columns.Add("ScrapResponsibility");
  8740. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8741. string groutingLineCode = data["GroutingLineCode"] + "";
  8742. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8743. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8744. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8745. string scrapResponsibility = data["ScrapRemarks"] + "";
  8746. foreach (Dictionary<string, object> item in details)
  8747. {
  8748. int? mouldID = null;
  8749. if (item.ContainsKey("MouldID"))
  8750. {
  8751. mouldID = Convert.ToInt32(item["MouldID"]);
  8752. if (mouldID == 0)
  8753. {
  8754. mouldID = null;
  8755. }
  8756. }
  8757. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8758. item["GLineDetailID"], item["GLineDetailCode"],
  8759. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8760. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8761. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8762. }
  8763. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  8764. if (result > 0)
  8765. {
  8766. actionResult.Status = (int)Constant.PDAResult.Success;
  8767. }
  8768. else
  8769. {
  8770. actionResult.Status = (int)Constant.PDAResult.Fail;
  8771. actionResult.Result = result;
  8772. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8773. return actionResult;
  8774. }
  8775. return actionResult;
  8776. }
  8777. #endregion
  8778. #region 整线变产
  8779. if (action == "UpdateAllLineStartGroutingLineDetail")
  8780. {
  8781. if (data == null || !data.ContainsKey("Details"))
  8782. {
  8783. actionResult.Status = (int)Constant.PDAResult.Fail;
  8784. actionResult.Message = "参数错误";
  8785. return actionResult;
  8786. }
  8787. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8788. DataTable gTable = new DataTable();
  8789. gTable.Columns.Add("GroutingLineID", typeof(int));
  8790. gTable.Columns.Add("GroutingLineCode");
  8791. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8792. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8793. gTable.Columns.Add("GroutingMouldCode");
  8794. gTable.Columns.Add("RecordRemarks");
  8795. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8796. gTable.Columns.Add("MouldID", typeof(int));
  8797. gTable.Columns.Add("MouldCode");
  8798. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8799. gTable.Columns.Add("MouldStatus", typeof(int));
  8800. gTable.Columns.Add("ScrapReason", typeof(int));
  8801. gTable.Columns.Add("ScrapResponsibility");
  8802. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8803. string groutingLineCode = data["GroutingLineCode"] + "";
  8804. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8805. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8806. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8807. string scrapResponsibility = data["ScrapRemarks"] + "";
  8808. foreach (Dictionary<string, object> item in details)
  8809. {
  8810. int? mouldID = null;
  8811. if (item.ContainsKey("MouldID"))
  8812. {
  8813. mouldID = Convert.ToInt32(item["MouldID"]);
  8814. if (mouldID == 0)
  8815. {
  8816. mouldID = null;
  8817. }
  8818. }
  8819. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8820. item["GLineDetailID"], item["GLineDetailCode"],
  8821. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8822. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8823. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8824. }
  8825. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  8826. if (result > 0)
  8827. {
  8828. actionResult.Status = (int)Constant.PDAResult.Success;
  8829. }
  8830. else
  8831. {
  8832. actionResult.Status = (int)Constant.PDAResult.Fail;
  8833. actionResult.Result = result;
  8834. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8835. return actionResult;
  8836. }
  8837. return actionResult;
  8838. }
  8839. #endregion
  8840. #region 卸模
  8841. if (action == "UnloadGroutingLineDetail")
  8842. {
  8843. if (data == null || !data.ContainsKey("Details"))
  8844. {
  8845. actionResult.Status = (int)Constant.PDAResult.Fail;
  8846. actionResult.Message = "参数错误";
  8847. return actionResult;
  8848. }
  8849. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8850. DataTable gTable = new DataTable();
  8851. gTable.Columns.Add("GroutingLineID", typeof(int));
  8852. gTable.Columns.Add("GroutingLineCode");
  8853. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8854. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8855. gTable.Columns.Add("GroutingMouldCode");
  8856. gTable.Columns.Add("RecordRemarks");
  8857. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8858. gTable.Columns.Add("MouldID", typeof(int));
  8859. gTable.Columns.Add("MouldCode");
  8860. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8861. gTable.Columns.Add("MouldStatus", typeof(int));
  8862. gTable.Columns.Add("ScrapReason", typeof(int));
  8863. gTable.Columns.Add("ScrapResponsibility");
  8864. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8865. string groutingLineCode = data["GroutingLineCode"] + "";
  8866. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8867. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8868. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8869. string scrapResponsibility = data["ScrapRemarks"] + "";
  8870. foreach (Dictionary<string, object> item in details)
  8871. {
  8872. int? mouldID = null;
  8873. if (item.ContainsKey("MouldID"))
  8874. {
  8875. mouldID = Convert.ToInt32(item["MouldID"]);
  8876. if (mouldID == 0)
  8877. {
  8878. mouldID = null;
  8879. }
  8880. }
  8881. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8882. item["GLineDetailID"], item["GLineDetailCode"],
  8883. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8884. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8885. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8886. }
  8887. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  8888. if (result > 0)
  8889. {
  8890. actionResult.Status = (int)Constant.PDAResult.Success;
  8891. }
  8892. else
  8893. {
  8894. actionResult.Status = (int)Constant.PDAResult.Fail;
  8895. actionResult.Result = result;
  8896. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8897. return actionResult;
  8898. }
  8899. return actionResult;
  8900. }
  8901. #endregion
  8902. #region 结束换模
  8903. if (action == "ChangeGMouldEndGroutingLineDetail")
  8904. {
  8905. if (data == null || !data.ContainsKey("Details"))
  8906. {
  8907. actionResult.Status = (int)Constant.PDAResult.Fail;
  8908. actionResult.Message = "参数错误";
  8909. return actionResult;
  8910. }
  8911. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8912. DataTable gTable = new DataTable();
  8913. gTable.Columns.Add("GroutingLineID", typeof(int));
  8914. gTable.Columns.Add("GroutingLineCode");
  8915. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8916. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8917. gTable.Columns.Add("GroutingMouldCode");
  8918. gTable.Columns.Add("RreasonRemarks");
  8919. gTable.Columns.Add("RecordRemarks");
  8920. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8921. gTable.Columns.Add("MouldID", typeof(int));
  8922. gTable.Columns.Add("MouldCode");
  8923. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8924. gTable.Columns.Add("GoodsID", typeof(int));
  8925. gTable.Columns.Add("GoodsCode");
  8926. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8927. gTable.Columns.Add("GroutingCount", typeof(int));
  8928. gTable.Columns.Add("MouldSource");
  8929. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8930. string groutingLineCode = data["GroutingLineCode"] + "";
  8931. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8932. foreach (Dictionary<string, object> item in details)
  8933. {
  8934. int? mouldID = null;
  8935. if (item.ContainsKey("MouldID"))
  8936. {
  8937. mouldID = Convert.ToInt32(item["MouldID"]);
  8938. if (mouldID == 0)
  8939. {
  8940. mouldID = null;
  8941. }
  8942. }
  8943. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8944. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  8945. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8946. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8947. item["GoodsID"], item["GoodsCode"],
  8948. item["StandardGroutingCount"], item["GroutingCount"],
  8949. (mouldID == null ? "0" : "1"));
  8950. }
  8951. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  8952. if (result.Status == Constant.ServiceResultStatus.Success)
  8953. {
  8954. actionResult.Status = (int)Constant.PDAResult.Success;
  8955. }
  8956. else if (result.OtherStatus == -100)
  8957. {
  8958. actionResult.Status = (int)Constant.PDAResult.Fail;
  8959. actionResult.Result = -100;
  8960. actionResult.Message = result.Message;
  8961. return actionResult;
  8962. }
  8963. else
  8964. {
  8965. actionResult.Status = (int)Constant.PDAResult.Fail;
  8966. actionResult.Result = -500;
  8967. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8968. return actionResult;
  8969. }
  8970. return actionResult;
  8971. }
  8972. #endregion
  8973. #region 结束变产
  8974. if (action == "UpdateLineEndGroutingLineDetail")
  8975. {
  8976. if (data == null || !data.ContainsKey("Details"))
  8977. {
  8978. actionResult.Status = (int)Constant.PDAResult.Fail;
  8979. actionResult.Message = "参数错误";
  8980. return actionResult;
  8981. }
  8982. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8983. DataTable gTable = new DataTable();
  8984. gTable.Columns.Add("GroutingLineID", typeof(int));
  8985. gTable.Columns.Add("GroutingLineCode");
  8986. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8987. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8988. gTable.Columns.Add("GroutingMouldCode");
  8989. gTable.Columns.Add("RreasonRemarks");
  8990. gTable.Columns.Add("RecordRemarks");
  8991. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8992. gTable.Columns.Add("MouldID", typeof(int));
  8993. gTable.Columns.Add("MouldCode");
  8994. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8995. gTable.Columns.Add("GoodsID", typeof(int));
  8996. gTable.Columns.Add("GoodsCode");
  8997. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8998. gTable.Columns.Add("GroutingCount", typeof(int));
  8999. gTable.Columns.Add("MouldSource");
  9000. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9001. string groutingLineCode = data["GroutingLineCode"] + "";
  9002. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9003. foreach (Dictionary<string, object> item in details)
  9004. {
  9005. int? mouldID = null;
  9006. if (item.ContainsKey("MouldID"))
  9007. {
  9008. mouldID = Convert.ToInt32(item["MouldID"]);
  9009. if (mouldID == 0)
  9010. {
  9011. mouldID = null;
  9012. }
  9013. }
  9014. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9015. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9016. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9017. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9018. item["GoodsID"], item["GoodsCode"],
  9019. item["StandardGroutingCount"], item["GroutingCount"],
  9020. (mouldID == null ? "0" : "1"));
  9021. }
  9022. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  9023. if (result.Status == Constant.ServiceResultStatus.Success)
  9024. {
  9025. actionResult.Status = (int)Constant.PDAResult.Success;
  9026. }
  9027. else if (result.OtherStatus == -100)
  9028. {
  9029. actionResult.Status = (int)Constant.PDAResult.Fail;
  9030. actionResult.Result = -100;
  9031. actionResult.Message = result.Message;
  9032. return actionResult;
  9033. }
  9034. else
  9035. {
  9036. actionResult.Status = (int)Constant.PDAResult.Fail;
  9037. actionResult.Result = -500;
  9038. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9039. return actionResult;
  9040. }
  9041. return actionResult;
  9042. }
  9043. #endregion
  9044. #region 结束整线变产
  9045. if (action == "UpdateAllLineEndGroutingLineDetail")
  9046. {
  9047. if (data == null || !data.ContainsKey("Details"))
  9048. {
  9049. actionResult.Status = (int)Constant.PDAResult.Fail;
  9050. actionResult.Message = "参数错误";
  9051. return actionResult;
  9052. }
  9053. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9054. DataTable gTable = new DataTable();
  9055. gTable.Columns.Add("GroutingLineID", typeof(int));
  9056. gTable.Columns.Add("GroutingLineCode");
  9057. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9058. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9059. gTable.Columns.Add("GroutingMouldCode");
  9060. gTable.Columns.Add("Remarks");
  9061. gTable.Columns.Add("RecordRemarks");
  9062. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9063. gTable.Columns.Add("MouldID", typeof(int));
  9064. gTable.Columns.Add("MouldCode");
  9065. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9066. gTable.Columns.Add("GoodsID", typeof(int));
  9067. gTable.Columns.Add("GoodsCode");
  9068. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9069. gTable.Columns.Add("GroutingCount", typeof(int));
  9070. gTable.Columns.Add("MouldSource");
  9071. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9072. string groutingLineCode = data["GroutingLineCode"] + "";
  9073. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9074. foreach (Dictionary<string, object> item in details)
  9075. {
  9076. int? mouldID = null;
  9077. if (item.ContainsKey("MouldID"))
  9078. {
  9079. mouldID = Convert.ToInt32(item["MouldID"]);
  9080. if (mouldID == 0)
  9081. {
  9082. mouldID = null;
  9083. }
  9084. }
  9085. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9086. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9087. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  9088. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9089. item["GoodsID"], item["GoodsCode"],
  9090. item["StandardGroutingCount"], item["GroutingCount"],
  9091. (mouldID == null ? "0" : "1"));
  9092. }
  9093. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  9094. if (result.Status == Constant.ServiceResultStatus.Success)
  9095. {
  9096. actionResult.Status = (int)Constant.PDAResult.Success;
  9097. }
  9098. else if (result.OtherStatus == -100)
  9099. {
  9100. actionResult.Status = (int)Constant.PDAResult.Fail;
  9101. actionResult.Result = -100;
  9102. actionResult.Message = result.Message;
  9103. return actionResult;
  9104. }
  9105. else
  9106. {
  9107. actionResult.Status = (int)Constant.PDAResult.Fail;
  9108. actionResult.Result = -500;
  9109. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9110. return actionResult;
  9111. }
  9112. return actionResult;
  9113. }
  9114. #endregion
  9115. #region 上模
  9116. if (action == "UpdateGroutingLine_AddMould")
  9117. {
  9118. if (data == null || !data.ContainsKey("Details"))
  9119. {
  9120. actionResult.Status = (int)Constant.PDAResult.Fail;
  9121. actionResult.Message = "参数错误";
  9122. return actionResult;
  9123. }
  9124. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9125. DataTable gTable = new DataTable();
  9126. gTable.Columns.Add("GroutingLineID", typeof(int));
  9127. gTable.Columns.Add("GroutingLineCode");
  9128. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9129. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9130. gTable.Columns.Add("GroutingMouldCode");
  9131. gTable.Columns.Add("Remarks");
  9132. gTable.Columns.Add("RecordRemarks");
  9133. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9134. gTable.Columns.Add("MouldID", typeof(int));
  9135. gTable.Columns.Add("MouldCode");
  9136. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9137. gTable.Columns.Add("GoodsID", typeof(int));
  9138. gTable.Columns.Add("GoodsCode");
  9139. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9140. gTable.Columns.Add("GroutingCount", typeof(int));
  9141. gTable.Columns.Add("MouldSource");
  9142. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9143. string groutingLineCode = data["GroutingLineCode"] + "";
  9144. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9145. foreach (Dictionary<string, object> item in details)
  9146. {
  9147. int? mouldID = null;
  9148. if (item.ContainsKey("MouldID"))
  9149. {
  9150. mouldID = Convert.ToInt32(item["MouldID"]);
  9151. if (mouldID == 0)
  9152. {
  9153. mouldID = null;
  9154. }
  9155. }
  9156. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  9157. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9158. gldID, item["GLineDetailCode"],
  9159. item["DetailRemarks"], item["RecordRemarks"],
  9160. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  9161. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9162. item["GoodsID"], item["GoodsCode"],
  9163. item["StandardGroutingCount"], item["GroutingCount"],
  9164. (mouldID == null ? "0" : "1"));
  9165. }
  9166. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  9167. if (result.Status == Constant.ServiceResultStatus.Success)
  9168. {
  9169. actionResult.Status = (int)Constant.PDAResult.Success;
  9170. }
  9171. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  9172. {
  9173. actionResult.Status = (int)Constant.PDAResult.Fail;
  9174. actionResult.Result = result.OtherStatus;
  9175. actionResult.Message = result.Message;
  9176. return actionResult;
  9177. }
  9178. else
  9179. {
  9180. actionResult.Status = (int)Constant.PDAResult.Fail;
  9181. actionResult.Result = -500;
  9182. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9183. return actionResult;
  9184. }
  9185. return actionResult;
  9186. }
  9187. #endregion
  9188. return actionResult;
  9189. }
  9190. #endregion
  9191. #region 包装装板限制
  9192. if (module == "FinishedLoadingCar")
  9193. {
  9194. if (action == "GetSetting")
  9195. {
  9196. ClientRequestEntity cre = new ClientRequestEntity();
  9197. cre.Properties["GoodsID"] = data["GoodsID"];
  9198. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9199. if (sre.Status == Constant.ServiceResultStatus.Success)
  9200. {
  9201. actionResult.Status = (int)Constant.PDAResult.Success;
  9202. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9203. {
  9204. if (item["settingcode"].ToString() == "S_PM_011")
  9205. {
  9206. cre.Properties["S_PM_011"] = item["settingvalue"];
  9207. }
  9208. else if (item["settingcode"].ToString() == "S_PM_012")
  9209. {
  9210. cre.Properties["S_PM_012"] = item["settingvalue"];
  9211. }
  9212. else if (item["settingcode"].ToString() == "S_PM_013")
  9213. {
  9214. cre.Properties["S_PM_013"] = item["settingvalue"];
  9215. }
  9216. }
  9217. cre.Properties["PlatelitNum"] = sre.Result;
  9218. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9219. }
  9220. else
  9221. {
  9222. actionResult.Status = (int)Constant.PDAResult.Fail;
  9223. actionResult.Message = "";
  9224. }
  9225. return actionResult;
  9226. }
  9227. }
  9228. #endregion
  9229. #region 成型报损
  9230. if (module == "GroutingScrapProduct")
  9231. {
  9232. // 查询注浆日报明细表
  9233. if ("GetGroutingDailyDetail" == action)
  9234. {
  9235. ClientRequestEntity cre = new ClientRequestEntity();
  9236. cre.NameSpace = module;
  9237. cre.Name = action;
  9238. if (!string.IsNullOrEmpty(jsonData))
  9239. {
  9240. cre.Properties["BarCode"] = data["BarCode"];
  9241. }
  9242. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9243. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9244. actionResult.Status = (int)Constant.PDAResult.Success;
  9245. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9246. || sre.Data.Tables[0].Rows.Count == 0)
  9247. {
  9248. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9249. actionResult.Status = (int)Constant.PDAResult.Fail;
  9250. }
  9251. else
  9252. {
  9253. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9254. // 判断是否进行了注浆
  9255. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9256. {
  9257. actionResult.Message = "该产品还未进行注浆!";
  9258. actionResult.Status = (int)Constant.PDAResult.Fail;
  9259. }
  9260. // 判断是否进行了交坯
  9261. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9262. {
  9263. actionResult.Message = "该产品已经交坯!";
  9264. actionResult.Status = (int)Constant.PDAResult.Fail;
  9265. }
  9266. // 判断是否已经报损
  9267. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9268. {
  9269. actionResult.Message = "该产品已经报损!";
  9270. actionResult.Status = (int)Constant.PDAResult.Fail;
  9271. }
  9272. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9273. }
  9274. }
  9275. // 获取成型报损原因
  9276. else if ("GetScrapReasonData" == action)
  9277. {
  9278. ClientRequestEntity cre = new ClientRequestEntity();
  9279. cre.NameSpace = module;
  9280. cre.Name = action;
  9281. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo);
  9282. actionResult.Status = (int)Constant.PDAResult.Success;
  9283. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9284. }
  9285. // 保存成型报损
  9286. else if ("SaveGroutingScrapProduct" == action)
  9287. {
  9288. ClientRequestEntity cre = new ClientRequestEntity();
  9289. cre.NameSpace = module;
  9290. cre.Name = action;
  9291. if (!string.IsNullOrEmpty(jsonData))
  9292. {
  9293. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9294. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9295. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9296. if (dt != null && dt.Rows.Count > 0)
  9297. {
  9298. // 总单信息
  9299. DataRow properties = dt.Rows[0];
  9300. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9301. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9302. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9303. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9304. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9305. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9306. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9307. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9308. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9309. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9310. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9311. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9312. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9313. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9314. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9315. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9316. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9317. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9318. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9319. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9320. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9321. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9322. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9323. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9324. // 责任员工
  9325. cre.Data = new DataSet();
  9326. //DataTable returnTable = returnData.Tables[1].Copy();
  9327. cre.Data.Tables.Add(dtResponsible);
  9328. }
  9329. }
  9330. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9331. if (sre.Status == Constant.ServiceResultStatus.Success)
  9332. {
  9333. actionResult.Status = (int)Constant.PDAResult.Success;
  9334. actionResult.Result = sre.Result;
  9335. }
  9336. else
  9337. {
  9338. actionResult.Status = (int)Constant.PDAResult.Fail;
  9339. actionResult.Result = sre.OtherStatus;
  9340. actionResult.Message = sre.Message;
  9341. }
  9342. }
  9343. // 获取成型报损信息 用于撤销使用
  9344. else if ("GetGroutingScrapProduct" == action)
  9345. {
  9346. ClientRequestEntity cre = new ClientRequestEntity();
  9347. cre.NameSpace = module;
  9348. cre.Name = action;
  9349. if (!string.IsNullOrEmpty(jsonData))
  9350. {
  9351. cre.Properties["BarCode"] = data["BarCode"];
  9352. }
  9353. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9354. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9355. actionResult.Status = (int)Constant.PDAResult.Success;
  9356. }
  9357. //xuwei add 2020-03-23
  9358. //获取成型报损信息 用于撤销使用 支持 浆日报直接报损
  9359. else if ("GetGroutingScrap" == action)
  9360. {
  9361. ClientRequestEntity cre = new ClientRequestEntity();
  9362. cre.NameSpace = module;
  9363. cre.Name = action;
  9364. if (!string.IsNullOrEmpty(jsonData))
  9365. {
  9366. cre.Properties["BarCode"] = data["BarCode"];
  9367. }
  9368. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrap(cre, sUserInfo);
  9369. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9370. actionResult.Status = (int)Constant.PDAResult.Success;
  9371. }
  9372. // 撤销成型报损
  9373. else if ("ReverseGroutingScrapProduct" == action)
  9374. {
  9375. ClientRequestEntity cre = new ClientRequestEntity();
  9376. cre.NameSpace = module;
  9377. cre.Name = action;
  9378. if (!string.IsNullOrEmpty(jsonData))
  9379. {
  9380. cre.Properties["BarCode"] = data["BarCode"];
  9381. }
  9382. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9383. if (sre.Status == Constant.ServiceResultStatus.Success)
  9384. {
  9385. actionResult.Status = (int)Constant.PDAResult.Success;
  9386. actionResult.Result = sre.Result;
  9387. }
  9388. else
  9389. {
  9390. actionResult.Status = (int)Constant.PDAResult.Fail;
  9391. actionResult.Result = sre.OtherStatus;
  9392. actionResult.Message = sre.Message;
  9393. }
  9394. }
  9395. }
  9396. #endregion
  9397. #region 产品挂起
  9398. if (module == "ProductSuspend")
  9399. {
  9400. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9401. if (action == "GetSuspendProcedure")
  9402. {
  9403. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9404. if (sre.Status == Constant.ServiceResultStatus.Success)
  9405. {
  9406. actionResult.Status = (int)Constant.PDAResult.Success;
  9407. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9408. }
  9409. else
  9410. {
  9411. actionResult.Status = (int)Constant.PDAResult.Fail;
  9412. actionResult.Message = sre.Message;
  9413. }
  9414. return actionResult;
  9415. }
  9416. // 验证挂起条码
  9417. if (action == "CheckSuspendBarcode")
  9418. {
  9419. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9420. if (sre.Status == Constant.ServiceResultStatus.Success)
  9421. {
  9422. actionResult.Status = (int)Constant.PDAResult.Success;
  9423. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9424. }
  9425. else
  9426. {
  9427. actionResult.Status = (int)Constant.PDAResult.Fail;
  9428. actionResult.Message = sre.Message;
  9429. }
  9430. return actionResult;
  9431. }
  9432. // 挂起条码
  9433. if (action == "SaveSuspendProduct")
  9434. {
  9435. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9436. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9437. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9438. if (sre.Status == Constant.ServiceResultStatus.Success)
  9439. {
  9440. actionResult.Status = (int)Constant.PDAResult.Success;
  9441. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9442. }
  9443. else
  9444. {
  9445. actionResult.Status = (int)Constant.PDAResult.Fail;
  9446. actionResult.Message = sre.Message;
  9447. }
  9448. return actionResult;
  9449. }
  9450. // 撤销挂起条码
  9451. if (action == "DeleteSuspendProduct")
  9452. {
  9453. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9454. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9455. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9456. if (sre.Status == Constant.ServiceResultStatus.Success)
  9457. {
  9458. actionResult.Status = (int)Constant.PDAResult.Success;
  9459. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9460. }
  9461. else
  9462. {
  9463. actionResult.Status = (int)Constant.PDAResult.Fail;
  9464. actionResult.Message = sre.Message;
  9465. }
  9466. return actionResult;
  9467. }
  9468. // 查询挂起条码
  9469. if (action == "GetSuspendProduct")
  9470. {
  9471. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9472. if (sre.Status == Constant.ServiceResultStatus.Success)
  9473. {
  9474. if (sre.Data.Tables[0].Rows.Count == 0)
  9475. {
  9476. actionResult.Status = (int)Constant.PDAResult.Fail;
  9477. actionResult.Message = "此条码没有可撤销的挂起信息";
  9478. }
  9479. else
  9480. {
  9481. actionResult.Status = (int)Constant.PDAResult.Success;
  9482. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9483. }
  9484. }
  9485. else
  9486. {
  9487. actionResult.Status = (int)Constant.PDAResult.Fail;
  9488. actionResult.Message = sre.Message;
  9489. }
  9490. return actionResult;
  9491. }
  9492. }
  9493. #endregion
  9494. #region 品保抽查
  9495. if (module == "QASpotCheck")
  9496. {
  9497. if (action == "GetAllQASpotCheck")
  9498. {
  9499. ClientRequestEntity cre = new ClientRequestEntity();
  9500. cre.NameSpace = module;
  9501. cre.Name = action;
  9502. if (data != null && data.Count > 0)
  9503. {
  9504. foreach (string item in data.Keys)
  9505. {
  9506. if (item.StartsWith("checktime"))
  9507. {
  9508. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9509. }
  9510. else
  9511. {
  9512. cre.Properties.Add(item, data[item]);
  9513. }
  9514. }
  9515. }
  9516. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9517. if (sre.Status == Constant.ServiceResultStatus.Success)
  9518. {
  9519. actionResult.Status = (int)Constant.PDAResult.Success;
  9520. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9521. }
  9522. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9523. {
  9524. actionResult.Status = (int)Constant.PDAResult.Success;
  9525. }
  9526. else
  9527. {
  9528. actionResult.Status = (int)Constant.PDAResult.Fail;
  9529. actionResult.Message = sre.Message;
  9530. }
  9531. return actionResult;
  9532. }
  9533. if (action == "AutoSaveQASpotCheck")
  9534. {
  9535. string barcode = data["barcode"] + "";
  9536. string remarks = data["remarks"] + "";
  9537. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9538. if (sre.Status == Constant.ServiceResultStatus.Success)
  9539. {
  9540. actionResult.Status = (int)Constant.PDAResult.Success;
  9541. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9542. }
  9543. else
  9544. {
  9545. actionResult.Status = (int)Constant.PDAResult.Fail;
  9546. actionResult.Message = sre.Message;
  9547. }
  9548. return actionResult;
  9549. }
  9550. if (action == "CheckQASpotCheck")
  9551. {
  9552. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9553. if (sre.Status == Constant.ServiceResultStatus.Success)
  9554. {
  9555. actionResult.Status = (int)Constant.PDAResult.Success;
  9556. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9557. }
  9558. else
  9559. {
  9560. actionResult.Status = (int)Constant.PDAResult.Fail;
  9561. actionResult.Message = sre.Message;
  9562. }
  9563. return actionResult;
  9564. }
  9565. if (action == "SaveQASpotCheck")
  9566. {
  9567. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9568. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9569. if (sre.Status == Constant.ServiceResultStatus.Success)
  9570. {
  9571. actionResult.Status = (int)Constant.PDAResult.Success;
  9572. }
  9573. else
  9574. {
  9575. actionResult.Status = (int)Constant.PDAResult.Fail;
  9576. actionResult.Message = sre.Message;
  9577. }
  9578. return actionResult;
  9579. }
  9580. return null;
  9581. }
  9582. #endregion
  9583. #region 产成品交接
  9584. if (module == "FinishedProduct")
  9585. {
  9586. // 设定商标
  9587. if (action == "GetFinishedBarcode")
  9588. {
  9589. string barcode = data["barcode"].ToString();
  9590. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  9591. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9592. if (Convert.ToInt32(resultEntity.Result) < 0)
  9593. {
  9594. actionResult.Status = (int)Constant.PDAResult.Fail;
  9595. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9596. actionResult.Message = resultEntity.Message;
  9597. }
  9598. else
  9599. {
  9600. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9601. actionResult.Status = (int)Constant.PDAResult.Success;
  9602. actionResult.Message = resultEntity.Message;
  9603. }
  9604. return actionResult;
  9605. }
  9606. if (action == "GetHandoveredBarcode")
  9607. {
  9608. string barcode = data["barcode"].ToString();
  9609. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  9610. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9611. if (Convert.ToInt32(resultEntity.Result) < 0)
  9612. {
  9613. actionResult.Status = (int)Constant.PDAResult.Fail;
  9614. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9615. actionResult.Message = resultEntity.Message;
  9616. }
  9617. else
  9618. {
  9619. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9620. actionResult.Status = (int)Constant.PDAResult.Success;
  9621. actionResult.Message = resultEntity.Message;
  9622. }
  9623. return actionResult;
  9624. }
  9625. if (action == "SetFinishedLogo")
  9626. {
  9627. int logoid = Convert.ToInt32(data["logoid"]);
  9628. string[] barcodes = data["barcodes"].ToString().Split(',');
  9629. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo);
  9630. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9631. if (result < 0)
  9632. {
  9633. actionResult.Status = (int)Constant.PDAResult.Fail;
  9634. }
  9635. else
  9636. {
  9637. actionResult.Status = (int)Constant.PDAResult.Success;
  9638. }
  9639. return actionResult;
  9640. }
  9641. if (action == "SetHandoveredOrder")
  9642. {
  9643. int orderID = Convert.ToInt32(data["orderID"]);
  9644. string[] barcodes = data["barcodes"].ToString().Split(',');
  9645. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  9646. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9647. if (result < 0)
  9648. {
  9649. actionResult.Status = (int)Constant.PDAResult.Fail;
  9650. }
  9651. else
  9652. {
  9653. actionResult.Status = (int)Constant.PDAResult.Success;
  9654. }
  9655. return actionResult;
  9656. }
  9657. }
  9658. #endregion
  9659. #region 产成品装车
  9660. /*
  9661. if (module == "FinishedLoading")
  9662. {
  9663. // 设定商标
  9664. if (action == "GetMaxLoadingNo")
  9665. {
  9666. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  9667. actionResult.Status = (int)Constant.PDAResult.Success;
  9668. actionResult.Result = no;
  9669. return actionResult;
  9670. }
  9671. if (action == "CheckFinishedLaodingBarcode")
  9672. {
  9673. string barcode = data["barcode"].ToString();
  9674. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  9675. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  9676. {
  9677. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9678. actionResult.Status = (int)Constant.PDAResult.Success;
  9679. actionResult.Message = resultEntity.Message;
  9680. }
  9681. else
  9682. {
  9683. actionResult.Status = (int)Constant.PDAResult.Fail;
  9684. actionResult.Result = resultEntity.OtherStatus;
  9685. actionResult.Message = resultEntity.Message;
  9686. }
  9687. return actionResult;
  9688. }
  9689. if (action == "SaveFinishedLoading")
  9690. {
  9691. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  9692. string carLicense = data["carLicense"] + "";
  9693. int palletNum = Convert.ToInt32(data["palletNum"]);
  9694. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  9695. string remarks = data["remarks"] + "";
  9696. Dictionary<string, object>[] details =
  9697. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  9698. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  9699. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  9700. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  9701. if (result.Status == Constant.ServiceResultStatus.Success)
  9702. {
  9703. actionResult.Status = (int)Constant.PDAResult.Success;
  9704. actionResult.Message = result.Message;
  9705. }
  9706. else
  9707. {
  9708. actionResult.Status = (int)Constant.PDAResult.Fail;
  9709. actionResult.Result = result.OtherStatus;
  9710. actionResult.Message = result.Message;
  9711. }
  9712. return actionResult;
  9713. }
  9714. }
  9715. */
  9716. #endregion
  9717. #region 产成品质量改判
  9718. if (module == "FinishedProductTamper")
  9719. {
  9720. // 获取产成品信息及缺陷数据
  9721. if (action == "GetDefectData")
  9722. {
  9723. string barcode = data["barcode"].ToString();
  9724. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  9725. if (sre.Status == Constant.ServiceResultStatus.Success)
  9726. {
  9727. actionResult.Status = (int)Constant.PDAResult.Success;
  9728. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9729. actionResult.Message = sre.Message;
  9730. }
  9731. else
  9732. {
  9733. actionResult.Status = (int)Constant.PDAResult.Fail;
  9734. actionResult.Result = sre.OtherStatus;
  9735. actionResult.Message = sre.Message;
  9736. }
  9737. return actionResult;
  9738. }
  9739. // 获取产成品信息及缺陷数据
  9740. if (action == "SaveDefectData")
  9741. {
  9742. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  9743. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  9744. if (sre.Status == Constant.ServiceResultStatus.Success)
  9745. {
  9746. actionResult.Status = (int)Constant.PDAResult.Success;
  9747. actionResult.Message = sre.Message;
  9748. }
  9749. else
  9750. {
  9751. actionResult.Status = (int)Constant.PDAResult.Fail;
  9752. actionResult.Message = sre.Message;
  9753. }
  9754. return actionResult;
  9755. }
  9756. // 通过条码查出责任工序(成品改判用)
  9757. if (action == "GetDutyProcedureByBarCodeForTamper")
  9758. {
  9759. string barcode = data["barcode"] + "";
  9760. int defectid = int.Parse(data["defectid"] + "");
  9761. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  9762. if (sre.Status == Constant.ServiceResultStatus.Success)
  9763. {
  9764. actionResult.Status = (int)Constant.PDAResult.Success;
  9765. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9766. actionResult.Message = sre.Message;
  9767. }
  9768. else
  9769. {
  9770. actionResult.Status = (int)Constant.PDAResult.Fail;
  9771. actionResult.Result = sre.OtherStatus;
  9772. actionResult.Message = sre.Message;
  9773. }
  9774. return actionResult;
  9775. }
  9776. }
  9777. #endregion
  9778. #region PDA独立功能
  9779. #region 水效标识
  9780. if (module == "WaterEffect")
  9781. {
  9782. // 获取产成品信息及水效标识
  9783. if (action == "GetGoodsByBarCode")
  9784. {
  9785. string barcode = data["barcode"].ToString();
  9786. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  9787. if (sre.Status == Constant.ServiceResultStatus.Success)
  9788. {
  9789. actionResult.Status = (int)Constant.PDAResult.Success;
  9790. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9791. actionResult.Message = sre.Message;
  9792. }
  9793. else
  9794. {
  9795. actionResult.Status = (int)Constant.PDAResult.Fail;
  9796. actionResult.Result = sre.OtherStatus;
  9797. actionResult.Message = sre.Message;
  9798. }
  9799. return actionResult;
  9800. }
  9801. }
  9802. #endregion
  9803. #region 盖板型号
  9804. if (module == "SeatCoverType")
  9805. {
  9806. // 获取产成品信息及水效标识
  9807. if (action == "SendGoodsCodeToPLC")
  9808. {
  9809. string barcode = data["barcode"].ToString();
  9810. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  9811. if (sre == 0)
  9812. {
  9813. actionResult.Status = (int)Constant.PDAResult.Success;
  9814. }
  9815. else
  9816. {
  9817. actionResult.Status = (int)Constant.PDAResult.Fail;
  9818. actionResult.Result = sre;
  9819. switch (sre)
  9820. {
  9821. case 1:
  9822. case 2:
  9823. actionResult.Message = "无效条码";
  9824. break;
  9825. case 3:
  9826. actionResult.Message = "此产品型号没有设置盖板标识码";
  9827. break;
  9828. case 4:
  9829. actionResult.Message = "当前用户没有设置PLC参数";
  9830. break;
  9831. case 5:
  9832. actionResult.Message = "PLC参数设置不全";
  9833. break;
  9834. default:
  9835. actionResult.Message = "PLC通信异常";
  9836. break;
  9837. }
  9838. }
  9839. return actionResult;
  9840. }
  9841. }
  9842. #endregion
  9843. #region PDA PLC 相关功能
  9844. if (module == "PDA_FUN_PLC")
  9845. {
  9846. // PDA扫码发送到PLCServer
  9847. if (action == "SendBarcodeToPLCServer")
  9848. {
  9849. string barcode = data["barcode"].ToString();
  9850. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  9851. if (sre == 0)
  9852. {
  9853. actionResult.Status = (int)Constant.PDAResult.Success;
  9854. }
  9855. else
  9856. {
  9857. actionResult.Status = (int)Constant.PDAResult.Fail;
  9858. actionResult.Result = sre;
  9859. switch (sre)
  9860. {
  9861. case 1:
  9862. case 2:
  9863. actionResult.Message = "无效条码";
  9864. break;
  9865. case 3:
  9866. actionResult.Message = "PLC通信异常";
  9867. break;
  9868. case 4:
  9869. actionResult.Message = "当前用户没有设置PLC参数";
  9870. break;
  9871. case 5:
  9872. actionResult.Message = "PLC参数设置不全";
  9873. break;
  9874. default:
  9875. actionResult.Message = "PLC通信异常";
  9876. break;
  9877. }
  9878. }
  9879. return actionResult;
  9880. }
  9881. }
  9882. #endregion
  9883. #endregion
  9884. #region 半检返修
  9885. if (module == "SemiRework")
  9886. {
  9887. // 验证半检返修条码
  9888. if (action == "CheckSemiReworkBarcode")
  9889. {
  9890. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9891. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  9892. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9893. if (Convert.ToInt32(resultEntity.Result) < 0)
  9894. {
  9895. actionResult.Status = (int)Constant.PDAResult.Fail;
  9896. }
  9897. else
  9898. {
  9899. actionResult.Status = (int)Constant.PDAResult.Success;
  9900. }
  9901. actionResult.Message = resultEntity.Message;
  9902. return actionResult;
  9903. }
  9904. // 可以返修的工序
  9905. if (action == "GetSemiReworkProcedure")
  9906. {
  9907. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9908. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  9909. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9910. actionResult.Status = (int)Constant.PDAResult.Success;
  9911. return actionResult;
  9912. }
  9913. // 根据条码获取经过的工序,用于责任工序
  9914. if (action == "GetSemiReworkPassProcedure")
  9915. {
  9916. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9917. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  9918. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9919. actionResult.Status = (int)Constant.PDAResult.Success;
  9920. return actionResult;
  9921. }
  9922. // 根据所选生产工序(生产数据ID)查询责任员工
  9923. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  9924. {
  9925. int productionDataID = Convert.ToInt32(jsonData);
  9926. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9927. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  9928. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9929. actionResult.Status = (int)Constant.PDAResult.Success;
  9930. return actionResult;
  9931. }
  9932. // 根据所选工号,查出缺陷责任员工
  9933. if (action == "GetSemiReworkDefectStaffByUserID")
  9934. {
  9935. int userID = Convert.ToInt32(jsonData);
  9936. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9937. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  9938. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9939. actionResult.Status = (int)Constant.PDAResult.Success;
  9940. return actionResult;
  9941. }
  9942. // 新建半检返修
  9943. if (action == "AddSemiRework")
  9944. {
  9945. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"]+"");
  9946. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9947. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  9948. actionResult.Result = resultEntity.Result;
  9949. actionResult.Message = resultEntity.Message;
  9950. if (Convert.ToInt32(resultEntity.Result) > 0)
  9951. {
  9952. actionResult.Status = (int)Constant.PDAResult.Success;
  9953. }
  9954. else
  9955. {
  9956. actionResult.Status = (int)Constant.PDAResult.Fail;
  9957. }
  9958. return actionResult;
  9959. }
  9960. // 编辑半检返修
  9961. if (action == "EditSemiRework")
  9962. {
  9963. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9964. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9965. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  9966. actionResult.Result = resultEntity.Result;
  9967. actionResult.Message = resultEntity.Message;
  9968. if (Convert.ToInt32(resultEntity.Result) > 0)
  9969. {
  9970. actionResult.Status = (int)Constant.PDAResult.Success;
  9971. }
  9972. else
  9973. {
  9974. actionResult.Status = (int)Constant.PDAResult.Fail;
  9975. }
  9976. return actionResult;
  9977. }
  9978. // 撤销半检返修
  9979. if (action == "CancelSemiRework")
  9980. {
  9981. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  9982. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9983. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  9984. actionResult.Result = resultEntity.Result;
  9985. actionResult.Message = resultEntity.Message;
  9986. if (Convert.ToInt32(resultEntity.Result) > 0)
  9987. {
  9988. actionResult.Status = (int)Constant.PDAResult.Success;
  9989. }
  9990. else
  9991. {
  9992. actionResult.Status = (int)Constant.PDAResult.Fail;
  9993. }
  9994. return actionResult;
  9995. }
  9996. // 获取半检返修数据(PDA编辑用)
  9997. if (action == "GetSemiReworkByID")
  9998. {
  9999. int id = Convert.ToInt32(jsonData);
  10000. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10001. PMModuleLogic.GetSemiReworkByID(id,sUserInfo.UserCode);
  10002. DataTable data1 = resultEntity.Data.Tables[0];
  10003. DataTable data2 = resultEntity.Data.Tables[1];
  10004. DataTable data3 = resultEntity.Data.Tables[2];
  10005. if (data1.Rows.Count == 0)
  10006. {
  10007. actionResult.Status = (int)Constant.PDAResult.Fail;
  10008. actionResult.Message = "半检返修信息不存在";
  10009. return actionResult;
  10010. }
  10011. SemiReworkEntity srEntity = new SemiReworkEntity();
  10012. srEntity.SemiReworkID = id;
  10013. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  10014. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  10015. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  10016. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  10017. foreach (DataRow row2 in data2.Rows)
  10018. {
  10019. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  10020. srEntity.SemiReworkDefects.Add(defectEntity);
  10021. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  10022. defectEntity.SemiReworkID = id;
  10023. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  10024. defectEntity.DefectCode = row2["DefectCode"] + "";
  10025. defectEntity.DefectName = row2["DefectName"] + "";
  10026. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  10027. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  10028. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  10029. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  10030. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  10031. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  10032. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  10033. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  10034. defectEntity.Remarks = row2["Remarks"] + "";
  10035. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  10036. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  10037. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  10038. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  10039. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  10040. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  10041. if (row3s.Length == 0)
  10042. {
  10043. continue;
  10044. }
  10045. foreach (DataRow row3 in row3s)
  10046. {
  10047. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  10048. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  10049. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  10050. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  10051. semiReworkRPS.StaffName = row3["StaffName"] + "";
  10052. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  10053. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  10054. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  10055. semiReworkRPS.UserCode = row3["UserCode"] + "";
  10056. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  10057. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  10058. }
  10059. }
  10060. //xuwei note 总单用于显示,信息较全
  10061. actionResult.Message = JsonHelper.ToJson(data1);
  10062. //xuwei note 总单信息不全,但有明细,用于回传保存
  10063. actionResult.Result = JsonHelper.ToJson(srEntity);
  10064. actionResult.Status = (int)Constant.PDAResult.Success;
  10065. }
  10066. }
  10067. #endregion
  10068. #region 窑车漏扫补件
  10069. if (module == "F_PM_0504")
  10070. {
  10071. // 验证窑车编码是否存在
  10072. if (action == "CheckKilnCar")
  10073. {
  10074. ClientRequestEntity cre = new ClientRequestEntity();
  10075. cre.Properties["kilncarcode"] = data["KilnCarCode"];
  10076. cre.Properties["procedureID"] = data["ProcedureID"];
  10077. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo);
  10078. if (sre.Status == Constant.ServiceResultStatus.Success)
  10079. {
  10080. actionResult.Status = (int)Constant.PDAResult.Success;
  10081. actionResult.Result = sre.Result;
  10082. }
  10083. else
  10084. {
  10085. actionResult.Status = (int)Constant.PDAResult.Fail;
  10086. actionResult.Message = sre.Message;
  10087. }
  10088. return actionResult;
  10089. }
  10090. // 验证窑车烧成批次号是否存在 和 是否能补漏扫
  10091. if (action == "CheckKilnCarBatchNo")
  10092. {
  10093. ClientRequestEntity cre = new ClientRequestEntity();
  10094. cre.Properties["KilnID"] = data["KilnID"];
  10095. cre.Properties["KilnCarID"] = data["KilnCarID"];
  10096. cre.Properties["ProcedureID"] = data["ProcedureID"];
  10097. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10098. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo);
  10099. if (sre.Status == Constant.ServiceResultStatus.Success)
  10100. {
  10101. actionResult.Status = (int)Constant.PDAResult.Success;
  10102. }
  10103. else
  10104. {
  10105. actionResult.Status = (int)Constant.PDAResult.Fail;
  10106. actionResult.Message = sre.Message;
  10107. }
  10108. return actionResult;
  10109. }
  10110. // 窑车漏扫补件
  10111. if (action == "SetKilnCarMissing")
  10112. {
  10113. ClientRequestEntity cre = new ClientRequestEntity();
  10114. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10115. string carData = data["CarData"] + "";
  10116. DataTable dataTable = JsonHelper.FromJson<DataTable>(carData);
  10117. cre.Data = new DataSet();
  10118. cre.Data.Tables.Add(dataTable);
  10119. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo);
  10120. if (sre.Status == Constant.ServiceResultStatus.Success)
  10121. {
  10122. actionResult.Status = (int)Constant.PDAResult.Success;
  10123. }
  10124. else
  10125. {
  10126. actionResult.Status = (int)Constant.PDAResult.Fail;
  10127. actionResult.Message = sre.Message;
  10128. }
  10129. return actionResult;
  10130. }
  10131. }
  10132. #endregion
  10133. return actionResult;
  10134. }
  10135. catch (Exception ex)
  10136. {
  10137. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  10138. OutputLog.TraceLog(LogPriority.Error,
  10139. this.ToString(),
  10140. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  10141. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  10142. " module:" + module + " action:" + action + " json:" + jsonData,
  10143. ex.ToString(),
  10144. LocalPath.LogExePath);
  10145. actionResult.Status = (int)Constant.PDAResult.Exception;
  10146. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  10147. }
  10148. return actionResult;
  10149. }
  10150. #endregion
  10151. }
  10152. }